DUECA/DUSIME
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
dueca::SimulationState Struct Reference

An automatically generated class. More...

Public Types

enum  Type {
  HoldCurrent, Advance, Replay, Inactive,
  Inactive_HoldCurrent, Calibrate_HoldCurrent, Advance_HoldCurrent, Replay_HoldCurrent,
  HoldCurrent_Inactive, Neutral, Undefined
}
 Enumerated type for an automatically generated object class. More...
 
typedef SimulationState __ThisDCOType__
 typedef for internal reference
 

Public Member Functions

 SimulationState ()
 default constructor. More...
 
 SimulationState (const Type &t)
 Constructor with arguments.
 
 SimulationState (const SimulationState &o)
 copy constructor. More...
 
 SimulationState (::dueca::AmorphReStore &r)
 constructor to restore an SimulationState from amorphous storage. More...
 
 ~SimulationState ()
 destructor. More...
 
void packData (::dueca::AmorphStore &s) const
 packs the SimulationState into amorphous storage. More...
 
void packDataDiff (::dueca::AmorphStore &s, const SimulationState &ref) const
 packs the SimulationState into amorphous storage. More...
 
void unPackData (::dueca::AmorphReStore &s)
 unpacks the SimulationState from an amorphous storage. More...
 
void unPackDataDiff (::dueca::AmorphReStore &s)
 unpacks the differences for SimulationState from an amorphous storage. More...
 
bool operator== (const SimulationState &o) const
 Test for equality. More...
 
bool operator!= (const SimulationState &o) const
 Test for inequality. More...
 
SimulationStateoperator= (const SimulationState &o)
 Assignment operator. More...
 
std::ostream & print (std::ostream &s) const
 prints the SimulationState to a stream. More...
 
 SimulationState (const std::string &s)
 Constructor from a string.
 
const char *const getString () const
 Obtain a character representation. More...
 
Type get () const
 Obtain the enumerated type. More...
 
SimulationStateoperator= (const SimulationState::Type &o)
 Assignment with type.
 
bool operator== (const SimulationState::Type &o) const
 Test equality.
 
bool operator!= (const SimulationState::Type &o) const
 Test inequality.
 
SimulationState operator&& (const SimulationState &o) const
 Combine two states, into a new one. More...
 
SimulationStateoperator&= (const SimulationState &o)
 Combine and possibly change this state. More...
 
bool betterOrSame (const SimulationState &o) const
 Returns true, if the state given in the argument is the same state or a "better" state (for example a final state, a compatible state) as the current one. More...
 
Type transitionFinal () const
 Return the next state after a transitional state, so with transition complete. More...
 
void neutral ()
 Set to neutral/clear status. More...
 

Static Public Member Functions

static void * operator new (size_t size)
 new operator "new", which places objects not on a heap, but in one of the memory arenas. More...
 
static void operator delete (void *p)
 new operator "delete", to go with the new version of operator new. More...
 
static void * operator new (size_t size, SimulationState *&o)
 placement "new", needed for stl. More...
 

Public Attributes

Type t
 the actual state
 

Static Public Attributes

static const char *const classname
 The name of this class. More...
 
static const uint32_t magic_check_number
 a "magic" number, hashed out of the class definition, that will be used to check consistency of the sent objects across the dueca nodes. More...
 

Detailed Description

An automatically generated class.

Member Enumeration Documentation

◆ Type

Enumerated type for an automatically generated object class.

Enumerator
HoldCurrent 

A state, shared between the SimulationModule and HardwareModule.

The simulation is poised to start.

Advance 

In this state, the simulation is running.

Replay 

In this state, the simulation is played again with recorded input.

Most modules can simply run their Advance code for this

Todo:
The replay functionality has not yet been implemented.
Inactive 

A state, exclusive for HardwareModule, in which the hardware is in the safe position, but not error code.

Inactive_HoldCurrent 

Transition from inactive to HoldCurrent, for example lifting the simulator cab to neutral position.

Calibrate_HoldCurrent 

