State

Functions

CID

GetClassID

const State &

GetInvalidState

const State &

GetZeroState

void *

As

const void *

As

class T_As

As

class T_As

As

State

State

~State

bool

operator==

bool

operator!=

Object *

GetResourceManager

int

GetNumber

bool

InTransaction

Detailed Description

class State : public RED::Object

This class defines the user transaction needed to edit engine data.

@related Transaction Management, function RED::IResourceManager::BeginState, function RED::IResourceManager::EndState

Header of the State class. The state defines a transaction starting with a RED::IResourceManager::BeginState call and ending with a RED::IResourceManager::EndState call.

Between these two functions, the RED::IResourceManager::GetState call retrieves the current transaction parameter that must be supplied to Red sdk API calls to edit data in the cluster.

The state has a transaction number (first transaction is number 1), points to the cluster’s resource manager, and has a transaction mode indicating whether we’re in a valid transaction or outside of it.

SDK calls return RED_WORKFLOW_ERROR when transaction errors arise.

Public Functions

virtual void *As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

virtual const void *As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

template<class T_As>
inline T_As *As()
template<class T_As>
inline const T_As *As() const
State()

State construction method.

State(RED::Object *iResmgr, int iNumber, int iTransactionMode)

State construction method.

Parameters
  • iResmgr – The cluster’s resource manager address.

  • iNumber – Transaction number.

  • iTransactionMode – Set in or out of transaction.

~State()

State destruction method.

inline bool operator==(const RED::State &iCompare) const

State comparison operator.

Parameters

iCompare – Right handed operator compared with this.

Returns

true when the two states are identical, false otherwise.

inline bool operator!=(const RED::State &iCompare) const

State difference operator.

Parameters

iCompare – Right handed operator compared with this.

Returns

true when the two states differ, false otherwise.

inline RED::Object *GetResourceManager() const
Returns

The address of the resource manager, when available.

inline int GetNumber() const
Returns

The current transaction number. Should be >= 1 when valid.

inline bool InTransaction() const
Returns

true if we are in a valid transaction, false otherwise.

Public Static Functions

static inline RED::CID GetClassID()
static const RED::State &GetInvalidState()
Returns

An invalid transaction state.

static const RED::State &GetZeroState()

Returns a state in a valid transaction, that’ll always access the most recent data container in any object. This state bypasses internal REDsdk transaction mechanisms and always write ‘in place’existing data containers. It can eventually create a new data container for a fresh blank object.

Returns

A stateless data configuration transaction.