1#include <Core/Containers/VariableSet.hpp>
4#include <unordered_map>
18auto VariableSet::VariableSetFunctions::getInstance() -> VariableSetFunctions* {
19 static VariableSet::VariableSetFunctions instance;
24 m_variables = other.m_variables;
25 m_typeIndexToVtableIndex = other.m_typeIndexToVtableIndex;
26 m_storedType = other.m_storedType;
31 m_variables =
std::move( other.m_variables );
32 m_typeIndexToVtableIndex =
std::move( other.m_typeIndexToVtableIndex );
33 m_storedType =
std::move( other.m_storedType );
43 const auto& index = from.m_typeIndexToVtableIndex.
at( type );
44 from.m_vtable->m_mergeKeepFunctions[index]( from, *this );
50 const auto& index = from.m_typeIndexToVtableIndex.
at( type );
51 from.m_vtable->m_mergeReplaceFunctions[index]( from, *this );
57 for (
const auto& [type, index] : m_typeIndexToVtableIndex ) {
58 sum += m_vtable->m_sizeFunctions[index]( *this );
Heterogeneous container storing "Variables", that maps a name (std::string) to a value (of any type T...
auto getStoredTypes() const -> const std::vector< std::type_index > &
Gets the stored data type.
void mergeKeepVariables(const VariableSet &from)
Merge the VariableSet from into this.
void clear()
remove all elements from the container
void mergeReplaceVariables(const VariableSet &from)
Merge the VariableSet from into this.
size_t size() const
Gets the total number of variables (of any type)
auto operator=(const VariableSet &other) -> VariableSet &
Copy assignment operator.
hepler function to manage enum as underlying types in VariableSet