Changeset 10877


Ignore:
Timestamp:
May 27, 2011, 5:26:27 PM (8 years ago)
Author:
tbretz
Message:
Added templates for easier access to the data.
File:
1 edited

Legend:

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

    r10545 r10877  
    7171    std::vector<char> GetVector() const { return std::vector<char>(GetText(), GetText()+GetSize()); }
    7272    std::string       GetString() const;
     73
     74    template<typename T>
     75        T Get(int offset=0) const { return *reinterpret_cast<const T*>(GetText()+offset); }
     76
     77    template<typename T>
     78        T *Ptr(int offset=0) const { return *reinterpret_cast<const T*>(GetData()+offset); }
    7379};
    7480
Note: See TracChangeset for help on using the changeset viewer.