MAK RTIspy API Documentation for HLA Evolved
Public Types | Public Member Functions | Protected Types | Protected Attributes
DtWebSpyUtils::ConnectionState Class Reference

The ConnectionState class stores the current state of a web spy connection If the connection has enabled forwarding, then the state may include multiple component states forwarded through the connection The ConnectionState object may be used to represent the complete state of a connection or the state of a single component of a connection (generally for state updates) More...

+ Collaboration diagram for DtWebSpyUtils::ConnectionState:

List of all members.

Public Types

typedef std::pair
< MAKRti::DtTime,
MAKRti::DtString > 
ComponentStateUpdateTimePair
 Holds state information about a specific sub-component, and the time of its last update.

Public Member Functions

 ConnectionState ()
 Default constructor.
 ConnectionState (std::auto_ptr< MAKRti::DtString > currentState, StateComponentType stateType, unsigned long componentId=0)
 Ctor takes the current state of the sub-component in a text or HTML representation State type indicates the portion of the sub-component state contained.
 ConnectionState (const ConnectionState &orig)
 Copy constructor.
ConnectionStateoperator= (const ConnectionState &orig)
 Assignment operator.
virtual ~ConnectionState ()
 Dtor.
void setComponentState (unsigned long componentId, StateComponentType stateType, std::auto_ptr< MAKRti::DtString > currentState, bool overwriteNotAppend=true)
 Add or Update a component state.
std::vector< unsigned long > componentIds () const
 Get a list of contained component IDs.
std::vector< StateComponentTypestateTypes (unsigned long componentId) const
 Get a list of state types stored for a specific component ID.
MAKRti::DtTime timeOfLastComponentUpdate (unsigned long componentId, StateComponentType stateType) const
 Get the time of the last state update for a specified component.
ComponentStateUpdateTimePair componentState (unsigned long componentId, StateComponentType stateType) const
 Get a copy of the component state of the specified type and the time of the last state update.
bool removeComponent (unsigned long componentId)
 Remove a complete component state.
std::auto_ptr< MAKRti::DtString > removeComponentStateType (unsigned long componentId, StateComponentType stateType)
 Remove one state type from a contained component state.
void merge (std::auto_ptr< ConnectionState > connState, bool overwriteNotAppend=true)
 Merge another ConnectionState with this one.

Protected Types

typedef std::pair
< MAKRti::DtTime,
MAKRti::DtString * > 
StateUpdateTimePair
typedef std::map
< StateComponentType,
StateUpdateTimePair
StateTypeToStateMap
typedef std::map< unsigned
long, StateTypeToStateMap
ComponentStateMap

Protected Attributes

MAKRti::DtClock myClock
ComponentStateMap myComponents

Detailed Description

The ConnectionState class stores the current state of a web spy connection If the connection has enabled forwarding, then the state may include multiple component states forwarded through the connection The ConnectionState object may be used to represent the complete state of a connection or the state of a single component of a connection (generally for state updates)


Member Typedef Documentation

typedef std::map< unsigned long, StateTypeToStateMap > DtWebSpyUtils::ConnectionState::ComponentStateMap [protected]
typedef std::pair< MAKRti::DtTime, MAKRti::DtString > DtWebSpyUtils::ConnectionState::ComponentStateUpdateTimePair

Holds state information about a specific sub-component, and the time of its last update.

typedef std::pair< MAKRti::DtTime, MAKRti::DtString* > DtWebSpyUtils::ConnectionState::StateUpdateTimePair [protected]

Constructor & Destructor Documentation

Default constructor.

DtWebSpyUtils::ConnectionState::ConnectionState ( std::auto_ptr< MAKRti::DtString >  currentState,
StateComponentType  stateType,
unsigned long  componentId = 0 
)

Ctor takes the current state of the sub-component in a text or HTML representation State type indicates the portion of the sub-component state contained.

  • in connections with forwarding disabled, there is no need to specify sub-component ID

References myClock, myComponents, and stateTypes().

Copy constructor.

Dtor.


Member Function Documentation

std::vector< unsigned long > DtWebSpyUtils::ConnectionState::componentIds ( ) const

Get a list of contained component IDs.

Referenced by merge().

Get a copy of the component state of the specified type and the time of the last state update.

  • returns time == 0.0f and null string if component was never updated
void DtWebSpyUtils::ConnectionState::merge ( std::auto_ptr< ConnectionState connState,
bool  overwriteNotAppend = true 
)

Merge another ConnectionState with this one.

Overwrites the components of this state with those from the other (or adds them if they don't already exist). Merge is a destructive operation - the passed connState is destroyed by the operation

References componentIds(), removeComponentStateType(), and stateTypes().

DtWebSpyUtils::ConnectionState & DtWebSpyUtils::ConnectionState::operator= ( const ConnectionState orig)

Assignment operator.

References myComponents.

bool DtWebSpyUtils::ConnectionState::removeComponent ( unsigned long  componentId)

Remove a complete component state.

  • returns false if component does not exist
std::auto_ptr< MAKRti::DtString > DtWebSpyUtils::ConnectionState::removeComponentStateType ( unsigned long  componentId,
DtWebSpyUtils::StateComponentType  stateType 
)

Remove one state type from a contained component state.

  • returns ownership of the contained state string or NULL if component does not exist

Referenced by merge().

void DtWebSpyUtils::ConnectionState::setComponentState ( unsigned long  componentId,
StateComponentType  stateType,
std::auto_ptr< MAKRti::DtString >  currentState,
bool  overwriteNotAppend = true 
)

Add or Update a component state.

std::vector< DtWebSpyUtils::StateComponentType > DtWebSpyUtils::ConnectionState::stateTypes ( unsigned long  componentId) const

Get a list of state types stored for a specific component ID.

Referenced by ConnectionState(), and merge().

MAKRti::DtTime DtWebSpyUtils::ConnectionState::timeOfLastComponentUpdate ( unsigned long  componentId,
StateComponentType  stateType 
) const

Get the time of the last state update for a specified component.

  • returns time == 0.0f if component was never updated

Member Data Documentation

MAKRti::DtClock DtWebSpyUtils::ConnectionState::myClock [protected]

Referenced by ConnectionState().

Referenced by ConnectionState(), and operator=().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)