A transition state during which calibration is carried out.

After calibration the state transitions to HoldCurrent.

Advance_HoldCurrent 

A transition state from Advance, participation in the simulation, back to HoldCurrent.

Transitional State.

Replay_HoldCurrent 

A transition state from Replay, back to HoldCurrent.

HoldCurrent_Inactive 

A transition from HoldCurrent to inactive, for example going down.

Neutral 

Not a state, for initialising combination.

Undefined 

Undefined.

Constructor & Destructor Documentation

◆ SimulationState() [1/3]

dueca::SimulationState::SimulationState ( )

default constructor.

◆ SimulationState() [2/3]

dueca::SimulationState::SimulationState ( const SimulationState o)

copy constructor.

◆ SimulationState() [3/3]

dueca::SimulationState::SimulationState ( ::dueca::AmorphReStore r)

constructor to restore an SimulationState from amorphous storage.

◆ ~SimulationState()

dueca::SimulationState::~SimulationState ( )

destructor.

Member Function Documentation

◆ operator new() [1/2]

static void* dueca::SimulationState::operator new ( size_t  size)
static

new operator "new", which places objects not on a heap, but in one of the memory arenas.

This to speed up memory management.

◆ operator delete()

static void dueca::SimulationState::operator delete ( void *  p)
static

new operator "delete", to go with the new version of operator new.

◆ operator new() [2/2]

static void* dueca::SimulationState::operator new ( size_t  size,
SimulationState *&  o 
)
inlinestatic

placement "new", needed for stl.

◆ packData()

void dueca::SimulationState::packData ( ::dueca::AmorphStore s) const

packs the SimulationState into amorphous storage.

◆ packDataDiff()

void dueca::SimulationState::packDataDiff ( ::dueca::AmorphStore s,
const SimulationState ref 
) const

packs the SimulationState into amorphous storage.

only differences with a previous object are packed.

◆ unPackData()

void dueca::SimulationState::unPackData ( ::dueca::AmorphReStore s)

unpacks the SimulationState from an amorphous storage.

◆ unPackDataDiff()

void dueca::SimulationState::unPackDataDiff ( ::dueca::AmorphReStore s)

unpacks the differences for SimulationState from an amorphous storage.

◆ operator==()

bool dueca::SimulationState::operator== ( const SimulationState o) const

Test for equality.

◆ operator!=()

bool dueca::SimulationState::operator!= ( const SimulationState o) const
inline

Test for inequality.

◆ operator=()

SimulationState& dueca::SimulationState::operator= ( const SimulationState o)

Assignment operator.

◆ print()

std::ostream& dueca::SimulationState::print ( std::ostream &  s) const

prints the SimulationState to a stream.

◆ getString()

const char* const dueca::SimulationState::getString ( ) const

Obtain a character representation.

◆ get()

Type dueca::SimulationState::get ( ) const
inline

Obtain the enumerated type.

◆ operator&&()

SimulationState dueca::SimulationState::operator && ( const SimulationState o) const

Combine two states, into a new one.

◆ operator&=()

SimulationState& dueca::SimulationState::operator &= ( const SimulationState o)

Combine and possibly change this state.

◆ betterOrSame()

bool dueca::SimulationState::betterOrSame ( const SimulationState o) const

Returns true, if the state given in the argument is the same state or a "better" state (for example a final state, a compatible state) as the current one.

Parameters
oOther state for comparison.

◆ transitionFinal()

Type dueca::SimulationState::transitionFinal ( ) const

Return the next state after a transitional state, so with transition complete.

◆ neutral()

void dueca::SimulationState::neutral ( )
inline

Set to neutral/clear status.

Member Data Documentation

◆ classname

const char* const dueca::SimulationState::classname
static

The name of this class.

◆ magic_check_number

const uint32_t dueca::SimulationState::magic_check_number
static

a "magic" number, hashed out of the class definition, that will be used to check consistency of the sent objects across the dueca nodes.


The documentation for this struct was generated from the following file: