lookup_mixins.cpp
Go to the documentation of this file.
1 #include "lookup_mixins.h"
2 
4 
5 
6 namespace armarx::armem::base
7 {
8 
9  void detail::checkHasInstanceIndex(const MemoryID& instanceID)
10  {
11  if (not instanceID.hasInstanceIndex())
12  {
13  throw armem::error::InvalidMemoryID(instanceID, "Instance ID has no instance index.");
14  }
15  }
16 
17 
18  void detail::checkHasTimestamp(const MemoryID& snapshotID)
19  {
20  if (not snapshotID.hasTimestamp())
21  {
22  throw armem::error::InvalidMemoryID(snapshotID, "Snapshot ID has no timestamp.");
23  }
24  }
25 
26 
27  void detail::checkHasEntityName(const MemoryID& entityID)
28  {
29  if (not entityID.hasEntityName())
30  {
31  throw armem::error::InvalidMemoryID(entityID, "Entity ID has no entity name.");
32  }
33  }
34 
35 
36  void detail::checkHasProviderSegmentName(const MemoryID& providerSegmentID)
37  {
38  if (not providerSegmentID.hasProviderSegmentName())
39  {
40  throw armem::error::InvalidMemoryID(providerSegmentID, "Provider segment ID has no provider segment name.");
41  }
42  }
43 
44 
46  {
48  {
49  throw armem::error::InvalidMemoryID(coreSegmentID, "Core segment ID has no core segment name.");
50  }
51  }
52 
53 
55  {
56  if (not memoryID.hasMemoryName())
57  {
58  throw armem::error::InvalidMemoryID(memoryID, "Memory ID has no memory name.");
59  }
60  }
61 
62 
63 }
armarx::armem::base
Definition: CoreSegmentBase.h:15
armarx::armem::base::detail::checkHasProviderSegmentName
void checkHasProviderSegmentName(const MemoryID &providerSegmentID)
Throw armem::error::InvalidMemoryID if the given ID has provider segment name.
Definition: lookup_mixins.cpp:36
armarx::navigation::graph::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:30
lookup_mixins.h
ArMemError.h
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::base::detail::checkHasMemoryName
void checkHasMemoryName(const MemoryID &memory)
Throw armem::error::InvalidMemoryID if the given ID has memory name.
Definition: lookup_mixins.cpp:54
armarx::armem::base::detail::checkHasTimestamp
void checkHasTimestamp(const MemoryID &snapshotID)
Throw armem::error::InvalidMemoryID if the given ID has no timestamp.
Definition: lookup_mixins.cpp:18
armarx::armem::base::detail::checkHasEntityName
void checkHasEntityName(const MemoryID &entityID)
Throw armem::error::InvalidMemoryID if the given ID has no entity name.
Definition: lookup_mixins.cpp:27
armarx::armem::MemoryID::hasTimestamp
bool hasTimestamp() const
Definition: MemoryID.h:127
armarx::armem::MemoryID::hasInstanceIndex
bool hasInstanceIndex() const
Definition: MemoryID.h:139
armarx::armem::base::detail::checkHasCoreSegmentName
void checkHasCoreSegmentName(const MemoryID &coreSegmentID)
Throw armem::error::InvalidMemoryID if the given ID has core segment name.
Definition: lookup_mixins.cpp:45
armarx::armem::base::detail::checkHasInstanceIndex
void checkHasInstanceIndex(const MemoryID &instanceID)
Throw armem::error::InvalidMemoryID if the given ID has no instance index.
Definition: lookup_mixins.cpp:9
armarx::armem::MemoryID::hasEntityName
bool hasEntityName() const
Definition: MemoryID.h:121
armarx::armem::error::InvalidMemoryID
Indicates that a memory ID is invalid, e.g.
Definition: ArMemError.h:151
armarx::armem::MemoryID::hasProviderSegmentName
bool hasProviderSegmentName() const
Definition: MemoryID.h:115
armarx::armem::MemoryID::hasCoreSegmentName
bool hasCoreSegmentName() const
Definition: MemoryID.h:109
armarx::armem::MemoryID::hasMemoryName
bool hasMemoryName() const
Definition: MemoryID.h:103
armarx::armem::index::memoryID
const MemoryID memoryID
Definition: memory_ids.cpp:29