AMSmartProperties  201
Core library
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
AMSmartProperties::AMPropertyPool Class Reference

AMSmartProperties::AMPropertyPool is a property pool for smart properties. More...

#include <AMProperty.h>

Collaboration diagram for AMSmartProperties::AMPropertyPool:
Collaboration graph
[legend]

Public Member Functions

 AMPropertyPool ()
 Default construct creates an empty AMPropertyPool. More...
 
 AMPropertyPool (AMPropertyState state)
 Do not use it directly!
 
AMPropertyState getPoolState ()
 Returns state. More...
 
void setModified ()
 Set state to modified. This state is signalized from AMProperty and holds this state untl next reset. More...
 
void reset ()
 Resets pool. Mode info on Smart properties. More...
 
bool isDestroyed ()
 Test if Pool is in Destroyed state. Trace is, when state signalised Destroyed flag. More...
 
bool isInProgress ()
 Test if Pool is in progress. More...
 
void runLoop ()
 Only leaves from computing and signalises Loop. More...
 
void runDeleted ()
 Only leaves from computing and signalises Deleted. More...
 
std::string trace ()
 Traces a property computation. This function is available after any exception, othervise return "". More...
 
void destroy ()
 Destroys pool. State of pool moves for ever to state DESTROYED and Smart properties will do nothing. More...
 
void dump (char *buffer=nullptr, int length=0)
 Dumps all properties as string description into specified buffer. More...
 
AMPropertyBase * getEnteringProperty ()
 Retrieve first property, that was actually computed (root). Valid only after exception. More...
 
AMPropertyBase * getLastCausedProperty ()
 Retrieve last property, that was actually computed - property yhat causes and exception (leaf). Valid only after exception. More...
 

Static Public Member Functions

static AMPropertyPool & defaultPool ()
 Get default pool. Default pool is every time in state DESTROYED. Since it, every Smart properties removed from any pool is moved here. Smart property MUST have assigned any pool. More...
 

Static Public Attributes

static const int TRACE_SIZE = 1024
 Max. computation depth of smart properties.
 

Detailed Description

AMSmartProperties::AMPropertyPool is a property pool for smart properties.

Class AMSmartProperties::AMPropertyPool is data stucture which hold set of smart properties. Typically, is Smart properties are used for GUI, One window own one property Pool.

AMSmartProperties::AMPropertyPool also helps tracing of properties, that are involved in property loop. It limits computation depth to TRACE_SIZE-1 (1023) levels. Tracing works only on case that loop is really detected.

Examples:
AMProperty_1.cpp, AMProperty_2.cpp, and AMProperty_3.cpp.

Constructor & Destructor Documentation

◆ AMPropertyPool()

AMSmartProperties::AMPropertyPool::AMPropertyPool ( )

Default construct creates an empty AMPropertyPool.

Exceptions
Thisfunction will not throw an exception.

Member Function Documentation

◆ defaultPool()

static AMPropertyPool& AMSmartProperties::AMPropertyPool::defaultPool ( )
static

Get default pool. Default pool is every time in state DESTROYED. Since it, every Smart properties removed from any pool is moved here. Smart property MUST have assigned any pool.

Returns
Default pool (AMPropertyPool)
Exceptions
Thisfunction will not throw an exception.

◆ destroy()

void AMSmartProperties::AMPropertyPool::destroy ( )

Destroys pool. State of pool moves for ever to state DESTROYED and Smart properties will do nothing.

Exceptions
Thisfunction will not throw an exception.

◆ dump()

void AMSmartProperties::AMPropertyPool::dump ( char *  buffer = nullptr,
int  length = 0 
)

Dumps all properties as string description into specified buffer.

Parameters
buffer
lengthbuffer length
Exceptions
Thisfunction will not throw an exception.

◆ getEnteringProperty()

AMPropertyBase* AMSmartProperties::AMPropertyPool::getEnteringProperty ( )

Retrieve first property, that was actually computed (root). Valid only after exception.

Returns
pointer to that property.

◆ getLastCausedProperty()

AMPropertyBase* AMSmartProperties::AMPropertyPool::getLastCausedProperty ( )

Retrieve last property, that was actually computed - property yhat causes and exception (leaf). Valid only after exception.

Returns
pointer to that property.

◆ getPoolState()

AMPropertyState AMSmartProperties::AMPropertyPool::getPoolState ( )
inline

Returns state.

Returns
Pool state (Three lower bits-property bits are zero)
Exceptions
Thisfunction will not throw an exception.

◆ isDestroyed()

bool AMSmartProperties::AMPropertyPool::isDestroyed ( )
inline

Test if Pool is in Destroyed state. Trace is, when state signalised Destroyed flag.

Returns
bool is in Destroyed state.
Exceptions
Thisfunction will not throw an exception.

◆ isInProgress()

bool AMSmartProperties::AMPropertyPool::isInProgress ( )
inline

Test if Pool is in progress.

Returns
bool is in progress
Exceptions
Thisfunction will not throw an exception.

◆ reset()

void AMSmartProperties::AMPropertyPool::reset ( )

Resets pool. Mode info on Smart properties.

Exceptions
Thisfunction will not throw an exception.

◆ runDeleted()

void AMSmartProperties::AMPropertyPool::runDeleted ( )

Only leaves from computing and signalises Deleted.

Exceptions
Thisfunction will not throw an exception.

◆ runLoop()

void AMSmartProperties::AMPropertyPool::runLoop ( )

Only leaves from computing and signalises Loop.

Exceptions
Thisfunction will not throw an exception.

◆ setModified()

void AMSmartProperties::AMPropertyPool::setModified ( )
inline

Set state to modified. This state is signalized from AMProperty and holds this state untl next reset.

Exceptions
Thisfunction will not throw an exception.

◆ trace()

std::string AMSmartProperties::AMPropertyPool::trace ( )

Traces a property computation. This function is available after any exception, othervise return "".

Returns
std::string with property name (in case of use AMVariableNames) of adress on each line.
Exceptions
Thisfunction will not throw an exception.

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