Changeset 16726


Ignore:
Timestamp:
06/05/13 20:35:45 (12 years ago)
Author:
tbretz
Message:
Changed the scope of some variables and functions to allow for 'StateMachineAsio'
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/StateMachineImp.cc

    r16282 r16726  
    122122StateMachineImp::StateMachineImp(ostream &out, const std::string &name)
    123123    : MessageImp(out), fName(name), fCurrentState(kSM_NotReady),
    124     fRunning(false), fBufferEvents(true), fExitRequested(0)
     124    fBufferEvents(true), fRunning(false), fExitRequested(0)
    125125{
    126126    SetDefaultStateNames();
  • trunk/FACT++/src/StateMachineImp.h

    r16089 r16726  
    4949    std::mutex fMutexEvt; /// Mutex to ensure thread-safe access to the command fifo
    5050
     51    bool fBufferEvents;  /// Flag if events should be buffered outside the event loop
     52
     53protected:
    5154    bool fRunning;       /// Machine is in main-loop
    52     bool fBufferEvents;  /// Flag if events should be buffered outside the event loop
    5355    int  fExitRequested; /// This is a flag which is set true if the main loop should stop
    5456
    5557    /// Push a command into the fifo. The fifo takes over ownership
    56     void PushEvent(Event *cmd);
     58    virtual void PushEvent(Event *cmd);
    5759    /// Pop a command from the fifo.
    5860    std::shared_ptr<Event> PopEvent();
     
    6062    bool HandleNewState(int newstate, const EventImp *evt, const char *txt);
    6163
    62     virtual EventImp *CreateEvent(const std::string &name, const std::string &fmt) = 0;
    63     virtual EventImp *CreateService(const std::string &);
    64 
     64protected:
    6565    /// Is called continously to execute actions in the current state
    6666    virtual int Execute() { return fCurrentState; }
     
    7070    //virtual int Transition(const Event &) { return kSM_FatalError; }
    7171
     72private:
     73    virtual EventImp *CreateEvent(const std::string &name, const std::string &fmt) = 0;
     74    virtual EventImp *CreateService(const std::string &);
     75
    7276    virtual void Lock() { }
    7377    virtual void UnLock() { }
     
    116120
    117121    /// Start the mainloop
    118     int Run(bool dummy);
     122    virtual int Run(bool dummy);
    119123    int Run() { return Run(false); }
    120124
    121125    /// Request to stop the mainloop
    122     void Stop(int code=0);
     126    virtual void Stop(int code=0);
    123127
    124128    /// Used to check if the main loop is already running or still running
Note: See TracChangeset for help on using the changeset viewer.