Changeset 14002 for trunk


Ignore:
Timestamp:
05/31/12 16:45:52 (12 years ago)
Author:
tbretz
Message:
Replaced some 'const char*' with a const-refernce to a std::string
Location:
trunk/FACT++/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Event.h

    r13831 r14002  
    1818public:
    1919    /// Constructs an event as a combination of an EventImp and a DimCommand
    20     Event(const std::string &name, const char *fmt="");
     20    Event(const std::string &name, const std::string &fmt="");
    2121    /// Copy constructor
    2222    Event(const EventImp &imp);
    23     Event(const EventImp &imp, const char *name, size_t siz);
     23    Event(const EventImp &imp, const char *ptr, size_t siz);
    2424
    2525    void SetDescription(const std::string &str) { fDescription=str; }
     
    5353    void SetText(const char *txt) { SetData(txt, strlen(txt)+1); }
    5454    void SetString(const std::string &str) { SetData(str.c_str(), str.length()+1); }
    55 
    5655};
    5756
  • trunk/FACT++/src/StateMachine.cc

    r13837 r14002  
    3737//! For parameter description see StateMachineImp.
    3838//!
    39 EventImp *StateMachine::CreateEvent(const char *name, const char *fmt)
     39EventImp *StateMachine::CreateEvent(const string &name, const string &fmt)
    4040{
    41     return new Event((GetName()+'/'+name).c_str(), fmt);
     41    return new Event(GetName()+'/'+name, fmt);
    4242}
    4343
  • trunk/FACT++/src/StateMachine.h

    r13837 r14002  
    77{
    88protected:
    9     EventImp *CreateEvent(const char *name, const char *fmt);
     9    EventImp *CreateEvent(const std::string &name, const std::string &fmt);
    1010
    1111public:
  • trunk/FACT++/src/StateMachineDim.cc

    r13835 r14002  
    8282//! For parameter description see StateMachineImp.
    8383//!
    84 EventImp *StateMachineDim::CreateEvent(const char *name, const char *fmt)
     84EventImp *StateMachineDim::CreateEvent(const string &name, const string &fmt)
    8585{
    8686    return new EventDim(GetName()+"/"+name, fmt, this);
    8787}
    8888
    89 EventImp *StateMachineDim::CreateService(const char *name)
     89EventImp *StateMachineDim::CreateService(const string &name)
    9090{
    9191    return new ServiceDim(name, this);
  • trunk/FACT++/src/StateMachineDim.h

    r13835 r14002  
    6868    void infoHandler();          /// Overwritten DimInfo::infoHandler
    6969
    70     EventImp *CreateEvent(const char *name, const char *fmt);
    71     EventImp *CreateService(const char *name);
     70    EventImp *CreateEvent(const std::string &name, const std::string &fmt);
     71    EventImp *CreateService(const std::string &name);
    7272
    7373protected:
  • trunk/FACT++/src/StateMachineImp.cc

    r13951 r14002  
    604604}
    605605
    606 EventImp *StateMachineImp::CreateService(const char *)
     606EventImp *StateMachineImp::CreateService(const string &)
    607607{
    608608    return new EventImp();
     
    611611// --------------------------------------------------------------------------
    612612//
    613 EventImp &StateMachineImp::Subscribe(const char *name)
     613EventImp &StateMachineImp::Subscribe(const string &name)
    614614{
    615615    EventImp *evt = CreateService(name);
  • trunk/FACT++/src/StateMachineImp.h

    r13951 r14002  
    5454    bool HandleNewState(int newstate, const EventImp *evt, const char *txt);
    5555
    56     virtual EventImp *CreateEvent(const char *name, const char *fmt) = 0;
    57     virtual EventImp *CreateService(const char *);
     56    virtual EventImp *CreateEvent(const std::string &name, const std::string &fmt) = 0;
     57    virtual EventImp *CreateService(const std::string &);
    5858
    5959    /// Is called continously to execute actions in the current state
     
    100100    const std::string &GetName() const { return fName; }
    101101
    102     EventImp &Subscribe(const char *name);
     102    EventImp &Subscribe(const std::string &name);
    103103
    104104    /// return the current state of the machine
Note: See TracChangeset for help on using the changeset viewer.