OTSSegment.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include "afx.h"
  3. #include "XMLSerialization.h"
  4. namespace OTSDATA {
  5. // COTSSegment
  6. class __declspec(dllexport) COTSSegment : public xmls::ISlo
  7. {
  8. public:
  9. // constructor
  10. COTSSegment(); // constructor
  11. COTSSegment(long a_nHeight, long a_nStart, long a_nLength); // constructor
  12. COTSSegment(const COTSSegment&); // copy constructor
  13. COTSSegment(COTSSegment*); // copy constructor
  14. COTSSegment& operator=(const COTSSegment&); // =operator
  15. BOOL operator==(const COTSSegment&); // ==operator
  16. virtual ~COTSSegment(); // destructor
  17. // serialization
  18. void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
  19. long GetHeight() { return m_nHeight; }
  20. void SetHeight(long a_nHeight) { m_nHeight = a_nHeight; }
  21. long GetStart() { return m_nStart; }
  22. void SetStart(long a_nStart) { m_nStart = a_nStart; }
  23. long GetEnd() { return m_nStart + m_nLength; }
  24. void SetEnd(long end) { m_nLength = end - m_nStart; }
  25. long GetLength() { return m_nLength; }
  26. void SetLength(long a_nLength) { m_nLength = a_nLength; }
  27. BOOL UpDownConection(const COTSSegment &a_Segment);
  28. protected:
  29. // cleanup
  30. void Cleanup();
  31. // initialization
  32. void Init();
  33. // duplication
  34. void Duplicate(const COTSSegment& a_oSource);
  35. // height
  36. long m_nHeight;
  37. // start
  38. long m_nStart;
  39. // length
  40. long m_nLength;
  41. };
  42. typedef std::shared_ptr<COTSSegment> __declspec(dllexport) COTSSegmentPtr;
  43. typedef std::vector<COTSSegmentPtr> __declspec(dllexport) COTSSegmentsList;
  44. }