PhmsRequestHead.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "PhmsRequestBody.h"
  3. #include <string>
  4. using namespace std;
  5. enum EnumPhmsRequestMessageFormat{
  6. WRONG_PHMS_REQUEST_MESSAGE_FORMAT=-1,
  7. NO_PHMS_REQUEST_BODY,
  8. HAVE_PHMS_REQUEST_BODY
  9. };
  10. class CPhmsRequestHead
  11. {
  12. public:
  13. CPhmsRequestHead(void);
  14. CPhmsRequestHead(string version, string operationCode, string sessionId, string messageFormat);
  15. CPhmsRequestHead(CPhmsRequestHead& phmsRequestHead);
  16. CPhmsRequestHead& operator=(CPhmsRequestHead& phmsRequestHead);
  17. ~CPhmsRequestHead(void);
  18. //Getter
  19. string GetSign();
  20. string GetVersion();
  21. string GetOperationCode();
  22. string GetSessionId();
  23. string GetMessageFormat();
  24. //Setter
  25. void SetSign(string sign);
  26. void SetVersion(string version);
  27. void SetOperationCode(string operationCode);
  28. void SetSessionId(string sessionId);
  29. void SetMessageFormat(string messageFormat);
  30. string ToString();
  31. static int GetHeadLength();
  32. bool ValidatePhmsRequestHead();
  33. bool HavePhmsBody();
  34. EnumPhmsRequestMessageFormat GetPhmsRequestMessageFormat();
  35. private:
  36. string m_sign;
  37. string m_version;
  38. string m_operationCode;
  39. string m_sessionId;
  40. string m_messageFormat;
  41. //EnumHeadStringLength enumHeadStringLength;
  42. enum EnumPhmsRequestHeadStringLength
  43. {
  44. SIGN_LENGTH=32,
  45. VERSION_LENGTH=2,
  46. OPERATION_LENGTH=4,
  47. SESSIONID_LENGTH=32,
  48. MESSAGEFORMAT_LENGTH=2,
  49. TOTAL_HEAD_LENGTH=72
  50. };
  51. };