|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Accessor for the shared component registry. More...
#include <ComponentMemory.h>
Public Member Functions | |
| ComponentMemory (MasterMemory *master) | |
| ~ComponentMemory () | |
| bool | getMemoryUsage (uint64 &alloc, uint64 &usage) |
| Report allocation/usage of the component segment. | |
| bool | open () |
| Attach to the existing component segment. | |
| bool | create (uint32 indexSize) |
| Create the component segment (master only). | |
| std::vector< ComponentInfoStruct > * | getAllComponents () |
| Snapshot all components. | |
| std::vector< ComponentInfoStruct > * | getAllLocalComponents () |
| Snapshot components on this node. | |
| std::vector< ComponentInfoStruct > * | getAllLocalComponents (uint8 type) |
| Snapshot local components of type. | |
| std::vector< ComponentInfoStruct > * | getAllModules () |
| Snapshot all module components. | |
| std::vector< ComponentInfoStruct > * | getAllCatalogs () |
| Snapshot all catalog components. | |
| bool | writeComponentsToMsg (DataMessage *msg) |
| Serialize all component records into msg. | |
| bool | writeComponentNamesToMsg (DataMessage *msg) |
| Write just the component names into msg. | |
| bool | syncComponents (DataMessage *msg) |
| Merge component records received from a remote node. | |
| bool | confirmComponentID (uint32 id) |
| Mark a provisionally reserved component id as ready (syncStatus 2). | |
| bool | cancelComponentID (uint32 id) |
| Release a provisionally reserved component id. | |
| uint8 | lookupComponentID (const char *name, uint32 &id) |
| Look up a component by name without filtering on readiness. | |
| bool | createComponent (uint32 id, uint8 type, uint8 policy, uint8 selfTrigger, const char *name, uint64 size, uint16 nodeID, uint16 procID, uint64 time, uint32 &existingID) |
| Register a component record. | |
| bool | destroyComponent (uint32 cid) |
| Remove a component record and free its space. | |
| bool | getComponentName (uint32 cid, char *name, uint32 maxNameLen) |
| Copy the component name into name. | |
| std::string | getComponentNameString (uint32 cid) |
| uint8 | getComponentType (uint32 cid) |
| bool | getComponentID (const char *name, uint32 &cid) |
| Look up a component id by name. | |
| ComponentStats | getComponentStats (uint32 cid) |
| bool | setComponentStats (uint32 cid, ComponentStats &stats) |
| Overwrite the component's stats. | |
| AveragePerfStats | getComponentPerfStats (uint32 cid) |
| bool | setComponentPerfStats (uint32 cid, AveragePerfStats &perfStruct) |
| Store new performance averages. | |
| bool | isComponentLocal (uint32 cid) |
| bool | isComponentLocal (const char *name) |
| bool | getComponentLocation (uint32 cid, uint16 &nodeID, uint16 &procID) |
| Get the node/process the component runs in. | |
| uint8 | getComponentPolicy (uint32 cid) |
| bool | updateComponentInformation (uint32 cid, uint8 type, uint8 policy, uint8 selfTrigger, uint16 nodeID, uint16 procID) |
| Update type/policy/self-trigger/location in one call. | |
| bool | setComponentPolicy (uint32 cid, uint8 policy) |
| bool | setComponentPaused (uint32 cid, bool paused) |
| Set or clear COMPONENT_PAUSED (stop / start). | |
| bool | isComponentPaused (uint32 cid) |
| Set the migration policy. | |
| uint8 | getComponentSelfTrigger (uint32 cid) |
| bool | setComponentSelfTrigger (uint32 cid, uint8 selfTrigger) |
| Set the self-trigger policy. | |
| uint16 | getComponentNodeID (uint32 cid) |
| uint16 | getComponentProcessID (uint32 cid) |
| bool | updateComponentLocation (uint32 cid, uint16 nodeID, uint16 procID) |
| Record a new location (after migration). | |
| bool | addComponentStats (uint32 cid, uint8 status, uint64 usageCPUTicks, DataMessage *inputMsg, DataMessage *outputMsg, uint32 runCount, uint32 cycleCount) |
| Fold a run's activity into the component's stats (counters, rings, CPU ticks). | |
| bool | canComponentMigrate (uint32 cid) |
| std::list< uint16 > * | findProcessComponents (uint16 procID) |
| List ids of components in process procID. | |
| char * | getComponentData (uint32 cid, uint64 &size) |
| Copy a component's whole data area (for migration). | |
| bool | setComponentData (uint32 cid, const char *data, uint64 size, bool wasMigrated) |
| Replace a component's data area (after migration). | |
| bool | hasParameter (uint32 cid, const char *name) |
| bool | deleteParameter (uint32 cid, const char *name) |
| Remove the parameter. | |
| bool | addLocalPerformanceStats (std::list< PerfStats > &perfStats) |
| Append PerfStats for all local components. | |
| std::string | printFriendly () |
| std::string | toXML (bool stats=true) |
Private data (named binary blobs owned by a component) | |
Blobs are stored inline in the component record with optional mimetype. | |
| bool | setPrivateData (uint32 cid, const char *name, const char *data, uint64 size, const char *mimetype=NULL) |
| Create/replace blob name. | |
| uint64 | getPrivateDataSize (uint32 cid, const char *name) |
| std::string | getPrivateDataMimetype (uint32 cid, const char *name) |
| bool | getPrivateData (uint32 cid, const char *name, char *data, uint64 maxSize) |
| Copy blob into caller buffer data (max maxSize). | |
| char * | getPrivateDataCopy (uint32 cid, const char *name, uint64 &size) |
| bool | deletePrivateData (uint32 cid, const char *name) |
| Delete blob name. | |
| std::map< std::string, std::string > | getPrivateDataKeysAndTypes (uint32 cid) |
| std::list< std::string > | getPrivateDataKeys (uint32 cid) |
Parameter creation | |
Overloads create string/integer/float parameters or collections thereof; values are copied into the component record. min/max/interval of 0 mean unconstrained.
| |
| bool | createParameter (uint32 cid, const char *name, const char *val, const char *defaultValue=NULL) |
| bool | createParameter (uint32 cid, const char *name, const char *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (uint32 cid, const char *name, std::vector< std::string > values, const char *defaultValue=NULL) |
| bool | createParameter (uint32 cid, const char *name, int64 *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (uint32 cid, const char *name, std::vector< std::string > values, int64 defaultValue) |
| bool | createParameter (uint32 cid, const char *name, std::vector< int64 > values, int64 defaultValue=0) |
| bool | createParameter (uint32 cid, const char *name, float64 *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (uint32 cid, const char *name, std::vector< std::string > values, float64 defaultValue) |
| bool | createParameter (uint32 cid, const char *name, std::vector< float64 > values, float64 defaultValue=0) |
| bool | createParameter (uint32 cid, const char *name, int64 val, int64 min=0, int64 max=0, int64 interval=0) |
| bool | createParameter (uint32 cid, const char *name, float64 val, float64 min=0, float64 max=0, float64 interval=0) |
Static Public Member Functions | |
| static bool | UnitTest () |
| Self-test. | |
Parameter access | |
Typed getters convert where sensible; getters return 0/empty on missing parameters. Setters clamp to min/max where configured.
| |
| static const char * | ParamTypeName (uint8 type) |
| uint8 | getParameterDataType (uint32 cid, const char *name) |
| uint32 | getParameterValueSize (uint32 cid, const char *name) |
| bool | getParameter (uint32 cid, const char *name, char *val, uint32 maxSize) |
| bool | getParameter (uint32 cid, const char *name, int64 &val) |
| bool | getParameter (uint32 cid, const char *name, float64 &val) |
| std::string | getParameterString (uint32 cid, const char *name, uint32 maxSize) |
| std::string | getParameterString (uint32 cid, const char *name) |
| int64 | getParameterInt (uint32 cid, const char *name) |
| float64 | getParameterFloat (uint32 cid, const char *name) |
| bool | getParameterAsBool (uint32 cid, const char *name) |
| bool | setParameter (uint32 cid, const char *name, const char *val) |
| bool | setParameter (uint32 cid, const char *name, int64 val) |
| bool | setParameter (uint32 cid, const char *name, float64 val) |
| bool | resetParameter (uint32 cid, const char *name) |
| Restore the parameter's default value/index. | |
| bool | tweakParameter (uint32 cid, const char *name, int32 tweak) |
| Step the value by tweak * interval (or collection index). | |
| bool | getParameterInfo (uint32 cid, std::vector< ParamInfo > &out) |
| Every parameter of component cid, in creation order, with type, value, default, range, step and the collection entries. | |
| std::string | checkIntegrity () |
| Check the segment layout: every present component's record lies inside the used area, carries its own id, and the records follow each other in id order with no gap or overlap, ending exactly at usage. | |
Accessor for the shared component registry.
One instance per process (created by MemoryManager). The node master calls create(); other processes open(). Every method locks the segment's named cross-process mutex and re-attaches when the segment was resized elsewhere (serial check). String/char* out parameters are copied into caller buffers; returned containers (vectors/lists) are heap-allocated and owned by the caller. The master pointer is borrowed.
Definition at line 279 of file ComponentMemory.h.
| cmlabs::ComponentMemory::ComponentMemory | ( | MasterMemory * | master | ) |
| master | Segment bookkeeping interface (borrowed, not owned). |
Definition at line 14 of file ComponentMemory.cpp.
Referenced by UnitTest().
| cmlabs::ComponentMemory::~ComponentMemory | ( | ) |
Definition at line 23 of file ComponentMemory.cpp.
References cmlabs::utils::CloseSharedMemorySegment().
| bool cmlabs::ComponentMemory::addComponentStats | ( | uint32 | cid, |
| uint8 | status, | ||
| uint64 | usageCPUTicks, | ||
| DataMessage * | inputMsg, | ||
| DataMessage * | outputMsg, | ||
| uint32 | runCount, | ||
| uint32 | cycleCount ) |
Fold a run's activity into the component's stats (counters, rings, CPU ticks).
Caller keeps ownership of both messages.
Definition at line 626 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPSTATUS_STARTING, cmlabs::ComponentStats::currentRunStartTime, cmlabs::ComponentStats::cycleCount, cmlabs::DataMessage::data, DRAFTMSGSIZE, cmlabs::ComponentStats::firstRunStartTime, GETCOMPDATA, cmlabs::DataMessage::getSize(), cmlabs::GetTimeNow(), cmlabs::ComponentStats::msgInBytes, cmlabs::ComponentStats::msgInCount, cmlabs::ComponentStats::msgOutBytes, cmlabs::ComponentStats::msgOutCount, cmlabs::ComponentStats::recentInMsg, cmlabs::ComponentStats::recentInPos, cmlabs::ComponentStats::recentOutMsg, cmlabs::ComponentStats::recentOutPos, cmlabs::ComponentStats::runCount, cmlabs::DataMessageHeader::size, cmlabs::ComponentInfoStruct::stats, cmlabs::ComponentInfoStruct::status, cmlabs::ComponentStats::time, and cmlabs::ComponentStats::usageCPUTicks.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::addLocalPerformanceStats | ( | std::list< PerfStats > & | perfStats | ) |
Append PerfStats for all local components.
Definition at line 47 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ComponentStats::currentRunStartTime, cmlabs::ComponentStats::cycleCount, cmlabs::ComponentStats::firstRunStartTime, GETCOMPDATA, cmlabs::ComponentStats::migrationCount, cmlabs::ComponentStats::msgInBytes, cmlabs::ComponentStats::msgInCount, cmlabs::ComponentStats::msgOutBytes, cmlabs::ComponentStats::msgOutCount, cmlabs::ComponentInfoStruct::nodeID, cmlabs::ComponentInfoStruct::procID, cmlabs::ComponentStats::runCount, cmlabs::ComponentInfoStruct::size, cmlabs::ComponentInfoStruct::stats, cmlabs::ComponentInfoStruct::status, cmlabs::ComponentInfoStruct::type, and cmlabs::ComponentStats::usageCPUTicks.
| bool cmlabs::ComponentMemory::cancelComponentID | ( | uint32 | id | ) |
Release a provisionally reserved component id.
Definition at line 461 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ComponentInfoStruct::createdTime, GETCOMPDATA, cmlabs::ComponentInfoStruct::nodeID, cmlabs::ComponentInfoStruct::procID, cmlabs::ComponentInfoStruct::syncStatus, and cmlabs::ComponentInfoStruct::type.
| bool cmlabs::ComponentMemory::canComponentMigrate | ( | uint32 | cid | ) |
Definition at line 842 of file ComponentMemory.cpp.
References COMPONENT_CAN_MIGRATE, and getComponentPolicy().
| std::string cmlabs::ComponentMemory::checkIntegrity | ( | ) |
Check the segment layout: every present component's record lies inside the used area, carries its own id, and the records follow each other in id order with no gap or overlap, ending exactly at usage.
Definition at line 2639 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIALRETURN, COMPINFOUSAGE, GETCOMPDATA, GETCOMPOFFSET, cmlabs::ComponentInfoStruct::id, cmlabs::ComponentInfoStruct::size, and cmlabs::utils::StringFormat().
Referenced by cmlabs::ComponentMemoryLayoutUnitTest().
| bool cmlabs::ComponentMemory::confirmComponentID | ( | uint32 | id | ) |
Mark a provisionally reserved component id as ready (syncStatus 2).
Definition at line 440 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentInfoStruct::syncStatus, and cmlabs::ComponentInfoStruct::type.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), syncComponents(), and UnitTest().
| bool cmlabs::ComponentMemory::create | ( | uint32 | indexSize | ) |
Create the component segment (master only).
| indexSize | Component-id capacity. |
Definition at line 206 of file ComponentMemory.cpp.
References COMPONENTMEMORYID, cmlabs::utils::CreateSharedMemorySegment(), cmlabs::GetTimeNow(), and cmlabs::utils::StringFormat().
| bool cmlabs::ComponentMemory::createComponent | ( | uint32 | id, |
| uint8 | type, | ||
| uint8 | policy, | ||
| uint8 | selfTrigger, | ||
| const char * | name, | ||
| uint64 | size, | ||
| uint16 | nodeID, | ||
| uint16 | procID, | ||
| uint64 | time, | ||
| uint32 & | existingID ) |
Register a component record.
| id | Requested component id. |
| type | Component type. |
| policy | Migration policy. |
| selfTrigger | SELFTRIGGER_* policy. |
| name | Unique component name. |
| size | Initial record size in bytes. |
| nodeID | Node the component lives on. |
| procID | Process the component lives in. |
| time | Creation timestamp (µs). |
| existingID | Receives the id of a pre-existing component with the same name, if any. |
Definition at line 550 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ComponentInfoStruct::createdTime, GETCOMPDATA, getComponentID(), cmlabs::GetTimeNow(), LOG_MEMORY, LogPrint, MAXKEYNAMELEN, cmlabs::ComponentInfoStruct::name, cmlabs::ComponentInfoStruct::nodeID, cmlabs::ComponentInfoStruct::policy, cmlabs::ComponentInfoStruct::procID, cmlabs::ComponentInfoStruct::selfTrigger, cmlabs::ComponentInfoStruct::size, cmlabs::utils::strcpyavail(), stricmp, cmlabs::ComponentInfoStruct::syncStatus, and cmlabs::ComponentInfoStruct::type.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), syncComponents(), and UnitTest().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| const char * | val, | ||
| const char * | defaultValue = NULL ) |
Definition at line 1659 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, getParameter(), PARAM_STRING, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, cmlabs::utils::strcpyavail(), and cmlabs::ParamHeader::type.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), createParameter(), createParameter(), createParameter(), createParameter(), createParameter(), setParameter(), and UnitTest().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| const char * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 1711 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamCollectionHeader::count, cmlabs::ParamCollectionHeader::defaultIndex, GETCOMPDATA, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_STRING_COLL, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| float64 * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 1888 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamCollectionHeader::count, cmlabs::ParamCollectionHeader::defaultIndex, GETCOMPDATA, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT_COLL, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| float64 | val, | ||
| float64 | min = 0, | ||
| float64 | max = 0, | ||
| float64 | interval = 0 ) |
Definition at line 1983 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamFloatHeader::defaultVal, GETCOMPDATA, getParameter(), cmlabs::ParamFloatHeader::interval, cmlabs::ParamFloatHeader::maxVal, cmlabs::ParamFloatHeader::minVal, PARAM_FLOAT, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, cmlabs::ParamHeader::type, and cmlabs::ParamFloatHeader::val.
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| int64 * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 1841 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamCollectionHeader::count, cmlabs::ParamCollectionHeader::defaultIndex, GETCOMPDATA, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_INTEGER_COLL, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| int64 | val, | ||
| int64 | min = 0, | ||
| int64 | max = 0, | ||
| int64 | interval = 0 ) |
Definition at line 1935 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamIntegerHeader::defaultVal, GETCOMPDATA, getParameter(), cmlabs::ParamIntegerHeader::interval, cmlabs::ParamIntegerHeader::maxVal, cmlabs::ParamIntegerHeader::minVal, PARAM_INTEGER, cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, cmlabs::ParamHeader::type, and cmlabs::ParamIntegerHeader::val.
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| std::vector< float64 > | values, | ||
| float64 | defaultValue = 0 ) |
Definition at line 1827 of file ComponentMemory.cpp.
References createParameter().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| std::vector< int64 > | values, | ||
| int64 | defaultValue = 0 ) |
Definition at line 1799 of file ComponentMemory.cpp.
References createParameter().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| std::vector< std::string > | values, | ||
| const char * | defaultValue = NULL ) |
Definition at line 1767 of file ComponentMemory.cpp.
References createParameter().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| std::vector< std::string > | values, | ||
| float64 | defaultValue ) |
Definition at line 1813 of file ComponentMemory.cpp.
References cmlabs::utils::Ascii2Float64(), and createParameter().
| bool cmlabs::ComponentMemory::createParameter | ( | uint32 | cid, |
| const char * | name, | ||
| std::vector< std::string > | values, | ||
| int64 | defaultValue ) |
Definition at line 1785 of file ComponentMemory.cpp.
References cmlabs::utils::Ascii2Int64(), and createParameter().
| bool cmlabs::ComponentMemory::deleteParameter | ( | uint32 | cid, |
| const char * | name ) |
Remove the parameter.
Definition at line 2052 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPINFOUSAGE, GETCOMPDATA, getParameter(), cmlabs::ComponentInfoStruct::paramCount, cmlabs::ComponentInfoStruct::paramSize, and cmlabs::ParamHeader::size.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), setParameter(), and UnitTest().
| bool cmlabs::ComponentMemory::deletePrivateData | ( | uint32 | cid, |
| const char * | name ) |
Delete blob name.
Definition at line 1623 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPINFOUSAGE, cmlabs::ComponentInfoStruct::dataCount, cmlabs::ComponentInfoStruct::dataSize, GETCOMPDATA, getPrivateData(), and cmlabs::PrivateHeader::size.
Referenced by setPrivateData(), and UnitTest().
| bool cmlabs::ComponentMemory::destroyComponent | ( | uint32 | cid | ) |
Remove a component record and free its space.
Definition at line 692 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, GETCOMPOFFSETP, and cmlabs::ComponentInfoStruct::size.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), and UnitTest().
| std::list< uint16 > * cmlabs::ComponentMemory::findProcessComponents | ( | uint16 | procID | ) |
List ids of components in process procID.
Definition at line 824 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and GETCOMPDATA.
| std::vector< ComponentInfoStruct > * cmlabs::ComponentMemory::getAllCatalogs | ( | ) |
Snapshot all catalog components.
Definition at line 190 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMP_CATALOG, COMP_WHITEBOARD, and GETCOMPDATA.
| std::vector< ComponentInfoStruct > * cmlabs::ComponentMemory::getAllComponents | ( | ) |
Snapshot all components.
Definition at line 129 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and GETCOMPDATA.
Referenced by printFriendly(), toXML(), writeComponentNamesToMsg(), and writeComponentsToMsg().
| std::vector< ComponentInfoStruct > * cmlabs::ComponentMemory::getAllLocalComponents | ( | ) |
Snapshot components on this node.
Definition at line 144 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and GETCOMPDATA.
| std::vector< ComponentInfoStruct > * cmlabs::ComponentMemory::getAllLocalComponents | ( | uint8 | type | ) |
Snapshot local components of type.
Definition at line 159 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and GETCOMPDATA.
| std::vector< ComponentInfoStruct > * cmlabs::ComponentMemory::getAllModules | ( | ) |
Snapshot all module components.
Definition at line 174 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMP_EXTERNAL, COMP_INTERNAL, and GETCOMPDATA.
| char * cmlabs::ComponentMemory::getComponentData | ( | uint32 | cid, |
| uint64 & | size ) |
Copy a component's whole data area (for migration).
| cid | Component id. |
| size | Receives byte count. |
Definition at line 764 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::size.
| bool cmlabs::ComponentMemory::getComponentID | ( | const char * | name, |
| uint32 & | cid ) |
Look up a component id by name.
Definition at line 1240 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and stricmp.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), createComponent(), isComponentLocal(), and UnitTest().
| bool cmlabs::ComponentMemory::getComponentLocation | ( | uint32 | cid, |
| uint16 & | nodeID, | ||
| uint16 & | procID ) |
Get the node/process the component runs in.
Definition at line 978 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentInfoStruct::nodeID, and cmlabs::ComponentInfoStruct::procID.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::getComponentName | ( | uint32 | cid, |
| char * | name, | ||
| uint32 | maxNameLen ) |
Copy the component name into name.
Definition at line 1105 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentInfoStruct::name, and cmlabs::utils::strcpyavail().
Referenced by UnitTest().
| std::string cmlabs::ComponentMemory::getComponentNameString | ( | uint32 | cid | ) |
Definition at line 1083 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::name.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), and UnitTest().
| uint16 cmlabs::ComponentMemory::getComponentNodeID | ( | uint32 | cid | ) |
Definition at line 1003 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::nodeID.
Referenced by UnitTest().
| AveragePerfStats cmlabs::ComponentMemory::getComponentPerfStats | ( | uint32 | cid | ) |
Definition at line 1172 of file ComponentMemory.cpp.
References GETCOMPDATA, open(), and cmlabs::ComponentInfoStruct::perfStats.
| uint8 cmlabs::ComponentMemory::getComponentPolicy | ( | uint32 | cid | ) |
Definition at line 846 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::policy.
Referenced by canComponentMigrate().
| uint16 cmlabs::ComponentMemory::getComponentProcessID | ( | uint32 | cid | ) |
Definition at line 1025 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::procID.
Referenced by UnitTest().
| uint8 cmlabs::ComponentMemory::getComponentSelfTrigger | ( | uint32 | cid | ) |
Definition at line 935 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::selfTrigger.
Referenced by UnitTest().
| ComponentStats cmlabs::ComponentMemory::getComponentStats | ( | uint32 | cid | ) |
Definition at line 1148 of file ComponentMemory.cpp.
References GETCOMPDATA, open(), and cmlabs::ComponentInfoStruct::stats.
Referenced by UnitTest().
| uint8 cmlabs::ComponentMemory::getComponentType | ( | uint32 | cid | ) |
Definition at line 1126 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::type.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::getMemoryUsage | ( | uint64 & | alloc, |
| uint64 & | usage ) |
Report allocation/usage of the component segment.
Definition at line 35 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL.
| bool cmlabs::ComponentMemory::getParameter | ( | uint32 | cid, |
| const char * | name, | ||
| char * | val, | ||
| uint32 | maxSize ) |
Definition at line 2276 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_STRING, PARAM_STRING_COLL, cmlabs::utils::strcpyavail(), and cmlabs::ParamHeader::type.
Referenced by createParameter(), createParameter(), createParameter(), createParameter(), createParameter(), createParameter(), deleteParameter(), getParameter(), getParameter(), getParameter(), getParameterAsBool(), getParameterDataType(), getParameterFloat(), getParameterInt(), getParameterString(), getParameterString(), getParameterValueSize(), hasParameter(), resetParameter(), setParameter(), setParameter(), setParameter(), tweakParameter(), and UnitTest().
| bool cmlabs::ComponentMemory::getParameter | ( | uint32 | cid, |
| const char * | name, | ||
| float64 & | val ) |
Definition at line 2358 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT, PARAM_FLOAT_COLL, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::getParameter | ( | uint32 | cid, |
| const char * | name, | ||
| int64 & | val ) |
Definition at line 2322 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_INTEGER, PARAM_INTEGER_COLL, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::getParameterAsBool | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2200 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, stricmp, and cmlabs::ParamHeader::type.
| uint8 cmlabs::ComponentMemory::getParameterDataType | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2081 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), and cmlabs::ParamHeader::type.
| float64 cmlabs::ComponentMemory::getParameterFloat | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2193 of file ComponentMemory.cpp.
References getParameter().
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::getParameterInfo | ( | uint32 | cid, |
| std::vector< ParamInfo > & | out ) |
Every parameter of component cid, in creation order, with type, value, default, range, step and the collection entries.
Definition at line 2684 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ParamCollectionHeader::count, cmlabs::ParamCollectionHeader::defaultIndex, cmlabs::ParamInfo::defaultIndex, cmlabs::ParamFloatHeader::defaultVal, cmlabs::ParamIntegerHeader::defaultVal, cmlabs::ParamInfo::defaultValue, GETCOMPDATA, cmlabs::ParamCollectionHeader::index, cmlabs::ParamInfo::index, cmlabs::ParamFloatHeader::interval, cmlabs::ParamIntegerHeader::interval, cmlabs::ParamFloatHeader::maxVal, cmlabs::ParamInfo::maxVal, cmlabs::ParamIntegerHeader::maxVal, cmlabs::ParamFloatHeader::minVal, cmlabs::ParamInfo::minVal, cmlabs::ParamIntegerHeader::minVal, cmlabs::ParamInfo::name, cmlabs::ParamInfo::options, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, PARAM_TYPE_COLL, cmlabs::ParamFloatText(), cmlabs::ComponentInfoStruct::paramSize, cmlabs::ParamHeader::size, cmlabs::ParamInfo::step, cmlabs::utils::StringFormat(), cmlabs::ParamHeader::type, cmlabs::ParamInfo::type, cmlabs::ParamFloatHeader::val, cmlabs::ParamIntegerHeader::val, and cmlabs::ParamInfo::value.
Referenced by UnitTest().
| int64 cmlabs::ComponentMemory::getParameterInt | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2186 of file ComponentMemory.cpp.
References getParameter().
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), and UnitTest().
| std::string cmlabs::ComponentMemory::getParameterString | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2147 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_STRING, PARAM_STRING_COLL, and cmlabs::ParamHeader::type.
| std::string cmlabs::ComponentMemory::getParameterString | ( | uint32 | cid, |
| const char * | name, | ||
| uint32 | maxSize ) |
Definition at line 2138 of file ComponentMemory.cpp.
References getParameter().
Referenced by UnitTest().
| uint32 cmlabs::ComponentMemory::getParameterValueSize | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2102 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, and cmlabs::ParamHeader::type.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::getPrivateData | ( | uint32 | cid, |
| const char * | name, | ||
| char * | data, | ||
| uint64 | maxSize ) |
Copy blob into caller buffer data (max maxSize).
Definition at line 1494 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getPrivateData(), and cmlabs::PrivateHeader::size.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), deletePrivateData(), getPrivateData(), getPrivateDataCopy(), getPrivateDataMimetype(), getPrivateDataSize(), setPrivateData(), and UnitTest().
| char * cmlabs::ComponentMemory::getPrivateDataCopy | ( | uint32 | cid, |
| const char * | name, | ||
| uint64 & | size ) |
Definition at line 1463 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getPrivateData(), and cmlabs::PrivateHeader::size.
| std::list< std::string > cmlabs::ComponentMemory::getPrivateDataKeys | ( | uint32 | cid | ) |
Definition at line 1586 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIALRETURN, cmlabs::ComponentInfoStruct::dataSize, GETCOMPDATA, and cmlabs::ComponentInfoStruct::paramSize.
| std::map< std::string, std::string > cmlabs::ComponentMemory::getPrivateDataKeysAndTypes | ( | uint32 | cid | ) |
Definition at line 1547 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIALRETURN, cmlabs::ComponentInfoStruct::dataSize, GETCOMPDATA, and cmlabs::ComponentInfoStruct::paramSize.
| std::string cmlabs::ComponentMemory::getPrivateDataMimetype | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 1524 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and getPrivateData().
| uint64 cmlabs::ComponentMemory::getPrivateDataSize | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 1439 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getPrivateData(), and cmlabs::PrivateHeader::size.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::hasParameter | ( | uint32 | cid, |
| const char * | name ) |
Definition at line 2031 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, and getParameter().
| bool cmlabs::ComponentMemory::isComponentLocal | ( | const char * | name | ) |
Definition at line 1075 of file ComponentMemory.cpp.
References getComponentID(), and isComponentLocal().
| bool cmlabs::ComponentMemory::isComponentLocal | ( | uint32 | cid | ) |
Definition at line 1048 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::nodeID.
Referenced by isComponentLocal().
| bool cmlabs::ComponentMemory::isComponentPaused | ( | uint32 | cid | ) |
Set the migration policy.
Definition at line 904 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPONENT_PAUSED, and GETCOMPDATA.
| uint8 cmlabs::ComponentMemory::lookupComponentID | ( | const char * | name, |
| uint32 & | id ) |
Look up a component by name without filtering on readiness.
| name | Component name to look up. |
| id | Receives the component id when found. |
Definition at line 1260 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentInfoStruct::name, stricmp, and cmlabs::ComponentInfoStruct::syncStatus.
| bool cmlabs::ComponentMemory::open | ( | ) |
Attach to the existing component segment.
Definition at line 240 of file ComponentMemory.cpp.
References cmlabs::ComponentMemoryStruct::cid, cmlabs::utils::CloseSharedMemorySegment(), COMPONENTMEMORYID, cmlabs::utils::OpenSharedMemorySegment(), and cmlabs::utils::StringFormat().
Referenced by getComponentPerfStats(), and getComponentStats().
|
static |
Definition at line 2665 of file ComponentMemory.cpp.
References PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, and PARAM_TYPE_COLL.
| std::string cmlabs::ComponentMemory::printFriendly | ( | ) |
Definition at line 83 of file ComponentMemory.cpp.
References getAllComponents(), and cmlabs::utils::StringFormat().
| bool cmlabs::ComponentMemory::resetParameter | ( | uint32 | cid, |
| const char * | name ) |
Restore the parameter's default value/index.
Definition at line 2576 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, PARAM_TYPE_COLL, setParameter(), and cmlabs::ParamHeader::type.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::setComponentData | ( | uint32 | cid, |
| const char * | data, | ||
| uint64 | size, | ||
| bool | wasMigrated ) |
Replace a component's data area (after migration).
| cid | Component id. |
| data | New data area. |
| size | Byte count. |
| wasMigrated | Marks a migration event. |
Definition at line 788 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentStats::migrationCount, cmlabs::ComponentInfoStruct::size, and cmlabs::ComponentInfoStruct::stats.
| bool cmlabs::ComponentMemory::setComponentPaused | ( | uint32 | cid, |
| bool | paused ) |
Set or clear COMPONENT_PAUSED (stop / start).
Definition at line 894 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPONENT_PAUSED, and GETCOMPDATA.
| bool cmlabs::ComponentMemory::setComponentPerfStats | ( | uint32 | cid, |
| AveragePerfStats & | perfStruct ) |
Store new performance averages.
Definition at line 1196 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::perfStats.
| bool cmlabs::ComponentMemory::setComponentPolicy | ( | uint32 | cid, |
| uint8 | policy ) |
Definition at line 914 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::policy.
| bool cmlabs::ComponentMemory::setComponentSelfTrigger | ( | uint32 | cid, |
| uint8 | selfTrigger ) |
Set the self-trigger policy.
Definition at line 956 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::selfTrigger.
| bool cmlabs::ComponentMemory::setComponentStats | ( | uint32 | cid, |
| ComponentStats & | stats ) |
Overwrite the component's stats.
Definition at line 1218 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, and cmlabs::ComponentInfoStruct::stats.
| bool cmlabs::ComponentMemory::setParameter | ( | uint32 | cid, |
| const char * | name, | ||
| const char * | val ) |
Definition at line 2395 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, createParameter(), deleteParameter(), getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, setParameter(), cmlabs::utils::strcpyavail(), stricmp, and cmlabs::ParamHeader::type.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), resetParameter(), setParameter(), and UnitTest().
| bool cmlabs::ComponentMemory::setParameter | ( | uint32 | cid, |
| const char * | name, | ||
| float64 | val ) |
Definition at line 2528 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_FLOAT, PARAM_FLOAT_COLL, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::setParameter | ( | uint32 | cid, |
| const char * | name, | ||
| int64 | val ) |
Definition at line 2481 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, PARAM_INTEGER, PARAM_INTEGER_COLL, and cmlabs::ParamHeader::type.
| bool cmlabs::ComponentMemory::setPrivateData | ( | uint32 | cid, |
| const char * | name, | ||
| const char * | data, | ||
| uint64 | size, | ||
| const char * | mimetype = NULL ) |
Create/replace blob name.
Data is copied.
Definition at line 1356 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, cmlabs::ComponentInfoStruct::dataCount, cmlabs::ComponentInfoStruct::dataSize, deletePrivateData(), GETCOMPDATA, getPrivateData(), cmlabs::PrivateHeader::size, and stricmp.
Referenced by cmlabs::ComponentMemoryLayoutUnitTest(), and UnitTest().
| bool cmlabs::ComponentMemory::syncComponents | ( | DataMessage * | msg | ) |
Merge component records received from a remote node.
Definition at line 524 of file ComponentMemory.cpp.
References confirmComponentID(), createComponent(), cmlabs::DataMessage::getInt(), cmlabs::DataMessage::getString(), and cmlabs::DataMessage::getTime().
| std::string cmlabs::ComponentMemory::toXML | ( | bool | stats = true | ) |
Definition at line 107 of file ComponentMemory.cpp.
References getAllComponents(), and cmlabs::utils::StringFormat().
| bool cmlabs::ComponentMemory::tweakParameter | ( | uint32 | cid, |
| const char * | name, | ||
| int32 | tweak ) |
Step the value by tweak * interval (or collection index).
Definition at line 2769 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, getParameter(), cmlabs::ParamCollectionHeader::index, cmlabs::ParamFloatHeader::interval, cmlabs::ParamIntegerHeader::interval, cmlabs::ParamFloatHeader::maxVal, cmlabs::ParamIntegerHeader::maxVal, cmlabs::ParamFloatHeader::minVal, cmlabs::ParamIntegerHeader::minVal, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING_COLL, cmlabs::ParamHeader::type, cmlabs::ParamFloatHeader::val, and cmlabs::ParamIntegerHeader::val.
Referenced by UnitTest().
|
static |
Self-test.
Definition at line 2920 of file ComponentMemory.cpp.
References addComponentStats(), COMP_INTERNAL, COMPONENT_CAN_MIGRATE, ComponentMemory(), cmlabs::MemoryManager::componentMemory, COMPSTATUS_RUNNING, confirmComponentID(), cmlabs::DataMapsMemory::confirmTagID(), cmlabs::DataMapsMemory::confirmTypeLevelID(), cmlabs::MemoryManager::create(), createComponent(), cmlabs::DataMapsMemory::createNewTag(), cmlabs::DataMapsMemory::createNewTypeLevel(), createParameter(), cmlabs::ComponentStats::cycleCount, cmlabs::MemoryManager::dataMapsMemory, deleteParameter(), deletePrivateData(), destroyComponent(), cmlabs::unittest::detail(), DRAFTMSGSIZE, cmlabs::unittest::fail(), getComponentID(), getComponentLocation(), getComponentName(), getComponentNameString(), getComponentNodeID(), getComponentProcessID(), getComponentSelfTrigger(), getComponentStats(), getComponentType(), cmlabs::DataMessage::getInt(), getParameter(), getParameterFloat(), getParameterInfo(), getParameterInt(), getParameterString(), getParameterValueSize(), getPrivateData(), getPrivateDataSize(), cmlabs::DataMessage::getSize(), cmlabs::DataMapsMemory::getTagID(), cmlabs::DataMapsMemory::getTagName(), cmlabs::DataMapsMemory::getTypeLevelID(), cmlabs::DataMapsMemory::getTypeLevelName(), cmlabs::ComponentStats::msgInBytes, cmlabs::ComponentStats::msgInCount, cmlabs::ComponentStats::msgOutBytes, cmlabs::ComponentStats::msgOutCount, PARAM_FLOAT, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING_COLL, cmlabs::unittest::progress(), cmlabs::ComponentStats::recentInMsg, resetParameter(), cmlabs::ComponentStats::runCount, SELFTRIGGER_ALLOW, SELFTRIGGER_WARN, cmlabs::DataMessage::setInt(), setParameter(), setPrivateData(), cmlabs::DataMessage::setString(), cmlabs::utils::strcpyavail(), tweakParameter(), updateComponentLocation(), and cmlabs::ComponentStats::usageCPUTicks.
Referenced by cmlabs::Register_ComponentMemory_Tests().
| bool cmlabs::ComponentMemory::updateComponentInformation | ( | uint32 | cid, |
| uint8 | type, | ||
| uint8 | policy, | ||
| uint8 | selfTrigger, | ||
| uint16 | nodeID, | ||
| uint16 | procID ) |
Update type/policy/self-trigger/location in one call.
Definition at line 867 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, COMPONENT_PAUSED, GETCOMPDATA, cmlabs::ComponentInfoStruct::nodeID, cmlabs::ComponentInfoStruct::policy, cmlabs::ComponentInfoStruct::procID, cmlabs::ComponentInfoStruct::selfTrigger, cmlabs::ComponentInfoStruct::syncStatus, and cmlabs::ComponentInfoStruct::type.
| bool cmlabs::ComponentMemory::updateComponentLocation | ( | uint32 | cid, |
| uint16 | nodeID, | ||
| uint16 | procID ) |
Record a new location (after migration).
Definition at line 742 of file ComponentMemory.cpp.
References CHECKCOMPONENTMEMORYSERIAL, GETCOMPDATA, cmlabs::ComponentInfoStruct::nodeID, and cmlabs::ComponentInfoStruct::procID.
Referenced by UnitTest().
| bool cmlabs::ComponentMemory::writeComponentNamesToMsg | ( | DataMessage * | msg | ) |
Write just the component names into msg.
Definition at line 483 of file ComponentMemory.cpp.
References getAllComponents(), and cmlabs::DataMessage::setString().
| bool cmlabs::ComponentMemory::writeComponentsToMsg | ( | DataMessage * | msg | ) |
Serialize all component records into msg.
Definition at line 501 of file ComponentMemory.cpp.
References getAllComponents().