Changeset 13831 for trunk/FACT++/src


Ignore:
Timestamp:
05/23/12 16:57:06 (13 years ago)
Author:
tbretz
Message:
Removed the target state; added fQoS; added time and QoS to copy constructor.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r10183 r13831  
    1717
    1818using namespace std;
    19 
    20 // --------------------------------------------------------------------------
    21 //
    22 //! Propagate the targetstate to the base class EventImp and store the
    23 //! name in fName and the format in fFormat. Initializes fTime to
    24 //! an invalid time.
    25 //!
    26 //! @param targetstate
    27 //!    Target state to be propagated to the base class constructor
    28 //!
    29 //! @param name
    30 //!    Name given to the event
    31 //!
    32 //! @param fmt
    33 //!    If the event has data attached (like arguments of commands)
    34 //!    the format can be given here. How the format string is defined
    35 //!    is defined within the dim libarary. It is used in console
    36 //!    and shell access to properly format the data sent with the event
    37 //!
    38 //! <B>From the dim manual:</B>
    39 //!    The format parameter specifies the contents of the structure in
    40 //!    the form T:N[;T:N]*[;T] where T is the item type: (I)nteger,
    41 //!    (C)haracter, (L)ong, (S)hort, (F)loat, (D)ouble, and N is the
    42 //!    number of such items. The type alone at the end means all
    43 //!    following items are of the same type. Example: "I:3;F:2;C" means
    44 //!    3 Integers, 2 Floats and Characters until the end. The format
    45 //!    parameter is used for communicating between different platforms.
    46 //!
    47 //
    48 Event::Event(int targetstate, const char *name, const char *fmt) : EventImp(targetstate),
    49     fName(name), fFormat(fmt), fTime(Time::none)
    50 {
    51 }
    5219
    5320// --------------------------------------------------------------------------
     
    7643//
    7744Event::Event(const string &name, const char *fmt) :
    78     fName(name), fFormat(fmt), fTime(Time::none)
     45    fName(name), fFormat(fmt), fTime(Time::none), fQoS(0)
    7946{
    8047}
     
    9158Event::Event(const EventImp &evt) : EventImp(evt),
    9259fName(evt.GetName()), fFormat(evt.GetFormat()),
    93 fData(evt.GetText(), evt.GetText()+evt.GetSize()), fTime(evt.GetTime())
     60fData(evt.GetText(), evt.GetText()+evt.GetSize()), fTime(evt.GetTime()),
     61fQoS(evt.GetQoS())
    9462{
    9563    const size_t pos = fName.find_first_of('/');
     
    11583Event::Event(const EventImp &evt, const char *ptr, size_t siz) : EventImp(evt),
    11684fName(evt.GetName()), fFormat(evt.GetFormat()),
    117 fData(ptr, ptr+siz)
     85fData(ptr, ptr+siz), fTime(evt.GetTime()), fQoS(evt.GetQoS())
    11886{
    11987    const size_t pos = fName.find_first_of('/');
  • trunk/FACT++/src/Event.h

    r10299 r13831  
    1414
    1515    Time  fTime;              /// Time stamp
     16    int   fQoS;               /// Quality of service
    1617
    1718public:
    1819    /// Constructs an event as a combination of an EventImp and a DimCommand
    19     Event(int targetstate, const char *name="", const char *fmt="");
    2020    Event(const std::string &name, const char *fmt="");
    2121    /// Copy constructor
     
    3434    const void *GetData() const { return &*fData.begin(); }
    3535    /// Return the size of the data
    36     int         GetSize() const { return fData.size(); }
     36    size_t      GetSize() const { return fData.size(); }
    3737
    3838    /// Return reference to a time stamp
    3939    Time GetTime() const { return fTime; }
     40    int  GetQoS() const  { return fQoS; }
    4041
    4142
Note: See TracChangeset for help on using the changeset viewer.