Poco

template < typename T >

class DataNotification

Library: Foundation
Package: Notifications
Header: Poco/Notification.h

Description

DataNotification carries a topic and an associated payload of type T.

Inheritance

Direct Base Classes: Notification

All Base Classes: Notification, RefCountedObject

Member Summary

Member Functions: payload, setPayload, topic

Inherited Functions: duplicate, name, referenceCount, release

Types Aliases

Ptr

using Ptr = AutoPtr < DataNotification < T >>;

Constructors

DataNotification inline

explicit DataNotification(
    std::string topic
);

Creates the DataNotification with a topic and a default-constructed payload.

DataNotification inline

template < typename U = T > DataNotification(
    std::string topic,
    U && data
);

Creates the DataNotification with a topic and payload.

Destructor

~DataNotification virtual

~DataNotification() override = default;

Member Functions

payload inline

const T & payload() const;

Returns the payload.

payload inline

T & payload();

Returns a modifiable reference to the payload.

setPayload inline

void setPayload(
    T data
);

Sets the payload.

topic inline

std::string topic() const;

Returns the notification topic.