Radium Engine  1.5.20
Loading...
Searching...
No Matches
Attribs.cpp
1#include <Core/Types.hpp>
2#include <Core/Utils/Attribs.hpp>
3#include <Core/Utils/Log.hpp>
4
5namespace Ra {
6namespace Core {
7namespace Utils {
8
9AttribBase::~AttribBase() {
10 detachAll();
11}
12
13AttribManager::~AttribManager() {
14 clear();
15}
16
18 m_attribs.clear();
19 m_attribsIndex.clear();
20 m_numAttribs = 0;
21}
22
24 m_attribs.clear();
25 m_numAttribs = 0;
26 for ( const auto& attr : m.m_attribs ) {
27 m_attribsIndex[attr->getName()] = m_attribs.size();
28 m_attribs.push_back( attr->clone() );
29 ++m_numAttribs;
30 }
31}
32
34 // one way
35 for ( const auto& attr : m_attribsIndex ) {
36 if ( other.m_attribsIndex.find( attr.first ) == other.m_attribsIndex.cend() ) {
37 return false;
38 }
39 }
40 // the other way
41 for ( const auto& attr : other.m_attribsIndex ) {
42 if ( m_attribsIndex.find( attr.first ) == m_attribsIndex.cend() ) { return false; }
43 }
44 return true;
45}
46
47} // namespace Utils
48} // namespace Core
49} // namespace Ra
The AttribManager provides attributes management by handles.
Definition Attribs.hpp:204
bool hasSameAttribs(const AttribManager &other)
Definition Attribs.cpp:33
void copyAllAttributes(const AttribManager &m)
Definition Attribs.cpp:23
void clear()
clear all attribs, invalidate handles.
Definition Attribs.cpp:17
T clear(T... args)
T cend(T... args)
T find(T... args)
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3
T push_back(T... args)
T size(T... args)