Changeset 13835


Ignore:
Timestamp:
05/23/12 17:03:03 (13 years ago)
Author:
tbretz
Message:
Removed targetstate stuff; derived from DimInfoHandler; added infoHandler which will post the received data as events to the event loop.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r12958 r13835  
    2121
    2222#include "EventDim.h"
     23#include "ServiceDim.h"
    2324
    2425using namespace std;
     
    8182//! For parameter description see StateMachineImp.
    8283//!
    83 EventImp *StateMachineDim::CreateEvent(int targetstate, const char *name, const char *fmt)
    84 {
    85     return new EventDim(targetstate, GetName()+"/"+name, fmt, this);
     84EventImp *StateMachineDim::CreateEvent(const char *name, const char *fmt)
     85{
     86    return new EventDim(GetName()+"/"+name, fmt, this);
     87}
     88
     89EventImp *StateMachineDim::CreateService(const char *name)
     90{
     91    return new ServiceDim(name, this);
    8692}
    8793
     
    150156{
    151157    dim_unlock();
     158}
     159
     160void StateMachineDim::infoHandler()
     161{
     162    DimInfo *inf = getInfo();
     163    if (!inf)
     164        return;
     165
     166    const EventImp *evt = dynamic_cast<EventImp*>(inf);
     167
     168    if (HasEvent(evt))
     169        PostEvent(*evt);
    152170}
    153171
  • trunk/FACT++/src/StateMachineDim.h

    r11397 r13835  
    5454#include "StateMachine.h"     // StateMachien
    5555
    56 class StateMachineDim : public DimCommandHandler, public DimLog, public DimStart, public StateMachineImp
     56class StateMachineDim : public DimCommandHandler, public DimInfoHandler, public DimLog, public DimStart, public StateMachineImp
    5757{
    5858private:
     
    6666    void exitHandler(int code);  /// Overwritten DimCommand::exitHandler.
    6767    void commandHandler();       /// Overwritten DimCommand::commandHandler
     68    void infoHandler();          /// Overwritten DimInfo::infoHandler
    6869
    69     EventImp *CreateEvent(int targetstate, const char *name, const char *fmt);
     70    EventImp *CreateEvent(const char *name, const char *fmt);
     71    EventImp *CreateService(const char *name);
    7072
    7173protected:
Note: See TracChangeset for help on using the changeset viewer.