/******************************************************************* * * DESCRIPTION: class AtomicState * * AUTHOR: Alejandro Troccoli * * EMAIL: mailto://atroccol@dc.uba.ar * * DATE: 06/11/2000 * *******************************************************************/ #ifndef _ATOMICSTATE_H #define _ATOMICSTATE_H #include "modelstate.h" #include "JackyDebugStream.h" //for jacky-debug-mode class AtomicState : public ModelState { public: enum State { active, passive } ; State st; AtomicState(){}; virtual ~AtomicState(){}; virtual AtomicState& operator=(AtomicState& thisState); //Jacky: add "virtual" to this function virtual void copyState(BasicState *); //Jacky: add "virtual" to this function virtual int getSize() const; //Jacky: add "virtual" to this function #ifdef JACKY_DEBUG //Jacky: this function will be defined in all state classes for ParallelProcesses & Models // to show (print) the content of the state for debugging purpose virtual void showStateContent( ostream& ) const; #endif }; #ifdef JACKY_DEBUG inline void AtomicState::showStateContent( ostream& out) const{ //out << "\t^^^^^AtomicState::showStateContent() called^^^^^" << endl << flush; //1> first call the counterpart function in the base class ModelState::showStateContent(out); //2> show content defined in this class out << "\t\tAtomicState [ state = " << flush; if( st == AtomicState::active ){ out << "active ]" << endl << flush; } else if( st == AtomicState::passive ){ out << "passive ]" << endl << flush; } } #endif inline ostream& operator<<( ostream& o, const AtomicState::State& st) { o << (int) st; return o; } inline istream& operator>>( istream& is, AtomicState::State& st) { int s; is >> s; st = AtomicState::State(s); return is; } #endif // _ATOMICSTATE_H