Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::AttributeStoreObserver Class Reference

Base class for attributes. They are notified whenever the AttributeStore is modified. More...

#include <geogram/basic/attributes.h>

Inheritance diagram for GEO::AttributeStoreObserver:
GEO::AttributeBase< Numeric::uint8 > GEO::AttributeBase< T > GEO::ScalarAttributeAdapterBase GEO::Attribute< Numeric::uint8 > GEO::Attribute< bool > GEO::Attribute< double > GEO::Attribute< GEO::Matrix > GEO::Attribute< float > GEO::Attribute< int > GEO::Attribute< const GEO::vec3Hg * > GEO::Attribute< index_t > GEO::Attribute< GEOGen::SymbolicVertex > GEO::Attribute< GEO::vecng > GEO::Attribute< T > GEO::ReadOnlyScalarAttributeAdapter GEO::ReadWriteScalarAttributeAdapter

Public Member Functions

 AttributeStoreObserver ()
 Creates a new uninitialied AttributeStore.
 
void notify (Memory::pointer base_addr, index_t size, index_t dim)
 Callback function, called by the AttributeStore whenever it is modified. More...
 
index_t size () const
 Gets the size. More...
 
index_t dimension () const
 Gets the dimension. More...
 
index_t nb_elements () const
 Gets the total number of elements. More...
 
void register_me (AttributeStore *store)
 Registers this observer to an AttributeStore. More...
 
void unregister_me (AttributeStore *store)
 Unregisters this observer from an AttributeStore. More...
 
void disconnect ()
 Disconnects this AttributeStoreObserver from its AttributeStore. More...
 

Protected Attributes

Memory::pointer base_addr_
 
index_t size_
 
index_t dimension_
 
bool disconnected_
 

Detailed Description

Base class for attributes. They are notified whenever the AttributeStore is modified.

Definition at line 70 of file attributes.h.

Member Function Documentation

◆ dimension()

index_t GEO::AttributeStoreObserver::dimension ( ) const
inline

Gets the dimension.

Returns
the number of elements per item

Definition at line 108 of file attributes.h.

◆ disconnect()

void GEO::AttributeStoreObserver::disconnect ( )
inline

Disconnects this AttributeStoreObserver from its AttributeStore.

This function is called whenever the AttributesManager is destroyed before the Attributes (can occur when using Lua scripting with Attribute wrapper objects).

Definition at line 141 of file attributes.h.

◆ nb_elements()

index_t GEO::AttributeStoreObserver::nb_elements ( ) const
inline

Gets the total number of elements.

This corresponds to one position past the last valid index.

Returns
the total number of elements.

Definition at line 118 of file attributes.h.

◆ notify()

void GEO::AttributeStoreObserver::notify ( Memory::pointer  base_addr,
index_t  size,
index_t  dim 
)
inline

Callback function, called by the AttributeStore whenever it is modified.

Parameters
[in]base_addrnew base address of the AttributeStore
[in]sizenew number of items in the AttributeStore
[in]dimnew dimension, i.e. number of elements per item

Definition at line 88 of file attributes.h.

◆ register_me()

void GEO::AttributeStoreObserver::register_me ( AttributeStore store)

Registers this observer to an AttributeStore.

Parameters
[in]storea pointer to the AttributeStore.

◆ size()

index_t GEO::AttributeStoreObserver::size ( ) const
inline

Gets the size.

Returns
the number of items

Definition at line 100 of file attributes.h.

◆ unregister_me()

void GEO::AttributeStoreObserver::unregister_me ( AttributeStore store)

Unregisters this observer from an AttributeStore.

Parameters
[in]storea pointer to the AttributeStore.

The documentation for this class was generated from the following file: