Go to the documentation of this file.
21 template <
class _EntityT,
class _Derived>
100 inline const std::string&
187 template <
class EntityFunctionT>
197 template <
class EntityFunctionT>
210 template <
class InstanceFunctionT>
218 id.hasEntityName() ? this->
findEntity(
id.entityName)
225 template <
class InstanceFunctionT>
233 id.hasEntityName() ? this->
findEntity(
id.entityName)
238 std::vector<std::string>
241 return simox::alg::get_keys(this->
_container);
268 entity = &it->second;
272 UpdateResult
ret(entity->update(
update));
273 ret.providerSegmentUpdateType = updateType;
277 template <
class OtherDerivedT>
282 [
this](
const auto& entity)
284 auto it = this->
_container.find(entity.name());
287 it = this->_container
288 .emplace(entity.name(), this->id().withEntityName(entity.name()))
291 it->second.append(entity);
314 const std::string
name = entity.name();
315 return this->
_derived().addEntity(name, std::move(entity));
319 template <
class... Args>
323 ChildT& child = this->
template _addChild<ChildT>(
name, args...);
333 if (this->
size() != other.size())
339 if (not other.hasEntity(key))
344 if (not
value.equalsDeep(other.getEntity(key)))
355 return "provider segment";
Data of a provider segment containing multiple entities.
ReaderT::InputType T & ret
std::string providerSegmentName
AronTyped(aron::type::ObjectPtr aronType=nullptr)
EntityT & addEntity(const EntityT &entity)
Copy and insert an entity.
typename EntitySnapshotT::EntityInstanceT EntityInstanceT
std::vector< EntitySnapshotT > removedSnapshots
bool forEachInstanceIn(const MemoryID &id, InstanceFunctionT &&func)
bool forEachChild(ChildFunctionT &&func)
aron::type::ObjectPtr & aronType()
bool forEachEntity(EntityFunctionT &&func) const
Provides default implmentations of MemoryContainer, as well as iterators (which requires a template).
EntityT * findEntity(const MemoryID &entityID)
bool equalsDeep(const DerivedT &other) const
armarx::armem::UpdateType providerSegmentUpdateType
typename EntityT::EntitySnapshotT EntitySnapshotT
ProviderSegmentBase(const std::string &name, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
ProviderSegmentBase & operator=(const ProviderSegmentBase &other)=default
EntityT & addEntity(EntityT &&entity)
Move and insert an entity.
void append(const OtherDerivedT &other)
armarx::armem::UpdateType entityUpdateType
static std::string getLevelName()
const EntityT * findEntity(const MemoryID &entityID) const
std::vector< std::string > getEntityNames() const
std::string getKeyString() const
MemoryID withProviderSegmentName(const std::string &name) const
std::shared_ptr< Value > value()
UpdateResult(const typename EntityT::UpdateResult &c)
bool hasEntity(const MemoryID &entityID) const
UpdateType
The type of an update.
bool hasEntity(const std::string &name) const
auto * findChildByKey(const KeyT &key, ContainerT &&container)
Find a child in a container by its key.
void checkHasEntityName(const MemoryID &entityID)
Throw armem::error::InvalidMemoryID if the given ID has no entity name.
const EntityT & getEntity(const MemoryID &entityID) const
An update of an entity for a specific point in time.
bool forEachInstanceIn(const MemoryID &id, InstanceFunctionT &&func) const
EntityT & getEntity(const MemoryID &entityID)
auto & getChildByKey(const KeyT &key, ContainerT &&container, const ParentT &owner, KeyStringFn &&keyStringFn)
Retrieve a child in a container by its key.
const EntityT & getEntity(const std::string &name) const
bool forEachInstanceIn(const MemoryID &id, FunctionT &&func, ParentT &parent, bool single, ChildT *child)
std::map< std::string, _EntityT > ContainerT
ProviderSegmentBase(const std::string &name, const MemoryID parentID, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Something with a specific ARON type.
MemoryID withEntityName(const std::string &name) const
ProviderSegmentBase(const MemoryID id, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
bool forEachEntity(EntityFunctionT &&func)
EntityT & addEntity(const std::string &name, Args... args)
Insert an entity in-place.
std::shared_ptr< Object > ObjectPtr
const std::vector< PredictionEngine > & predictionEngines() const
EntityT & addEntity(const std::string &name)
Add an empty entity with the given name.
EntityT & getEntity(const std::string &name)
const EntityT * findEntity(const std::string &name) const
EntityT * findEntity(const std::string &name)
MemoryID entityID
The entity's ID.
UpdateResult update(const EntityUpdate &update)
Updates an entity's history.
const std::string & name() const
void _checkContainerName(const std::string &gottenName, const std::string &actualName, bool emptyOk=true) const
Something that supports a set of prediction engines.
const armem::MemoryID MemoryID