#include <Siena.h>
Public Member Functions | |
| Notification () | |
| Notification (const Notification &) | |
| Notification & | operator= (const string &) |
Notification represents an event notification. Attribute names are standard C++ strings while attribute values are AttributeValues. A name uniquely identifies an attribute in an Notification.
An Notification is implemented as a map<string, AttributeValue>, therefore All the functions of the standard map template can be used to manipulate an Notification. For instance:
Notification e;
// ...
// prints out attribute names of e
//
for(Notification::iterator i = e.begin(); i != e.end(); ++i)
cout << (*i).first;
Of course, every operation on an Notification can take advantage of the access functions and assignment operators of AttributeValue.
Notification e;
e["stock"] = "XYZ";
e["price"] = 12.34
e["quantity"] = 567;
int q = e["quantity"];
The structure of names and types of an Notification is completely arbitrary for Siena. In other words, Siena does not require any pre-defined attribute. It is up to applications to agree on sets of names, types, and semantics of attributes.
publisher.cc, and subscriber.cc.
| Notification::Notification | ( | ) |
construct an empty notification
| Notification::Notification | ( | const Notification & | ) |
copy constructor
| Notification& Notification::operator= | ( | const string & | ) |
fills in the attributes of this notification from a string representation of a notification
Notification e;
e = "{ dest = \"MXP\" price = 850 }";