From 887244db14f00063ebd429a8535fb204a96bee4e Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 23 Jan 2015 00:30:20 +0100 Subject: Improved documentation --- src/core/managed/Managed.hpp | 32 ++++++++++++++++++++++++++++++++ src/core/managed/Manager.hpp | 3 ++- 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src') 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 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 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> 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); -- cgit v1.2.3