State

Functions

SET_CID

IMPLEMENT_AS

State

State

~State

bool

operator==

bool

operator!=

Object *

GetResourceManager

int

GetNumber

bool

InTransaction

const State &

GetInvalidState

const State &

GetZeroState

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

SET_CID(CID_class_REDState)
IMPLEMENT_AS()
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 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.