diff options
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(); |