Changeset 14563 for trunk/FACT++


Ignore:
Timestamp:
11/05/12 18:41:09 (12 years ago)
Author:
tbretz
Message:
Keep the info whether an event was empty or just zero size.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r14003 r14563  
    4343//
    4444Event::Event(const string &name, const string &fmt) :
    45     fName(name), fFormat(fmt), fTime(Time::none), fQoS(0)
     45    fName(name), fFormat(fmt), fTime(Time::none), fQoS(0), fEmpty(true)
    4646{
    4747}
     
    5959fName(evt.GetName()), fFormat(evt.GetFormat()),
    6060fData(evt.GetText(), evt.GetText()+evt.GetSize()), fTime(evt.GetTime()),
    61 fQoS(evt.GetQoS())
     61fQoS(evt.GetQoS()), fEmpty(evt.IsEmpty())
    6262{
    6363    const size_t pos = fName.find_first_of('/');
     
    8383Event::Event(const EventImp &evt, const char *ptr, size_t siz) : EventImp(evt),
    8484fName(evt.GetName()), fFormat(evt.GetFormat()),
    85 fData(ptr, ptr+siz), fTime(evt.GetTime()), fQoS(evt.GetQoS())
     85fData(ptr, ptr+siz), fTime(evt.GetTime()), fQoS(evt.GetQoS()), fEmpty(ptr==0)
    8686{
    8787    const size_t pos = fName.find_first_of('/');
  • trunk/FACT++/src/Event.h

    r14094 r14563  
    1515    Time  fTime;              /// Time stamp
    1616    int   fQoS;               /// Quality of service
     17    bool  fEmpty;             /// Empty is true if received event was a NULL pointer
    1718
    1819public:
    19     Event() { }
     20    Event() : fQoS(0), fEmpty(true) { }
    2021    /// Constructs an event as a combination of an EventImp and a DimCommand
    2122    Event(const std::string &name, const std::string &fmt="");
     
    3940    /// Return reference to a time stamp
    4041    Time GetTime() const { return fTime; }
     42    /// Return Quality of Service
    4143    int  GetQoS() const  { return fQoS; }
    42 
     44    /// Return if event is not just zero size but empty
     45    bool IsEmpty() const { return fEmpty; }
    4346
    4447    void SetTime() { fTime = Time(); }
Note: See TracChangeset for help on using the changeset viewer.