# 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

explicit DataNotification(
std::string topic
);

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

### DataNotification

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

Creates the DataNotification with a topic and payload.

## Destructor

### ~DataNotification

~DataNotification() override = default;

## Member Functions

### payload

const T & payload() const;

Returns the payload.

### payload

T & payload();

Returns a modifiable reference to the payload.

### setPayload

void setPayload(
T data
);

Sets the payload.

### topic

std::string topic() const;

Returns the notification topic.