|
|
An entity over a period of time. More...
#include <RobotAPI/libraries/armem/core/base/EntityBase.h>
Inheritance diagram for EntityBase< _EntitySnapshotT, _Derived >:Classes | |
| struct | UpdateResult |
Public Types | |
| using | ChildT = EntitySnapshotT |
| using | EntityInstanceT = typename EntitySnapshotT::EntityInstanceT |
| using | EntitySnapshotT = _EntitySnapshotT |
Public Types inherited from MemoryContainerBase< std::map< Time, _EntitySnapshotT >, _Derived > | |
| using | ContainerT = std::map< Time, _EntitySnapshotT > |
| using | DerivedT = _Derived |
Public Member Functions | |
| EntitySnapshotT & | addSnapshot (const EntitySnapshotT &snapshot) |
| Copy and insert a snapshot. More... | |
| EntitySnapshotT & | addSnapshot (const Time ×tamp) |
| Add a snapshot at the given time. More... | |
| template<class... Args> | |
| EntitySnapshotT & | addSnapshot (const Time ×tamp, Args... args) |
| Insert a snapshot in-place. More... | |
| EntitySnapshotT & | addSnapshot (EntitySnapshotT &&snapshot) |
| Move and insert a snapshot. More... | |
| template<class OtherDerivedT > | |
| void | append (const OtherDerivedT &other) |
| EntityBase () | |
| EntityBase (const EntityBase &other)=default | |
| EntityBase (const MemoryID &id) | |
| EntityBase (const std::string &name, const MemoryID &parentID={}) | |
| EntityBase (EntityBase &&other)=default | |
| bool | equalsDeep (const DerivedT &other) const |
| EntitySnapshotT * | findFirstSnapshot () |
| Return the snapshot with the least recent timestamp. More... | |
| const EntitySnapshotT * | findFirstSnapshot () const |
| const EntitySnapshotT * | findFirstSnapshotAfter (const Time &time) const |
| Return first snapshot after time. More... | |
| const EntitySnapshotT * | findFirstSnapshotAfterOrAt (const Time &time) const |
| Return first snapshot after or at time. More... | |
| auto * | findLatestInstance (int instanceIndex=0) |
| const auto * | findLatestInstance (int instanceIndex=0) const |
| EntitySnapshotT * | findLatestSnapshot () |
| Return the snapshot with the most recent timestamp. More... | |
| const EntitySnapshotT * | findLatestSnapshot () const |
| const EntitySnapshotT * | findLatestSnapshotBefore (const Time &time) const |
| Return the lastest snapshot before time. More... | |
| const EntitySnapshotT * | findLatestSnapshotBeforeOrAt (const Time &time) const |
| Return the latest snapshot before or at time. More... | |
| EntitySnapshotT * | findSnapshot (const MemoryID &snapshotID) |
| const EntitySnapshotT * | findSnapshot (const MemoryID &snapshotID) const |
| EntitySnapshotT * | findSnapshot (const Time ×tamp) |
| const EntitySnapshotT * | findSnapshot (const Time ×tamp) const |
| template<class InstanceFunctionT > | |
| bool | forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) |
| template<class InstanceFunctionT > | |
| bool | forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) const |
| template<class SnapshotFunctionT > | |
| bool | forEachSnapshot (SnapshotFunctionT &&func) |
| template<class SnapshotFunctionT > | |
| bool | forEachSnapshot (SnapshotFunctionT &&func) const |
| template<class FunctionT > | |
| void | forEachSnapshotBefore (const Time &time, FunctionT &&func) const |
| Return all snapshots before (excluding) time. More... | |
| template<class FunctionT > | |
| void | forEachSnapshotBeforeOrAt (const Time &time, FunctionT &&func) const |
| Return all snapshots before or at time. More... | |
| template<class SnapshotFunctionT > | |
| bool | forEachSnapshotIn (const MemoryID &id, SnapshotFunctionT &&func) |
| template<class SnapshotFunctionT > | |
| bool | forEachSnapshotIn (const MemoryID &id, SnapshotFunctionT &&func) const |
| template<class FunctionT > | |
| void | forEachSnapshotInIndexRange (long first, long last, FunctionT &&func) const |
| Return all snapshots from first to last index. More... | |
| template<class FunctionT > | |
| void | forEachSnapshotInTimeRange (const Time &min, const Time &max, FunctionT &&func) const |
| Return all snapshots between, including, min and max. More... | |
| EntitySnapshotT & | getFirstSnapshot () |
| Return the snapshot with the least recent timestamp. More... | |
| const EntitySnapshotT & | getFirstSnapshot () const |
| Time | getFirstTimestamp () const |
| Get the oldest timestamp. More... | |
| std::string | getKeyString () const |
| Time | getLatestTimestamp () const |
| Get the latest timestamp. More... | |
| EntitySnapshotT & | getSnapshot (const MemoryID &snapshotID) |
| const EntitySnapshotT & | getSnapshot (const MemoryID &snapshotID) const |
| EntitySnapshotT & | getSnapshot (const Time &time) |
| Get a snapshot. More... | |
| const EntitySnapshotT & | getSnapshot (const Time &time) const |
| std::vector< Time > | getTimestamps () const |
| Get all timestamps in the history. More... | |
| bool | hasSnapshot (const MemoryID &snapshotID) const |
| Indicate whether a snapshot with the given ID exists. More... | |
| bool | hasSnapshot (const Time &time) const |
| Indicate whether a snapshot at the given time exists. More... | |
| bool | hasSnapshots () const |
| Indicate whether the entity has any snapshots. More... | |
| std::string & | name () |
| const std::string & | name () const |
| EntityBase & | operator= (const EntityBase &other)=default |
| EntityBase & | operator= (EntityBase &&other)=default |
| UpdateResult | update (const EntityUpdate &update) |
| Add the given update to this entity's history. More... | |
Public Member Functions inherited from MemoryContainerBase< std::map< Time, _EntitySnapshotT >, _Derived > | |
| ContainerT::iterator | begin () |
| ContainerT::const_iterator | begin () const |
| void | clear () |
| bool | empty () const |
| ContainerT::iterator | end () |
| ContainerT::const_iterator | end () const |
| bool | forEachChild (ChildFunctionT &&func) |
| bool | forEachChild (ChildFunctionT &&func) const |
| MemoryContainerBase () | |
| MemoryContainerBase (const MemoryContainerBase &other)=default | |
| MemoryContainerBase (const MemoryID &id) | |
| MemoryContainerBase (MemoryContainerBase &&other)=default | |
| MemoryContainerBase & | operator= (const MemoryContainerBase &other)=default |
| MemoryContainerBase & | operator= (MemoryContainerBase &&other)=default |
| std::size_t | size () const |
Public Member Functions inherited from MemoryItem | |
| MemoryID & | id () |
| const MemoryID & | id () const |
| MemoryItem () | |
| MemoryItem (const MemoryID &id) | |
| MemoryItem (const MemoryItem &other)=default | |
| MemoryItem (MemoryItem &&other)=default | |
| MemoryItem & | operator= (const MemoryItem &other)=default |
| MemoryItem & | operator= (MemoryItem &&other)=default |
Public Member Functions inherited from ForEachEntityInstanceMixin< _Derived > | |
| bool | forEachInstance (InstanceFunctionT &&func) |
| bool | forEachInstance (InstanceFunctionT &&func) const |
| bool | forEachInstanceAs (AronDtoFunctionT &&func) const |
Call func on the data of each instance converted to Aron DTO class. More... | |
| bool | forEachInstanceWithDataAs (EntityInstanceBaseAronDtoFunctionT &&func) const |
Call func on each instance with its data converted to Aron DTO class. More... | |
Public Member Functions inherited from GetFindInstanceMixin< _Derived > | |
| auto * | findInstance (const MemoryID &instanceID) |
| Find an entity instance. More... | |
| const auto * | findInstance (const MemoryID &instanceID) const |
| auto & | getInstance (const MemoryID &instanceID) |
| Retrieve an entity instance. More... | |
| const auto & | getInstance (const MemoryID &instanceID) const |
| bool | hasInstance (const MemoryID &instanceID) const |
| Indicate whether this container has an instance with the given ID. More... | |
| bool | hasInstances () const |
| Indicate whether this container contains at least one entity instance. More... | |
Public Member Functions inherited from GetLatestInstanceMixin< _Derived > | |
| auto & | getLatestInstance (int instanceIndex=0) |
| Retrieve the latest entity instance. More... | |
| const auto & | getLatestInstance (int instanceIndex=0) const |
Public Member Functions inherited from GetLatestSnapshotMixin< _Derived > | |
| auto & | getLatestSnapshot (int snapshotIndex=0) |
| Retrieve the latest entity snapshot. More... | |
| const auto & | getLatestSnapshot (int snapshotIndex=0) const |
Static Public Member Functions | |
| static std::string | getLevelName () |
Additional Inherited Members | |
Protected Member Functions inherited from MemoryContainerBase< std::map< Time, _EntitySnapshotT >, _Derived > | |
| ChildT & | _addChild (const KeyT &key, ChildArgs... childArgs) |
| void | _checkContainerName (const std::string &gottenName, const std::string &actualName, bool emptyOk=true) const |
| DerivedT & | _derived () |
| const DerivedT & | _derived () const |
| ContainerT & | container () |
| const ContainerT & | container () const |
Protected Member Functions inherited from MemoryItem | |
| ~MemoryItem () | |
Protected Attributes inherited from MemoryContainerBase< std::map< Time, _EntitySnapshotT >, _Derived > | |
| ContainerT | _container |
Protected Attributes inherited from MemoryItem | |
| MemoryID | _id |
An entity over a period of time.
An entity should be a physical thing or abstract concept existing (and potentially evolving) over time.
Examples are:
At each point in time (EntitySnapshot), the entity can have a (potentially variable) number of instances (EntityInstance), each containing a single AronData object of a specific AronType.
Definition at line 43 of file EntityBase.h.
| using ChildT = EntitySnapshotT |
Definition at line 59 of file EntityBase.h.
| using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT |
Definition at line 57 of file EntityBase.h.
| using EntitySnapshotT = _EntitySnapshotT |
Definition at line 56 of file EntityBase.h.
|
inline |
Definition at line 72 of file EntityBase.h.
|
inlineexplicit |
Definition at line 76 of file EntityBase.h.
|
inlineexplicit |
Definition at line 81 of file EntityBase.h.
|
default |
|
default |
|
inline |
Copy and insert a snapshot.
Definition at line 639 of file EntityBase.h.
|
inline |
Add a snapshot at the given time.
Definition at line 632 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Insert a snapshot in-place.
Definition at line 655 of file EntityBase.h.
|
inline |
Move and insert a snapshot.
Definition at line 646 of file EntityBase.h.
|
inline |
Definition at line 611 of file EntityBase.h.
|
inline |
Definition at line 665 of file EntityBase.h.
|
inline |
Return the snapshot with the least recent timestamp.
Definition at line 245 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Definition at line 251 of file EntityBase.h.
|
inline |
Return first snapshot after time.
| time | The time. |
Definition at line 350 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Return first snapshot after or at time.
| time | The time. |
Definition at line 331 of file EntityBase.h.
|
inline |
|
inline |
Definition at line 363 of file EntityBase.h.
|
inline |
Return the snapshot with the most recent timestamp.
Definition at line 229 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Definition at line 235 of file EntityBase.h.
|
inline |
Return the lastest snapshot before time.
| time | The time. |
Definition at line 287 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Return the latest snapshot before or at time.
| time | The time. |
Definition at line 320 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Definition at line 171 of file EntityBase.h.
|
inline |
Definition at line 178 of file EntityBase.h.
|
inline |
|
inline |
Definition at line 136 of file EntityBase.h.
|
inline |
| func | Function like void process(EntityInstanceT& instance)> |
Definition at line 539 of file EntityBase.h.
|
inline |
| func | Function like void process(EntityInstanceT& instance)> |
Definition at line 554 of file EntityBase.h.
|
inline |
| func | Function like: bool process(EntitySnapshotT& snapshot) |
Definition at line 391 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
| func | Function like void process(const EntitySnapshotT& snapshot) |
Definition at line 401 of file EntityBase.h.
|
inline |
Return all snapshots before (excluding) time.
| time | The time. |
Definition at line 443 of file EntityBase.h.
|
inline |
Return all snapshots before or at time.
| time | The time. |
Definition at line 465 of file EntityBase.h.
|
inline |
| func | Function like: bool process(EntitySnapshotT& snapshot) |
Definition at line 411 of file EntityBase.h.
|
inline |
| func | Function like void process(const EntitySnapshotT& snapshot) |
Definition at line 421 of file EntityBase.h.
|
inline |
Return all snapshots from first to last index.
Negative index are counted from the end, e.g. last == -1 results in getting all queries until the end.
| first | The first index to include. |
| first | The last index to include. |
Definition at line 508 of file EntityBase.h.
|
inline |
Return all snapshots between, including, min and max.
| min | The lowest time to include. |
| min | The highest time to include. |
Definition at line 478 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Return the snapshot with the least recent timestamp.
| <tt>armem::error::EntityHistoryEmpty</tt> | If the history is empty. |
Definition at line 262 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Definition at line 269 of file EntityBase.h.
|
inline |
Get the oldest timestamp.
| <tt>armem::error::EntityHistoryEmpty</tt> | If the history is empty. |
Definition at line 219 of file EntityBase.h.
|
inline |
Definition at line 687 of file EntityBase.h.
|
inline |
Get the latest timestamp.
| <tt>armem::error::EntityHistoryEmpty</tt> | If the history is empty. |
Definition at line 209 of file EntityBase.h.
|
inlinestatic |
Definition at line 693 of file EntityBase.h.
|
inline |
Definition at line 186 of file EntityBase.h.
|
inline |
Definition at line 193 of file EntityBase.h.
|
inline |
Get a snapshot.
| time | The time. |
| <tt>armem::error::MissingEntry</tt> | If there is no such entry. |
Definition at line 150 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Definition at line 160 of file EntityBase.h.
|
inline |
Get all timestamps in the history.
Definition at line 567 of file EntityBase.h.
|
inline |
Indicate whether a snapshot with the given ID exists.
Definition at line 123 of file EntityBase.h.
|
inline |
Indicate whether a snapshot at the given time exists.
Definition at line 115 of file EntityBase.h.
Here is the caller graph for this function:
|
inline |
Indicate whether the entity has any snapshots.
Definition at line 107 of file EntityBase.h.
|
inline |
|
inline |
Definition at line 100 of file EntityBase.h.
|
default |
|
default |
|
inline |
Add the given update to this entity's history.
| update | The update. |
Definition at line 580 of file EntityBase.h.
Here is the caller graph for this function: