diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-15 14:20:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-15 14:20:13 +0000 |
commit | 89c0bc88bd4ebdc44dfb99235609c90e968af533 (patch) | |
tree | 1f381edf91aff4da09ea3b1515107dd20c19a71e /src/core/info.h | |
parent | b513c7d9bf6fba4a26e734ce405996f665d9c835 (diff) |
added core::Info id, changed network info message, updated entity network message to include the info id
Diffstat (limited to 'src/core/info.h')
-rw-r--r-- | src/core/info.h | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/core/info.h b/src/core/info.h index 0296ec9..8b9a89b 100644 --- a/src/core/info.h +++ b/src/core/info.h @@ -61,16 +61,31 @@ public: typedef std::deque<std::string> Text; /** - * @brief create a new information record - * The constructor automaticly adds the instance to the registry + * @brief create a new server-side information record + * This constructor assigns an id + */ + Info(const InfoType *type); + + /** + * @brief create a new client-side information record + * This constructor doesn not assign an id */ - Info(const InfoType *type = 0); + Info(const InfoType *type, const std::string & label); + + /** + * @brief create a new client-side information record + */ + Info(const unsigned int id); /// delete the information record virtual ~Info(); /* ---- inspectors ------------------------------------------------- */ + inline const unsigned int id() const { + return info_id; + } + inline const InfoType* type() const { return info_type; } @@ -98,6 +113,8 @@ public: /* ---- mutators --------------------------------------------------- */ + void set_id(const unsigned int); + void set_modelname(const std::string & modelname); void set_modelname(const char *modelname); @@ -124,11 +141,9 @@ public: /// clear the timestamp void clear_timestamp(); -protected: - - /// set the info class id + /// set the info class type void set_type(const InfoType *type); - + public: /* ---- serializers ------------------------------------------------ */ @@ -140,6 +155,7 @@ public: private: const InfoType* info_type; + unsigned int info_id; long info_price; unsigned long info_timestamp; @@ -160,6 +176,9 @@ public: return info_registry; } + /// search the info registry for a record with the specified id + static Info *find(const unsigned int id); + /// search the info registry for a labeled item static Info *find(const char * label); @@ -181,6 +200,12 @@ public: /// clear the info registry static void clear(); + /// print the list header + static void list_header(); + + /// list a single record + static void list(const Info *info); + /// list the info registry static void list(); |