|
|
A memory ID. More...
#include <RobotAPI/libraries/armem/core/MemoryID.h>
Public Member Functions | |
| MemoryID | cleanID () const |
| void | clearInstanceIndex () |
| void | clearTimestamp () |
| std::vector< std::string > | getAllItems (bool escapeDelimiters=false) const |
| Get all levels as strings. More... | |
| MemoryID | getCoreSegmentID () const |
| MemoryID | getEntityID () const |
| MemoryID | getEntityInstanceID () const |
| MemoryID | getEntitySnapshotID () const |
| std::vector< std::string > | getItems (bool escapeDelimiters=false) const |
| Get the levels from root to first not defined level (excluding). More... | |
| std::string | getLeafItem () const |
| Get the lowest defined level (or empty string if there is none). More... | |
| MemoryID | getMemoryID () const |
| MemoryID | getProviderSegmentID () const |
| bool | hasCoreSegmentName () const |
| bool | hasEntityName () const |
| bool | hasGap () const |
| Indicate whether this ID has a gap such as in 'Memory//MyProvider' (no core segment name). More... | |
| bool | hasInstanceIndex () const |
| bool | hasMemoryName () const |
| bool | hasProviderSegmentName () const |
| bool | hasTimestamp () const |
| std::string | instanceIndexStr () const |
| Get the instance index as string. More... | |
| bool | isWellDefined () const |
| Indicate whether this ID is well-defined. More... | |
| MemoryID () | |
| Construct a default (empty) memory ID. More... | |
| MemoryID (const std::string &memoryName, const std::string &coreSegmentName, const std::string &providerSegmentName="", const std::string &entityName="", Time timestamp=Time::Invalid(), int instanceIndex=-1) | |
| MemoryID (const std::string &string) | |
(Re-)Construct a memory ID from a string representation as returned by str(). More... | |
| bool | operator!= (const MemoryID &other) const |
| bool | operator< (const MemoryID &rhs) const |
| bool | operator<= (const MemoryID &rhs) const |
| bool | operator== (const MemoryID &other) const |
| bool | operator> (const MemoryID &rhs) const |
| bool | operator>= (const MemoryID &rhs) const |
| MemoryID | removeLeafItem () const |
| void | setCoreSegmentID (const MemoryID &id) |
| void | setEntityID (const MemoryID &id) |
| void | setEntityInstanceID (const MemoryID &id) |
| void | setEntitySnapshotID (const MemoryID &id) |
| void | setMemoryID (const MemoryID &id) |
| void | setProviderSegmentID (const MemoryID &id) |
| std::string | str (bool escapeDelimiters=true) const |
| Get a string representation of this memory ID. More... | |
| std::string | timestampStr () const |
| Get the timestamp as string. More... | |
| MemoryID | withCoreSegmentName (const std::string &name) const |
| MemoryID | withEntityName (const std::string &name) const |
| MemoryID | withInstanceIndex (int index) const |
| MemoryID | withMemoryName (const std::string &name) const |
| MemoryID | withProviderSegmentName (const std::string &name) const |
| MemoryID | withTimestamp (Time time) const |
Static Public Member Functions | |
| static MemoryID | fromItems (const std::vector< std::string > &items) |
| Constructor memory ID from items as returned by getItems(). More... | |
| static MemoryID | fromString (const std::string &string) |
| Alias for constructor from string. More... | |
| static int | instanceIndexFromStr (const std::string &index) |
Reconstruct an instance index from a string as returned by instanceIndexStr(). More... | |
| static Time | timestampFromStr (const std::string ×tamp) |
Reconstruct a timestamp from a string as returned by timestampStr(). More... | |
Public Attributes | |
| std::string | coreSegmentName = "" |
| std::string | entityName = "" |
| int | instanceIndex = -1 |
| std::string | memoryName = "" |
| std::string | providerSegmentName = "" |
| Time | timestamp = Time::Invalid() |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const MemoryID id) |
A memory ID.
A memory ID is an index into the hierarchical memory structure. It specifies the keys for the different levels, starting from the memory name and ending at the instance index.
A memory ID need not be complete, e.g. it may specify only the memory and core segment names (thus representing a core segment ID). A memory ID that fully identifies a level starting from the memory is called well-defined.
isWellDefined()Memory IDs can be encoded in strings using a delimiter:
str()If a name contains a "/", it will be escaped:
Memory IDs may be not well-defined. This can occur e.g. when preparing an entity instance ID which is still pending the timestamp. It could look like (note the missing timestamp):
These IDs are still valid and can be handled (encoded as string etc.). However, some operations may not be well-defined for non-well-defined IDs (such as contains()).
Definition at line 47 of file MemoryID.h.
| MemoryID | ( | ) |
Construct a default (empty) memory ID.
Definition at line 20 of file MemoryID.cpp.
Here is the caller graph for this function:
|
explicit |
(Re-)Construct a memory ID from a string representation as returned by str().
Definition at line 24 of file MemoryID.cpp.
Here is the call graph for this function:| MemoryID | ( | const std::string & | memoryName, |
| const std::string & | coreSegmentName, | ||
| const std::string & | providerSegmentName = "", |
||
| const std::string & | entityName = "", |
||
| Time | timestamp = Time::Invalid(), |
||
| int | instanceIndex = -1 |
||
| ) |
Definition at line 86 of file MemoryID.cpp.
| MemoryID cleanID | ( | ) | const |
Definition at line 133 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 145 of file MemoryID.h.
|
inline |
Definition at line 133 of file MemoryID.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Constructor memory ID from items as returned by getItems().
Definition at line 194 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Alias for constructor from string.
Definition at line 188 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< std::string > getAllItems | ( | bool | escapeDelimiters = false | ) | const |
Get all levels as strings.
Definition at line 273 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MemoryID getCoreSegmentID | ( | ) | const |
Definition at line 294 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MemoryID getEntityID | ( | ) | const |
Definition at line 310 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MemoryID getEntityInstanceID | ( | ) | const |
| MemoryID getEntitySnapshotID | ( | ) | const |
Definition at line 318 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< std::string > getItems | ( | bool | escapeDelimiters = false | ) | const |
Get the levels from root to first not defined level (excluding).
Definition at line 233 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::string getLeafItem | ( | ) | const |
Get the lowest defined level (or empty string if there is none).
Definition at line 119 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MemoryID getMemoryID | ( | ) | const |
| MemoryID getProviderSegmentID | ( | ) | const |
Definition at line 302 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
inline |
| bool hasGap | ( | ) | const |
Indicate whether this ID has a gap such as in 'Memory//MyProvider' (no core segment name).
Definition at line 163 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 127 of file MemoryID.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reconstruct an instance index from a string as returned by instanceIndexStr().
Definition at line 467 of file MemoryID.cpp.
Here is the caller graph for this function:| std::string instanceIndexStr | ( | ) | const |
Get the instance index as string.
Definition at line 455 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool isWellDefined | ( | ) | const |
Indicate whether this ID is well-defined.
A well-defined ID has no specified level after a non-specified level (i.e., no gaps).
Well-defined examples:
Non-well-defined examples:
*this is a well-defined memory ID. Definition at line 182 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 229 of file MemoryID.h.
| bool operator< | ( | const MemoryID & | rhs | ) | const |
|
inline |
| bool operator== | ( | const MemoryID & | other | ) | const |
Definition at line 473 of file MemoryID.cpp.
|
inline |
|
inline |
| MemoryID removeLeafItem | ( | ) | const |
Definition at line 334 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setCoreSegmentID | ( | const MemoryID & | id | ) |
Definition at line 366 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setEntityID | ( | const MemoryID & | id | ) |
Definition at line 380 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setEntityInstanceID | ( | const MemoryID & | id | ) |
| void setEntitySnapshotID | ( | const MemoryID & | id | ) |
Definition at line 387 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setMemoryID | ( | const MemoryID & | id | ) |
| void setProviderSegmentID | ( | const MemoryID & | id | ) |
Definition at line 373 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::string str | ( | bool | escapeDelimiters = true | ) | const |
Get a string representation of this memory ID.
Items are separated by a delimiter. If escapeDelimiter is true, delimiters occuring inside names are escaped with backward slashes. This allows to reconstruct the memory ID from the result of str() in these cases.
| escapeDelimiter | If true, escape delimiters inside names |
Definition at line 102 of file MemoryID.cpp.
Here is the caller graph for this function:
|
static |
Reconstruct a timestamp from a string as returned by timestampStr().
Definition at line 461 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::string timestampStr | ( | ) | const |
Get the timestamp as string.
Definition at line 449 of file MemoryID.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MemoryID withCoreSegmentName | ( | const std::string & | name | ) | const |
| MemoryID withEntityName | ( | const std::string & | name | ) | const |
| MemoryID withInstanceIndex | ( | int | index | ) | const |
| MemoryID withMemoryName | ( | const std::string & | name | ) | const |
| MemoryID withProviderSegmentName | ( | const std::string & | name | ) | const |
|
friend |
Definition at line 557 of file MemoryID.cpp.
| std::string coreSegmentName = "" |
Definition at line 51 of file MemoryID.h.
| std::string entityName = "" |
Definition at line 53 of file MemoryID.h.
| int instanceIndex = -1 |
Definition at line 55 of file MemoryID.h.
| std::string memoryName = "" |
Definition at line 50 of file MemoryID.h.
| std::string providerSegmentName = "" |
Definition at line 52 of file MemoryID.h.
| Time timestamp = Time::Invalid() |
Definition at line 54 of file MemoryID.h.