00001 00027 #ifndef CONTEXTRANGE_H 00028 #define CONTEXTRANGE_H 00029 00030 #include "Context.h" 00031 00032 class Context; 00033 00034 class ContextRange{ 00035 00036 public: 00037 00038 ContextRange(); 00039 ContextRange(const int siteMask, const int simMask, 00040 const TimeStamp &tstart, const TimeStamp &tend); 00041 virtual ~ContextRange(); 00042 00043 std::string AsString(const char* option = "") const; 00044 00045 bool IsCompatible(const Context &cx) const; 00046 bool IsCompatible(const Context *cx) const; 00047 00048 int GetSiteMask() const { return mSiteMask; } 00049 int GetSimMask() const { return mSimMask; } 00050 TimeStamp GetTimeStart() const { return mTimeStart; } 00051 TimeStamp GetTimeEnd() const { return mTimeEnd; } 00052 00055 void TrimTo(const ContextRange& other); 00056 00057 void SetTimeStart(const TimeStamp& tstart) { mTimeStart = tstart; } 00058 void SetTimeEnd(const TimeStamp& tend) { mTimeEnd = tend; } 00059 void SetSiteMask( const int siteMask ){ mSiteMask = siteMask ; } 00060 void SetSimMask( const int simMask ){ mSimMask = simMask ; } 00061 00062 friend bool operator==(const ContextRange &lhs, const ContextRange &rhs); 00063 friend bool operator!=(const ContextRange &lhs, const ContextRange &rhs); 00064 friend bool operator< (const ContextRange &lhs, const ContextRange &rhs); 00065 friend bool operator<=(const ContextRange &lhs, const ContextRange &rhs); 00066 friend bool operator> (const ContextRange &lhs, const ContextRange &rhs); 00067 friend bool operator>=(const ContextRange &lhs, const ContextRange &rhs); 00068 00069 protected: 00070 int mSiteMask; 00071 int mSimMask; 00072 TimeStamp mTimeStart; 00073 TimeStamp mTimeEnd; 00074 00075 }; 00076 00077 #endif