lookup_mixins.cpp
Go to the documentation of this file.
1 #include "lookup_mixins.h"
2 
4 
5 namespace armarx::armem::base
6 {
7 
8  void
10  {
11  if (not instanceID.hasInstanceIndex())
12  {
13  throw armem::error::InvalidMemoryID(instanceID, "Instance ID has no instance index.");
14  }
15  }
16 
17  void
19  {
20  if (not snapshotID.hasTimestamp())
21  {
22  throw armem::error::InvalidMemoryID(snapshotID, "Snapshot ID has no timestamp.");
23  }
24  }
25 
26  void
28  {
29  if (not entityID.hasEntityName())
30  {
31  throw armem::error::InvalidMemoryID(entityID, "Entity ID has no entity name.");
32  }
33  }
34 
35  void
37  {
38  if (not providerSegmentID.hasProviderSegmentName())
39  {
41  providerSegmentID, "Provider segment ID has no provider segment name.");
42  }
43  }
44 
45  void
47  {
49  {
51  "Core segment ID has no core segment name.");
52  }
53  }
54 
55  void
57  {
58  if (not memoryID.hasMemoryName())
59  {
60  throw armem::error::InvalidMemoryID(memoryID, "Memory ID has no memory name.");
61  }
62  }
63 
64 
65 } // namespace armarx::armem::base
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:56
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:46
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:28