#includeIn this example, we create a custom notification class `MyNotification` with two string parameters: `channel` and `user`. We also create an observer class `MyObserver` which listens for `MyNotification` notifications and prints out a message with the `channel` and `user` parameters. In the `main()` function, we create an instance of `MyObserver` and post two `MyNotification` notifications to the default notification center. The package library used in this example is Poco::Notification.#include #include #include class MyNotification: public Poco::Notification { public: MyNotification(std::string channel, std::string user) : _channel(channel), _user(user) { } const std::string& channel() const { return _channel; } const std::string& user() const { return _user; } private: std::string _channel; std::string _user; }; class MyObserver { public: MyObserver() { Poco::NotificationCenter::defaultCenter().addObserver( Poco::Observer (*this, &MyObserver::handleNotification)); } void handleNotification(MyNotification* pNf) { std::cout << "User " << pNf->user() << " is subscribed to channel " << pNf->channel() << std::endl; } }; int main() { MyObserver o; Poco::NotificationCenter::defaultCenter().postNotification(new MyNotification("Channel A", "User A")); Poco::NotificationCenter::defaultCenter().postNotification(new MyNotification("Channel B", "User B")); }