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

For requesting specific state changes of the DUSIME control process. More...

Collaboration diagram for dueca::SimStateRequest:
Collaboration graph
[legend]

Public Types

typedef SimStateRequest __ThisDCOType__
 typedef for internal reference
 

Public Member Functions

 SimStateRequest ()
 default constructor. More...
 
 SimStateRequest (const SimulationState &request)
 Constructor with arguments.
 
 SimStateRequest (const SimStateRequest &o)
 copy constructor. More...
 
 SimStateRequest (::dueca::AmorphReStore &r)
 constructor to restore an SimStateRequest from amorphous storage. More...
 
 ~SimStateRequest ()
 destructor. More...
 
void packData (::dueca::AmorphStore &s) const
 packs the SimStateRequest into amorphous storage. More...
 
void packDataDiff (::dueca::AmorphStore &s, const SimStateRequest &ref) const
 packs the SimStateRequest into amorphous storage. More...
 
void unPackData (::dueca::AmorphReStore &s)
 unpacks the SimStateRequest from an amorphous storage. More...
 
void unPackDataDiff (::dueca::AmorphReStore &s)
 unpacks the differences for SimStateRequest from an amorphous storage. More...
 
bool operator== (const SimStateRequest &o) const
 Test for equality. More...
 
bool operator!= (const SimStateRequest &o) const
 Test for inequality. More...
 
SimStateRequestoperator= (const SimStateRequest &o)
 Assignment operator. More...
 
std::ostream & print (std::ostream &s) const
 prints the SimStateRequest to a stream. 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, SimStateRequest *&o)
 placement "new", needed for stl. More...
 

Public Attributes

SimulationState request
 requested simulation 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

For requesting specific state changes of the DUSIME control process.

The SimStateRequest channel is a channel with event data, and with zero or more entries. A receiving token is defined by the DUSIME code.

You can use this channel to request changes in the DUSIME state machine. In your header file, declare a writing token:

ChannelWriteToken w_state_request;

In your constructor, initialize the token with

w_state_request(getId(), NameSet("dusime", "SimStateRequest", ""),
"SimStateRequest", "", Channel::Events,

At the appropriate moment, you can request a DUSIME state change with the desired final state (HoldCurrent, Advance, Replay or Inactive) as data in the request. Note that state changes, due to the nature of DUECA's distributed processing, cannot be instantaneous. The effect of sending the state change would be that of pressing the button at that moment.

{
// switching back to HoldCurrent
DataWriter<SimStateRequest> wr(w_state_request, ts);
wr.data().request = SimulationState::HoldCurrent;
}

Constructor & Destructor Documentation

◆ SimStateRequest() [1/3]

dueca::SimStateRequest::SimStateRequest ( )

default constructor.

◆ SimStateRequest() [2/3]

dueca::SimStateRequest::SimStateRequest ( const SimStateRequest o)

copy constructor.

◆ SimStateRequest() [3/3]

dueca::SimStateRequest::SimStateRequest ( ::dueca::AmorphReStore r)

constructor to restore an SimStateRequest from amorphous storage.

◆ ~SimStateRequest()

dueca::SimStateRequest::~SimStateRequest ( )

destructor.

Member Function Documentation

◆ operator new() [1/2]

static void* dueca::SimStateRequest::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::SimStateRequest::operator delete ( void *  p)
static

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

◆ operator new() [2/2]

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

placement "new", needed for stl.

◆ packData()

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

packs the SimStateRequest into amorphous storage.

◆ packDataDiff()

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

packs the SimStateRequest into amorphous storage.

only differences with a previous object are packed.

◆ unPackData()

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

unpacks the SimStateRequest from an amorphous storage.

◆ unPackDataDiff()

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

unpacks the differences for SimStateRequest from an amorphous storage.

◆ operator==()

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

Test for equality.

◆ operator!=()

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

Test for inequality.

◆ operator=()

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

Assignment operator.

◆ print()

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

prints the SimStateRequest to a stream.

Member Data Documentation

◆ classname

const char* const dueca::SimStateRequest::classname
static

The name of this class.

◆ magic_check_number

const uint32_t dueca::SimStateRequest::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: