OTSLicenseInfo.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include "afx.h"
  3. #include "XMLSerialization.h"
  4. namespace OTSDATA {
  5. class __declspec(dllexport) COTSLicenseInfo : public CObject, public xmls::Slo
  6. {
  7. protected:
  8. DECLARE_SERIAL(COTSLicenseInfo)
  9. public:
  10. COTSLicenseInfo(); // constructor
  11. virtual ~COTSLicenseInfo(); // detractor
  12. COTSLicenseInfo(const COTSLicenseInfo&); // copy constructor
  13. COTSLicenseInfo(COTSLicenseInfo*); // copy constructor
  14. COTSLicenseInfo& operator=(const COTSLicenseInfo&); // =operator
  15. BOOL operator==(const COTSLicenseInfo&); // ==operator
  16. // serialization
  17. void Serialize(CArchive& ar);
  18. void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
  19. // machine id
  20. CString GetMachineId() { return m_strMachineId; }
  21. void SetMachineId(CString a_strMachineId) { m_strMachineId = a_strMachineId; }
  22. // software package id
  23. OTS_SOFT_PACKAGE_ID GetPackId() { return m_nPackId; }
  24. void SetPackId(OTS_SOFT_PACKAGE_ID a_nPackId) { m_nPackId = a_nPackId; }
  25. // license type
  26. OTS_LICENSE_TYPE GetLicType() { return m_nLicType; }
  27. void SetLicType(OTS_LICENSE_TYPE a_nLicType) { m_nLicType = a_nLicType; }
  28. // expire date
  29. COleDateTime GetExpireDate() { return m_oExpireDate; }
  30. void SetExpireDate(COleDateTime a_oExpireDate) { m_oExpireDate = a_oExpireDate; }
  31. // computer nick name
  32. CString GetComputerNickName() { return m_strComputerNickName; }
  33. void SetComputerNickName(CString a_strComputerNickName) { m_strComputerNickName = a_strComputerNickName; }
  34. protected:
  35. // cleanup
  36. void Cleanup();
  37. // initialization
  38. void Init();
  39. // duplication
  40. void Duplicate(const COTSLicenseInfo& a_oSource);
  41. // machine id
  42. CString m_strMachineId;
  43. // software package id
  44. OTS_SOFT_PACKAGE_ID m_nPackId;
  45. // license type
  46. OTS_LICENSE_TYPE m_nLicType;
  47. // expire date
  48. COleDateTime m_oExpireDate;
  49. // computer nick name
  50. CString m_strComputerNickName;
  51. };
  52. typedef std::shared_ptr<COTSLicenseInfo> __declspec(dllexport) COTSLicenseInfoPtr;
  53. typedef std::vector<COTSLicenseInfoPtr> __declspec(dllexport) COTSLicenseInfoList;
  54. }