DUECA/DUSIME
Loading...
Searching...
No Matches
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...

#include <SimStateRequest.hxx>

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

Public Types

typedef SimStateRequest __ThisDCOType__
 typedef for internal reference
 

Public Member Functions

 SimStateRequest ()
 default constructor.
 
 SimStateRequest (const SimulationState &request)
 Constructor with arguments.
 
 SimStateRequest (const SimStateRequest &o)
 copy constructor.
 
 SimStateRequest (::dueca::AmorphReStore &r)
 constructor to restore an SimStateRequest from amorphous storage.
 
 ~SimStateRequest ()
 destructor.
 
void packData (::dueca::AmorphStore &s) const
 packs the SimStateRequest into amorphous storage.
 
void packDataDiff (::dueca::AmorphStore &s, const SimStateRequest &ref) const
 packs the SimStateRequest into amorphous storage.
 
void unPackData (::dueca::AmorphReStore &s)
 unpacks the SimStateRequest from an amorphous storage.
 
void unPackDataDiff (::dueca::AmorphReStore &s)
 unpacks the differences for SimStateRequest from an amorphous storage.
 
bool operator== (const SimStateRequest &o) const
 Test for equality.
 
bool operator!= (const SimStateRequest &o) const
 Test for inequality.
 
SimStateRequestoperator= (const SimStateRequest &o)
 Assignment operator.
 
std::ostream & print (std::ostream &s) const
 prints the SimStateRequest to a stream.
 

Static Public Member Functions

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

Public Attributes

SimulationState request
 requested simulation state
 

Static Public Attributes

static const char *const classname
 The name of this class.
 
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.
 

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:

Access token for writing an entry in a UnifiedChannel.
Definition ChannelWriteToken.hxx:82
This is a "light weight object" that enables you to read the latest set of data on a StreamChannelEnd...
Definition StreamReaderLatest.hxx:43

In your constructor, initialize the token with

w_state_request(getId(), NameSet("dusime", "SimStateRequest", ""),
"SimStateRequest", "", Channel::Events,
@ Events
Event-like data, time is a point stamp, multiple events may share the same time.
Definition ChannelDef.hxx:35
@ ZeroOrMoreEntries
When opening the channel for reading, it is acceptable that there is no entry yet.
Definition ChannelDef.hxx:50
Name tuple as used in DUECA.
Definition NameSet.hxx:65

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
}
const T & data()
Access to the data.
Definition DataReader.hxx:456
@ HoldCurrent
A state, shared between the SimulationModule and HardwareModule.
Definition SimulationState.hxx:64

Member Function Documentation

◆ operator new()

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.

◆ 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.


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