41#ifndef GEOGRAM_BASIC_VECTOR_ATTRIBUTE
42#define GEOGRAM_BASIC_VECTOR_ATTRIBUTE
57 static constexpr index_t vec_dim = DIM;
80 if(store ==
nullptr) {
96 if(store_ ==
nullptr) {
101 store_observer_.register_me(store_);
109 if(!store_observer_.disconnected()) {
110 store_observer_.unregister_me(store_);
126 return (store_ !=
nullptr && !store_observer_.disconnected());
130 return store_observer_.size();
141#ifdef GEO_COMPILER_CLANG
142#pragma clang diagnostic push
143#pragma clang diagnostic ignored "-Wcast-align"
147 return ((
vec_type*)store_observer_.base_addr())[i];
152 return ((
vec_type*)store_observer_.base_addr())[i];
155#ifdef GEO_COMPILER_CLANG
156#pragma clang diagnostic pop
#define geo_assert(x)
Verifies that a condition is met.
#define geo_debug_assert(x)
Verifies that a condition is met.
Generic mechanism for attributes.
Common include file, providing basic definitions. Should be included before anything else by all head...
AttributesManager * manager() const
Gets the AttributesManager this Attribute is bound to.
index_t size() const
Gets the size.
bool is_bound() const
Tests whether an Attribute is bound.
void unbind()
Unbinds this Attribute.
static bool is_defined(AttributesManager &manager, const std::string &name, index_t dim=0)
Tests whether an attribute with the specified name and with corresponding type exists in an Attribute...
void bind(AttributesManager &manager, const std::string &name)
Binds this Attribute to an AttributesManager.
bool bind_if_is_defined(AttributesManager &manager, const std::string &name)
Binds this Attribute to an AttributesManager if it already exists in the AttributesManager.
Base class for attributes. They are notified whenever the AttributeStore is modified.
index_t dimension() const
Gets the dimension.
Notifies a set of AttributeStoreObservers each time the stored array changes size and/or base address...
index_t dimension() const
Gets the dimension.
virtual bool elements_type_matches(const std::string &type_name) const =0
Tests whether this AttributeStore stores elements of a given type.
Manages an attribute attached to a set of object.
Attribute()
Creates an uninitialized (unbound) Attribute.
T & operator[](index_t i)
Gets a modifiable element by index.
Managers a set of attributes attached to an object.
AttributeStore * find_attribute_store(const std::string &name)
Finds an AttributeStore by name.
void bind_attribute_store(const std::string &name, AttributeStore *as)
Binds an AttributeStore with the specified name. Ownership of this AttributeStore is transferred to t...
Stores an array of elements of a given type, and notifies a set of AttributeStoreObservers each time ...
Geometric functions in 2d and 3d.
Global Vorpaline namespace.
geo_index_t index_t
The type for storing and manipulating indices.