1 #if !defined(_COMPONENTDATA_H_) 2 #define _COMPONENTDATA_H_ 4 #include "MemoryManager.h" 5 #include "DataMessage.h" 10 #define PARAM_INTEGER 2 12 #define PARAM_STRING_COLL 4 13 #define PARAM_INTEGER_COLL 5 14 #define PARAM_FLOAT_COLL 6 15 #define PARAM_TYPE_COLL 3 31 char name[MAXKEYNAMELEN+1];
57 uint64 lastUpdateTime;
58 char name[MAXKEYNAMELEN];
110 static bool UnitTest();
112 static ComponentData* CreateComponent(uint32
id,
const char* name, uint32 size, uint16 nodeID, uint16 procID);
113 static bool RecordRemoteComponent(uint32
id,
const char* name, uint16 nodeID, uint64 time);
114 static bool ReserveComponentID(uint32
id,
const char* name);
115 static bool DestroyComponent(uint32 cid);
117 static bool GetComponentName(uint32 cid,
char* name, uint32 maxNameLen);
118 static bool GetComponentID(
const char* name, uint32 &cid);
121 static bool IsComponentLocal(uint32 cid);
122 static bool IsComponentLocal(
const char* name);
123 static uint16 GetComponentNodeID(uint32 cid);
124 static uint16 GetComponentProcessID(uint32 cid);
125 static char* GetAndRemoveComponent(uint32 cid, uint32& dataSize);
126 static bool AddExistingComponent(uint32 cid, uint16 nodeID, uint16 procID,
char* oldData, uint32 dataSize);
127 static bool UpdateRemoteComponent(uint32 cid, uint16 nodeID, uint16 procID,
const char* name);
128 static bool AddComponentStats(uint32 cid, uint64 userCPU, uint64 kernelCPU,
133 bool destroyComponent();
134 bool resize(uint32 increase);
135 uint32 getAvailableDataSize();
138 bool setPrivateData(
const char* name,
const char* data, uint32 size);
139 uint32 getPrivateDataSize(
const char* name);
140 bool getPrivateDataCopy(
const char* name,
char* data, uint32 maxSize);
141 bool replacePrivateData(
const char* name,
const char* data, uint32 size);
142 bool replacePrivateData(
const char* name,
const char* data, uint32 size, uint32 offset);
143 bool deletePrivateData(
const char* name);
146 bool createParameter(
const char* name,
const char* val,
const char* defaultValue = NULL);
147 bool createParameter(
const char* name,
const char* val, uint32 count, uint32 defaultIndex);
148 bool createParameter(
const char* name, std::vector<std::string> values,
const char* defaultValue = NULL);
149 bool createParameter(
const char* name, int64* val, uint32 count, uint32 defaultIndex);
150 bool createParameter(
const char* name, std::vector<std::string> values, int64 defaultValue = 0);
151 bool createParameter(
const char* name, float64* val, uint32 count, uint32 defaultIndex);
152 bool createParameter(
const char* name, std::vector<std::string> values, float64 defaultValue = 0);
153 bool createParameter(
const char* name, int64 val, int64 min = 0, int64 max = 0, int64 interval = 0);
154 bool createParameter(
const char* name, float64 val, float64 min = 0, float64 max = 0, float64 interval = 0);
156 bool hasParameter(
const char* name);
157 bool deleteParameter(
const char* name);
159 uint8 getParameterDataType(
const char* name);
160 uint32 getParameterValueSize(
const char* name);
161 bool getParameter(
const char* name,
char* val, uint32 maxSize);
162 bool getParameter(
const char* name, int64& val);
163 bool getParameter(
const char* name, float64& val);
165 bool setParameter(
const char* name,
const char* val);
166 bool setParameter(
const char* name, int64 val);
167 bool setParameter(
const char* name, float64 val);
169 bool resetParameter(
const char* name);
170 bool tweakParameter(
const char* name, int32 tweak);
174 static bool UnlockComponentMap();
176 static bool InsertComponentPageID(uint32 cid, uint32 pageID, uint16 nodeID, uint16 procID,
const char* name);
177 static bool GetComponentPageID(uint32 cid, uint32& pageID);
178 static bool GetNextAvailableComponentID(uint32& cid);
179 static bool FreeComponentID(uint32 cid);
181 char* makeRoomForPrivateData(uint32 newSize);
182 char* makeRoomForParameter(uint32 newSize);
188 #endif //_COMPONENTDATA_H_ Definition: ComponentData.h:75
Definition: ComponentData.h:99
Definition: ComponentData.h:47
Definition: ComponentData.h:105
Definition: ComponentData.h:34
Definition: ComponentData.h:69
Definition: ComponentData.h:25
Definition: DataMessage.h:95
Definition: ComponentData.h:84