class RED::State

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

#include <REDState.h>

Inherits: Object.

Public functions:

State ( RED::Object * iResmgr, int iNumber, int iTransactionMode )
State ( )
~State ( )
virtual void *As ( const RED::CID & iCID )
virtual const void *As ( const RED::CID & iCID ) const
template< class T_As > const T_As *As ( ) const
template< class T_As > T_As *As ( )
intGetNumber ( ) const
RED::Object *GetResourceManager ( ) const
boolInTransaction ( ) const
booloperator!= ( const RED::State & iCompare ) const
booloperator== ( const RED::State & iCompare ) const

Public static functions:

static RED::CIDGetClassID ( )
static const RED::State &GetInvalidState ( )
static const RED::State &GetZeroState ( )

Protected variables:

int_mode
int_number
RED::Object *_resmgr

Detailed description:

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

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.

Functions documentation

public RED::State::State(RED::Object *iResmgr,
intiNumber,
intiTransactionMode
)

State construction method.

Parameters:

iResmgr:The cluster's resource manager address.
iNumber:Transaction number.
iTransactionMode:Set in or out of transaction.

State construction method.

State destruction method.

public static const RED::State & RED::State::GetInvalidState()

Returns:

An invalid transaction state.
public static const RED::State & RED::State::GetZeroState()

Stateless data configuration.

public virtual void * RED::State::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.

Reimplements: RED::Object::As.

public virtual const void * RED::State::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.

Reimplements: RED::Object::As.

template< class T_As > public const T_As * RED::State::As() const

Template version of the as const method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to a const instance of class T on success, NULL otherwise.

Reimplements: RED::Object::As.

template< class T_As > public T_As * RED::State::As()

Template version of the as method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to an instance of class T on success, NULL otherwise.

Reimplements: RED::Object::As.

public int RED::State::GetNumber() const

Returns:

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

Returns:

The address of the resource manager, when available.
public bool RED::State::InTransaction() const

Returns:

true if we are in a valid transaction, false otherwise.
public bool RED::State::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.
public bool RED::State::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.

Variables documentation

Indicates whether we're in or outside of a transaction.

Number of the current transaction.

Address of the cluster's resource manager, when available.