IntRange.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include "XMLSerialization.h"
  3. namespace OTSDATA
  4. {
  5. /*using namespace xmls;*/
  6. class __declspec(dllexport) CIntRange : public xmls::ISlo
  7. {
  8. /*protected:
  9. DECLARE_SERIAL(CIntRange)*/
  10. public:
  11. CIntRange(); // constructor
  12. CIntRange(long a_nStart, long a_nEnd); // constructor
  13. CIntRange(const CIntRange&); // copy constructor
  14. CIntRange(CIntRange*); // copy constructor
  15. CIntRange& operator=(const CIntRange&); // =operator
  16. BOOL operator==(const CIntRange&); // =operator
  17. virtual ~CIntRange(); // detractor
  18. // serialization
  19. //void Serialize(CArchive& ar);
  20. void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
  21. // data in range
  22. BOOL DataInRange(long a_nData);
  23. // start
  24. long GetStart() const { return m_nStart; }
  25. void SetStart(long a_nStart);
  26. // end
  27. long GetEnd() const { return m_nEnd; }
  28. void SetEnd(long a_nEnd);
  29. // normalize
  30. void Normalise();
  31. protected:
  32. // cleanup
  33. void Cleanup();
  34. // initialization
  35. void Init();
  36. // duplication
  37. void Duplicate(const CIntRange& a_oSource);
  38. private:
  39. // start
  40. long m_nStart;
  41. // end
  42. long m_nEnd;
  43. };
  44. typedef std::shared_ptr<CIntRange> __declspec(dllexport) CIntRangePtr;
  45. typedef std::vector<CIntRangePtr> __declspec(dllexport) CIntRangeList;
  46. }