1#include <Core/Containers/VariableSet.hpp>
2#include <Core/CoreMacros.hpp>
14auto VariableSet::VariableSetFunctions::getInstance() -> VariableSetFunctions* {
15 static VariableSet::VariableSetFunctions instance;
20 m_variables = other.m_variables;
21 m_typeIndexToVtableIndex = other.m_typeIndexToVtableIndex;
22 m_storedType = other.m_storedType;
27 m_variables =
std::move( other.m_variables );
28 m_typeIndexToVtableIndex =
std::move( other.m_typeIndexToVtableIndex );
29 m_storedType =
std::move( other.m_storedType );
39 const auto& index = from.m_typeIndexToVtableIndex.
at( type );
40 from.m_vtable->m_mergeKeepFunctions[index]( from, *this );
46 const auto& index = from.m_typeIndexToVtableIndex.
at( type );
47 from.m_vtable->m_mergeReplaceFunctions[index]( from, *this );
53 for (
const auto& [type, index] : m_typeIndexToVtableIndex ) {
54 sum += m_vtable->m_sizeFunctions[index]( *this );
60 return m_visitorOperator.
find(
id ) != m_visitorOperator.
cend();
bool accept(const std::type_index &id) const override
Acceptance function for the visitor.
void operator()(std::any &&in, std::any &&userParam) const override
Execute a visiting operator on accepted types.
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