Class TableObject

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class TableObject : public InterfaceObject

This class provides common functionality for interface objects that are configured by ETS with MemorWrite.

Subclassed by AddressTableObject, ApplicationProgramObject, AssociationTableObject, GroupObjectTableObject, RouterObject

Public Functions

TableObject(Memory &memory, uint32_t staticTableAdr = 0, uint32_t staticTableSize = 0)

The constuctor.

Parameters:

memory – The instance of the memory management class to use.

virtual ~TableObject()

The destructor.

LoadState loadState()

This method returns the LoadState of the interface object.

virtual uint8_t *save(uint8_t *buffer) override

This method is called when the object should save its state to the buffer.

Parameters:

buffer – The buffer the object should save its state to.

Returns:

The buffer plus the size of the object state. The next object will use this value as the start of its buffer.

virtual const uint8_t *restore(const uint8_t *buffer) override

This method is called when the object should restore its state from the buffer.

Parameters:

buffer – The buffer the object should restore its state from.

Returns:

The buffer plus the size of the object state. The next object will use this value as the start of its buffer.

virtual uint16_t saveSize() override
Returns:

The maximum number of bytes the object needs to save its state.

Public Static Functions

static void beforeTablesUnloadCallback(BeforeTablesUnloadCallback func)
static BeforeTablesUnloadCallback beforeTablesUnloadCallback()

Protected Functions

virtual void beforeStateChange(LoadState &newState)

This method is called before the interface object enters a new LoadState.

If there is a error changing the state newState should be set to LS_ERROR and errorCode() to a reason for the failure.

uint8_t *data()

returns the internal data of the interface object.

This pointer belongs to the TableObject class and must not be written at nor freed.

void errorCode(ErrorCode errorCode)

Set the reason for a state change failure.

virtual void initializeProperties(size_t propertiesSize, Property **properties) override

Intializes the Property-array the the supplied values.

Protected Attributes

Memory &_memory

Protected Static Attributes

static BeforeTablesUnloadCallback _beforeTablesUnload = 0