diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-23 00:30:20 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-23 00:30:20 +0100 |
commit | 887244db14f00063ebd429a8535fb204a96bee4e (patch) | |
tree | d77b01a249958420bf730690e66fc2c37bc23d86 | |
parent | 9b9c7439b6cb1b711901ad49cd4855e1b0964652 (diff) |
Improved documentation
-rw-r--r-- | src/core/managed/Managed.hpp | 32 | ||||
-rw-r--r-- | src/core/managed/Manager.hpp | 3 |
2 files changed, 34 insertions, 1 deletions
diff --git a/src/core/managed/Managed.hpp b/src/core/managed/Managed.hpp index 08158b2..8b594ea 100644 --- a/src/core/managed/Managed.hpp +++ b/src/core/managed/Managed.hpp @@ -143,14 +143,46 @@ public: /* Data store methods */ + /** + * Stores arbitrary data under the given key. Data will be overriden. This + * function can be used to attach data to the Managed object. + * + * @param key is an arbitrary string key that under which the data should + * be stored. + * @param h is the data that should be stored. + */ void storeData(const std::string &key, Handle<Managed> h); + /** + * Returns true if data was stored under the given key. + * + * @return true if data was stored under the given key, false otherwise. + */ bool hasDataKey(const std::string &key); + /** + * Returns data previously stored under the given key. + * + * @param key is the key specifying the slot from which the data should be + * read. + * @return previously stored data or nullptr if no data was stored for this + * key. + */ Rooted<Managed> readData(const std::string &key); + /** + * Returns a copy of all data that was attached to the node. + * + * @return a map between keys and stored data. + */ std::map<std::string, Rooted<Managed>> readData(); + /** + * Deletes all data entries with the given key from the node. + * + * @param key is the key specifying the slot that should be deleted. + * @return true if the operation was successful, false otherwise. + */ bool deleteData(const std::string &key); /* Event handling methods */ diff --git a/src/core/managed/Manager.hpp b/src/core/managed/Manager.hpp index fec4bd1..7a93736 100644 --- a/src/core/managed/Manager.hpp +++ b/src/core/managed/Manager.hpp @@ -320,7 +320,8 @@ public: * references. * * @param uid is the unique id for which the object should be returned. - * @return a pointer to the object with the given uid. + * @return a pointer to the object with the given uid or nullptr if the + * object no longer exists. */ Managed * getManaged(ManagedUid uid); |