14#include <lagrange/Attribute.h>
15#include <lagrange/AttributeTypes.h>
16#include <lagrange/internal/weak_ptr.h>
17#include <lagrange/utils/Error.h>
21namespace lagrange::python {
35 auto attr = m_attr.lock();
36 if (attr ==
nullptr)
throw Error(
"Attribute is no longer valid!");
40 template <
typename ValueType>
43 auto attr = m_attr.lock();
44 if (attr ==
nullptr)
throw Error(
"Attribute is no longer valid!");
50 template <
typename CallBack>
51 auto process(CallBack&& cb)
53#define LA_X_process(_, ValueType) \
55 auto attr = ptr<ValueType>(); \
56 if (attr != nullptr) { \
62 throw Error(
"Cannot process attribute with unsupported type!");
Derived attribute class that stores the actual information.
Definition Attribute.h:153
NOT implemented: custom allocator support.
Definition shared_ptr.h:111
#define LA_ATTRIBUTE_X(mode, data)
X Macro arguments for the Attribute<> class.
Definition AttributeTypes.h:48
@ Error
Throw an error if collision is detected.
Definition MappingPolicy.h:24