|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Legacy accessor wrapping one component record inside a shared page. More...
#include <ComponentData.h>
Public Member Functions | |
| ComponentData (char *data) | |
| Wrap an existing raw component record. | |
| ~ComponentData () | |
| bool | disconnect () |
| bool | destroyComponent () |
| bool | resize (uint32 increase) |
| uint32 | getAvailableDataSize () |
| bool | setPrivateData (const char *name, const char *data, uint32 size) |
| uint32 | getPrivateDataSize (const char *name) |
| bool | getPrivateDataCopy (const char *name, char *data, uint32 maxSize) |
| bool | replacePrivateData (const char *name, const char *data, uint32 size) |
| bool | replacePrivateData (const char *name, const char *data, uint32 size, uint32 offset) |
| bool | deletePrivateData (const char *name) |
| bool | createParameter (const char *name, const char *val, const char *defaultValue=NULL) |
| bool | createParameter (const char *name, const char *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (const char *name, std::vector< std::string > values, const char *defaultValue=NULL) |
| bool | createParameter (const char *name, int64 *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (const char *name, std::vector< std::string > values, int64 defaultValue=0) |
| bool | createParameter (const char *name, float64 *val, uint32 count, uint32 defaultIndex) |
| bool | createParameter (const char *name, std::vector< std::string > values, float64 defaultValue=0) |
| bool | createParameter (const char *name, int64 val, int64 min=0, int64 max=0, int64 interval=0) |
| bool | createParameter (const char *name, float64 val, float64 min=0, float64 max=0, float64 interval=0) |
| bool | hasParameter (const char *name) |
| bool | deleteParameter (const char *name) |
| uint8 | getParameterDataType (const char *name) |
| uint32 | getParameterValueSize (const char *name) |
| bool | getParameter (const char *name, char *val, uint32 maxSize) |
| bool | getParameter (const char *name, int64 &val) |
| bool | getParameter (const char *name, float64 &val) |
| bool | setParameter (const char *name, const char *val) |
| bool | setParameter (const char *name, int64 val) |
| bool | setParameter (const char *name, float64 val) |
| bool | resetParameter (const char *name) |
| bool | tweakParameter (const char *name, int32 tweak) |
Static Public Member Functions | |
| static bool | UnitTest () |
| Self-test. | |
| static ComponentData * | CreateComponent (uint32 id, const char *name, uint32 size, uint16 nodeID, uint16 procID) |
| static bool | RecordRemoteComponent (uint32 id, const char *name, uint16 nodeID, uint64 time) |
| static bool | ReserveComponentID (uint32 id, const char *name) |
| static bool | DestroyComponent (uint32 cid) |
| static ComponentData * | GetComponentData (uint32 cid) |
| static bool | GetComponentName (uint32 cid, char *name, uint32 maxNameLen) |
| static bool | GetComponentID (const char *name, uint32 &cid) |
| static ComponentStats | GetComponentStats (uint32 cid) |
| static bool | SetComponentStats (uint32 cid, ComponentStats &stats) |
| static bool | IsComponentLocal (uint32 cid) |
| static bool | IsComponentLocal (const char *name) |
| static uint16 | GetComponentNodeID (uint32 cid) |
| static uint16 | GetComponentProcessID (uint32 cid) |
| static char * | GetAndRemoveComponent (uint32 cid, uint32 &dataSize) |
| static bool | AddExistingComponent (uint32 cid, uint16 nodeID, uint16 procID, char *oldData, uint32 dataSize) |
| static bool | UpdateRemoteComponent (uint32 cid, uint16 nodeID, uint16 procID, const char *name) |
| static bool | AddComponentStats (uint32 cid, uint64 userCPU, uint64 kernelCPU, DataMessage *inputMsg, DataMessage *outputMsg, uint32 runCount) |
Legacy accessor wrapping one component record inside a shared page.
Static functions operate on the shared component map / page allocator; instance methods operate on the record wrapped at construction. Pointers returned by the static Get* functions point into shared memory and follow the legacy locking rules of MemoryManagerX. Superseded by ComponentMemory.
Definition at line 137 of file ComponentData.h.
| cmlabs::ComponentData::ComponentData | ( | char * | data | ) |
Wrap an existing raw component record.
| data | Mapped record address (not owned). |
Definition at line 478 of file ComponentData.cpp.
Referenced by CreateComponent(), DestroyComponent(), GetComponentData(), RecordRemoteComponent(), ReserveComponentID(), and UnitTest().
| cmlabs::ComponentData::~ComponentData | ( | ) |
Definition at line 482 of file ComponentData.cpp.
References disconnect().
|
static |
Definition at line 176 of file ComponentData.cpp.
References cmlabs::DataMessage::data, cmlabs::DataMessage::getSize(), cmlabs::GetTimeNow(), cmlabs::COMPONENTDATAHEADER::stats, and cmlabs::ComponentStats::time.
|
static |
Definition at line 144 of file ComponentData.cpp.
|
static |
Definition at line 13 of file ComponentData.cpp.
References cmlabs::COMPONENTDATAHEADER::cid, ComponentData(), GetComponentData(), cmlabs::GetTimeNow(), MAXKEYNAMELEN, cmlabs::COMPONENTDATAHEADER::name, cmlabs::COMPONENTDATAHEADER::nodeID, cmlabs::COMPONENTDATAHEADER::procID, and cmlabs::utils::strcpyavail().
Referenced by UnitTest().
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| const char * | val, | ||
| const char * | defaultValue = NULL ) |
Definition at line 688 of file ComponentData.cpp.
References PARAM_STRING, cmlabs::PARAMHEADER::size, and cmlabs::PARAMHEADER::type.
Referenced by createParameter(), createParameter(), createParameter(), setParameter(), and UnitTest().
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| const char * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 733 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::count, cmlabs::PARAMCOLLHEADER::defaultIndex, cmlabs::PARAMCOLLHEADER::index, PARAM_STRING_COLL, cmlabs::PARAMHEADER::size, and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| float64 * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 864 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::count, cmlabs::PARAMCOLLHEADER::defaultIndex, cmlabs::PARAMCOLLHEADER::index, PARAM_FLOAT_COLL, cmlabs::PARAMHEADER::size, and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| float64 | val, | ||
| float64 | min = 0, | ||
| float64 | max = 0, | ||
| float64 | interval = 0 ) |
Definition at line 941 of file ComponentData.cpp.
References cmlabs::PARAMFLOATHEADER::defaultVal, cmlabs::PARAMFLOATHEADER::interval, cmlabs::PARAMFLOATHEADER::maxVal, cmlabs::PARAMFLOATHEADER::minVal, PARAM_FLOAT, cmlabs::PARAMHEADER::size, cmlabs::PARAMHEADER::type, and cmlabs::PARAMFLOATHEADER::val.
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| int64 * | val, | ||
| uint32 | count, | ||
| uint32 | defaultIndex ) |
Definition at line 826 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::count, cmlabs::PARAMCOLLHEADER::defaultIndex, cmlabs::PARAMCOLLHEADER::index, PARAM_INTEGER_COLL, cmlabs::PARAMHEADER::size, and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| int64 | val, | ||
| int64 | min = 0, | ||
| int64 | max = 0, | ||
| int64 | interval = 0 ) |
Definition at line 902 of file ComponentData.cpp.
References cmlabs::PARAMINTEGERHEADER::defaultVal, cmlabs::PARAMINTEGERHEADER::interval, cmlabs::PARAMINTEGERHEADER::maxVal, cmlabs::PARAMINTEGERHEADER::minVal, PARAM_INTEGER, cmlabs::PARAMHEADER::size, cmlabs::PARAMHEADER::type, and cmlabs::PARAMINTEGERHEADER::val.
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| std::vector< std::string > | values, | ||
| const char * | defaultValue = NULL ) |
Definition at line 780 of file ComponentData.cpp.
References createParameter().
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| std::vector< std::string > | values, | ||
| float64 | defaultValue = 0 ) |
Definition at line 812 of file ComponentData.cpp.
References cmlabs::utils::Ascii2Float64(), and createParameter().
| bool cmlabs::ComponentData::createParameter | ( | const char * | name, |
| std::vector< std::string > | values, | ||
| int64 | defaultValue = 0 ) |
Definition at line 798 of file ComponentData.cpp.
References cmlabs::utils::Ascii2Int64(), and createParameter().
| bool cmlabs::ComponentData::deleteParameter | ( | const char * | name | ) |
Definition at line 992 of file ComponentData.cpp.
Referenced by setParameter(), and UnitTest().
| bool cmlabs::ComponentData::deletePrivateData | ( | const char * | name | ) |
Definition at line 656 of file ComponentData.cpp.
Referenced by replacePrivateData(), and UnitTest().
|
static |
Definition at line 209 of file ComponentData.cpp.
References ComponentData(), destroyComponent(), and GetComponentData().
| bool cmlabs::ComponentData::destroyComponent | ( | ) |
Definition at line 523 of file ComponentData.cpp.
Referenced by DestroyComponent(), and UnitTest().
| bool cmlabs::ComponentData::disconnect | ( | ) |
Definition at line 486 of file ComponentData.cpp.
Referenced by ~ComponentData().
|
static |
Definition at line 125 of file ComponentData.cpp.
| uint32 cmlabs::ComponentData::getAvailableDataSize | ( | ) |
Definition at line 494 of file ComponentData.cpp.
Referenced by UnitTest().
|
static |
Definition at line 225 of file ComponentData.cpp.
References ComponentData().
Referenced by CreateComponent(), DestroyComponent(), RecordRemoteComponent(), and ReserveComponentID().
|
static |
Definition at line 444 of file ComponentData.cpp.
References cmlabs::ComponentMapEntry::id, ID_COMPMAPPAGE, and cmlabs::ComponentMapEntry::name.
Referenced by UnitTest().
|
static |
Definition at line 391 of file ComponentData.cpp.
References cmlabs::ComponentMapEntry::id, cmlabs::ComponentMapEntry::name, and cmlabs::ComponentMapEntry::time.
Referenced by UnitTest().
|
static |
Definition at line 348 of file ComponentData.cpp.
References cmlabs::ComponentMapEntry::id, cmlabs::ComponentMapEntry::nodeID, and cmlabs::ComponentMapEntry::time.
|
static |
Definition at line 362 of file ComponentData.cpp.
References cmlabs::ComponentMapEntry::id, cmlabs::ComponentMapEntry::pageID, cmlabs::ComponentMapEntry::procID, and cmlabs::ComponentMapEntry::time.
|
static |
Definition at line 410 of file ComponentData.cpp.
| bool cmlabs::ComponentData::getParameter | ( | const char * | name, |
| char * | val, | ||
| uint32 | maxSize ) |
Definition at line 1057 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_STRING, PARAM_STRING_COLL, and cmlabs::PARAMHEADER::type.
Referenced by UnitTest().
| bool cmlabs::ComponentData::getParameter | ( | const char * | name, |
| float64 & | val ) |
Definition at line 1117 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_FLOAT, PARAM_FLOAT_COLL, and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::getParameter | ( | const char * | name, |
| int64 & | val ) |
Definition at line 1090 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_INTEGER, PARAM_INTEGER_COLL, and cmlabs::PARAMHEADER::type.
| uint8 cmlabs::ComponentData::getParameterDataType | ( | const char * | name | ) |
Definition at line 1015 of file ComponentData.cpp.
References cmlabs::PARAMHEADER::type.
| uint32 cmlabs::ComponentData::getParameterValueSize | ( | const char * | name | ) |
Definition at line 1029 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, and cmlabs::PARAMHEADER::type.
Referenced by UnitTest().
| bool cmlabs::ComponentData::getPrivateDataCopy | ( | const char * | name, |
| char * | data, | ||
| uint32 | maxSize ) |
Definition at line 607 of file ComponentData.cpp.
Referenced by UnitTest().
| uint32 cmlabs::ComponentData::getPrivateDataSize | ( | const char * | name | ) |
Definition at line 594 of file ComponentData.cpp.
Referenced by UnitTest().
| bool cmlabs::ComponentData::hasParameter | ( | const char * | name | ) |
Definition at line 980 of file ComponentData.cpp.
|
static |
|
static |
Definition at line 377 of file ComponentData.cpp.
References cmlabs::ComponentMapEntry::id, cmlabs::ComponentMapEntry::procID, and cmlabs::ComponentMapEntry::time.
|
static |
Definition at line 54 of file ComponentData.cpp.
References cmlabs::COMPONENTDATAHEADER::cid, ComponentData(), GetComponentData(), MAXKEYNAMELEN, cmlabs::COMPONENTDATAHEADER::name, cmlabs::COMPONENTDATAHEADER::nodeID, and cmlabs::utils::strcpyavail().
| bool cmlabs::ComponentData::replacePrivateData | ( | const char * | name, |
| const char * | data, | ||
| uint32 | size ) |
Definition at line 627 of file ComponentData.cpp.
References replacePrivateData().
Referenced by replacePrivateData(), and setPrivateData().
| bool cmlabs::ComponentData::replacePrivateData | ( | const char * | name, |
| const char * | data, | ||
| uint32 | size, | ||
| uint32 | offset ) |
Definition at line 641 of file ComponentData.cpp.
References deletePrivateData(), and setPrivateData().
|
static |
Definition at line 95 of file ComponentData.cpp.
References cmlabs::COMPONENTDATAHEADER::cid, ComponentData(), GetComponentData(), MAXKEYNAMELEN, and cmlabs::utils::strcpyavail().
| bool cmlabs::ComponentData::resetParameter | ( | const char * | name | ) |
Definition at line 1279 of file ComponentData.cpp.
References PARAM_FLOAT, PARAM_FLOAT_COLL, PARAM_INTEGER, PARAM_INTEGER_COLL, PARAM_STRING, PARAM_STRING_COLL, setParameter(), and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::resize | ( | uint32 | increase | ) |
Definition at line 498 of file ComponentData.cpp.
References cmlabs::COMPONENTDATAHEADER::pageID, and cmlabs::COMPONENTDATAHEADER::size.
Referenced by UnitTest().
|
static |
Definition at line 427 of file ComponentData.cpp.
| bool cmlabs::ComponentData::setParameter | ( | const char * | name, |
| const char * | val ) |
Definition at line 1145 of file ComponentData.cpp.
References createParameter(), deleteParameter(), cmlabs::PARAMCOLLHEADER::index, PARAM_STRING, PARAM_STRING_COLL, and cmlabs::PARAMHEADER::type.
Referenced by resetParameter().
| bool cmlabs::ComponentData::setParameter | ( | const char * | name, |
| float64 | val ) |
Definition at line 1240 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_FLOAT, PARAM_INTEGER_COLL, cmlabs::PARAMHEADER::type, and cmlabs::PARAMFLOATHEADER::val.
| bool cmlabs::ComponentData::setParameter | ( | const char * | name, |
| int64 | val ) |
Definition at line 1203 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, PARAM_INTEGER, PARAM_INTEGER_COLL, and cmlabs::PARAMHEADER::type.
| bool cmlabs::ComponentData::setPrivateData | ( | const char * | name, |
| const char * | data, | ||
| uint32 | size ) |
Definition at line 564 of file ComponentData.cpp.
References replacePrivateData().
Referenced by replacePrivateData(), and UnitTest().
| bool cmlabs::ComponentData::tweakParameter | ( | const char * | name, |
| int32 | tweak ) |
Definition at line 1320 of file ComponentData.cpp.
References cmlabs::PARAMCOLLHEADER::index, cmlabs::PARAMFLOATHEADER::interval, cmlabs::PARAMINTEGERHEADER::interval, 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 1415 of file ComponentData.cpp.
References ComponentData(), cmlabs::MemoryManager::create(), CreateComponent(), cmlabs::MemoryMaps::CreateNewTypeLevel(), createParameter(), deleteParameter(), deletePrivateData(), destroyComponent(), cmlabs::unittest::fail(), getAvailableDataSize(), GetComponentID(), GetComponentName(), getParameter(), getParameterValueSize(), getPrivateDataCopy(), getPrivateDataSize(), cmlabs::MemoryMaps::GetTypeLevelID(), cmlabs::MemoryMaps::GetTypeLevelName(), cmlabs::unittest::progress(), resize(), setPrivateData(), and tweakParameter().
Referenced by cmlabs::Register_ComponentData_Tests().
|
static |
Definition at line 169 of file ComponentData.cpp.