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

Describes the state a module may be in. More...

Public Types

enum  Type {
  UnPrepared, InitialPrep, Safe, Prepared,
  On, Neutral, Undefined
}
 Enum type for the different modulestate types. More...
 
typedef ModuleState __ThisDCOType__
 typedef for internal reference
 

Public Member Functions

 ModuleState ()
 default constructor. More...
 
 ModuleState (const Type &t)
 Constructor with arguments.
 
 ModuleState (const ModuleState &o)
 copy constructor. More...
 
 ModuleState (::dueca::AmorphReStore &r)
 constructor to restore an ModuleState from amorphous storage. More...
 
 ~ModuleState ()
 destructor. More...
 
void packData (::dueca::AmorphStore &s) const
 packs the ModuleState into amorphous storage. More...
 
void packDataDiff (::dueca::AmorphStore &s, const ModuleState &ref) const
 packs the ModuleState into amorphous storage. More...
 
void unPackData (::dueca::AmorphReStore &s)
 unpacks the ModuleState from an amorphous storage. More...
 
void unPackDataDiff (::dueca::AmorphReStore &s)
 unpacks the differences for ModuleState from an amorphous storage. More...
 
bool operator== (const ModuleState &o) const
 Test for equality. More...
 
bool operator!= (const ModuleState &o) const
 Test for inequality. More...
 
ModuleStateoperator= (const ModuleState &o)
 Assignment operator. More...
 
std::ostream & print (std::ostream &s) const
 prints the ModuleState to a stream. More...
 
 ModuleState (const std::string &s)
 Constructor from a string. More...
 
Type get () const
 Obtain the enumerated type. More...
 
ModuleStateoperator= (const ModuleState::Type &o)
 Assignment with type. More...
 
bool operator== (const ModuleState::Type &o) const
 Test equality. More...
 
bool operator!= (const ModuleState::Type &o) const
 Test inequality. More...
 
ModuleState operator&& (const ModuleState &o) const
 Combine two states, into a new one. More...
 
ModuleStateoperator&= (const ModuleState &o)
 Combine and possibly change this state. More...
 
void neutral ()
 Set to neutral/clear status. More...
 
const char * getString () const
 Obtain the state as a string value. 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, ModuleState *&o)
 placement "new", needed for stl. More...
 

Public Attributes

Type t
 A class member.
 

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

Describes the state a module may be in.

Member Enumeration Documentation

◆ Type

Enum type for the different modulestate types.

Enumerator
UnPrepared 

Existing, but cannot yet start.

InitialPrep 

Prepared to come to safe mode.

Safe 

Activities in safe mode, but not prepared to go on yet.

Prepared 

Prepared to be started further.

If there are critical activities, these are running in safe mode at least. Doubles as a command for going to this state.

On 

Activities in operating mode.

Doubles as a command.

Neutral 

Not a real state, for comparison/state joining purposes.

Undefined 

Not a valid state.

Constructor & Destructor Documentation

◆ ModuleState() [1/4]

dueca::ModuleState::ModuleState ( )

default constructor.

◆ ModuleState() [2/4]

dueca::ModuleState::ModuleState ( const ModuleState o)

copy constructor.

◆ ModuleState() [3/4]

dueca::ModuleState::ModuleState ( ::dueca::AmorphReStore r)

constructor to restore an ModuleState from amorphous storage.

◆ ~ModuleState()

dueca::ModuleState::~ModuleState ( )

destructor.

◆ ModuleState() [4/4]

dueca::ModuleState::ModuleState ( const std::string &  s)

Constructor from a string.

Member Function Documentation

◆ operator new() [1/2]

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

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

◆ operator new() [2/2]

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

placement "new", needed for stl.

◆ packData()

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

packs the ModuleState into amorphous storage.

◆ packDataDiff()

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

packs the ModuleState into amorphous storage.

only differences with a previous object are packed.

◆ unPackData()

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

unpacks the ModuleState from an amorphous storage.

◆ unPackDataDiff()

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

unpacks the differences for ModuleState from an amorphous storage.

◆ operator==() [1/2]

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

Test for equality.

◆ operator!=() [1/2]

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

Test for inequality.

◆ operator=() [1/2]

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

Assignment operator.

◆ print()

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

prints the ModuleState to a stream.

◆ get()

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

Obtain the enumerated type.

◆ operator=() [2/2]

ModuleState& dueca::ModuleState::operator= ( const ModuleState::Type o)
inline

Assignment with type.

◆ operator==() [2/2]

bool dueca::ModuleState::operator== ( const ModuleState::Type o) const
inline

Test equality.

◆ operator!=() [2/2]

bool dueca::ModuleState::operator!= ( const ModuleState::Type o) const
inline

Test inequality.

◆ operator&&()

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

Combine two states, into a new one.

◆ operator&=()

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

Combine and possibly change this state.

◆ neutral()

void dueca::ModuleState::neutral ( )
inline

Set to neutral/clear status.

◆ getString()

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

Obtain the state as a string value.

Member Data Documentation

◆ classname

const char* const dueca::ModuleState::classname
static

The name of this class.

◆ magic_check_number

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