#include <EmulContext.h>
Definition at line 16 of file EmulContext.h.
◆ EmulContext() [1/2]
Trig::EmulContext::EmulContext |
( |
| ) |
|
|
default |
◆ EmulContext() [2/2]
◆ ~EmulContext()
Trig::EmulContext::~EmulContext |
( |
| ) |
|
|
default |
◆ get()
template<typename T >
const T * Trig::EmulContext::get |
( |
const std::string & |
name | ) |
const |
|
inline |
Definition at line 94 of file EmulContext.h.
98 throw std::invalid_argument(
"Object with name `" +
name +
99 "` is not in memory. Cannot be retrieved: " +
name);
101 const IHolder *holder = (*itr).second.get();
102 if (
typeid(T) != holder->type())
103 throw std::invalid_argument(
"Type mismatch for object '" +
name +
"'");
105 return reinterpret_cast<const HolderT<T> *
>(holder)->
value();
◆ operator=()
◆ store()
template<typename T >
void Trig::EmulContext::store |
( |
const std::string & |
name, |
|
|
std::unique_ptr< T > && |
object |
|
) |
| |
|
inline |
Definition at line 77 of file EmulContext.h.
81 throw std::invalid_argument(
"Object can not have an empty name in order to be stored in memory");
84 throw std::runtime_error(
"Object with name `" +
name +
85 "` already stored in memory");
87 using stored_object_t = std::unique_ptr<T>;
◆ m_store
std::unordered_map<std::string, std::unique_ptr<IHolder> > Trig::EmulContext::m_store |
|
private |
The documentation for this class was generated from the following file:
std::unordered_map< std::string, std::unique_ptr< IHolder > > m_store