fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <boost/make_shared.hpp>
  5. #include <boost/optional.hpp>
  6. using namespace std; // consider removing this line in serious projects
  7.  
  8. typedef unsigned char uint8_t;
  9.  
  10. struct EVENT
  11. {
  12.  
  13. enum EProcedureResult : uint8_t
  14. {
  15. EProcedureResult_Failed = 0,
  16. EProcedureResult_Succeeded = 1
  17. };
  18.  
  19.  
  20. enum EErrorCode : uint8_t
  21. {
  22. EErrorCode_NA = 1,
  23. EErrorCode_Unspecified = 2,
  24. EErrorCode_NoPrivileges = 3,
  25. EErrorCode_QuotaLimit = 4,
  26. EErrorCode_SystemLimit = 5,
  27. EErrorCode_SystemFailure = 6,
  28. EErrorCode_NotPossible = 7,
  29. EErrorCode_DoesNotExist = 8,
  30. EErrorCode_NotAvailable = 9,
  31. EErrorCode_InvalidParameters = 10,
  32. EErrorCode_WrongCredentials = 11,
  33. EErrorCode_NotReachable = 12,
  34. EErrorCode_MaxLoginAttemptsExceeded = 13
  35. };
  36.  
  37.  
  38.  
  39. struct ChangedObjectDetails
  40. {
  41. boost::optional<std::string> targetDN;
  42. boost::optional<std::string> parameterName;
  43. boost::optional<std::string> parameterValue;
  44. boost::optional<bool> isDeleted;
  45. ChangedObjectDetails();
  46. ~ChangedObjectDetails();
  47. ChangedObjectDetails(const ChangedObjectDetails&);
  48. ChangedObjectDetails& operator=(const ChangedObjectDetails&);
  49. ChangedObjectDetails(
  50. const boost::optional<std::string>& targetDN,
  51. const boost::optional<std::string>& parameterName,
  52. const boost::optional<std::string>& parameterValue,
  53. const boost::optional<bool>& isDeleted
  54. );
  55. };
  56.  
  57.  
  58. std::string procedureStartDate;
  59. std::string procedureFinishDate;
  60. std::string sessionId;
  61. std::string sessionTime;
  62. std::string clientIpAddress;
  63. std::string userName;
  64. std::string operation;
  65. std::string additionalText;
  66. std::vector<ChangedObjectDetails> changedObjectDetails;
  67. boost::optional<EErrorCode> errorCode;
  68. EProcedureResult procedureResult;
  69. EVENT();
  70. ~EVENT();
  71. EVENT(const EVENT&);
  72. EVENT& operator=(const EVENT&);
  73. EVENT(
  74. const std::vector<EVENT::ChangedObjectDetails>& changedObjectDetails,
  75. const std::string& procedureStartDate,
  76. const std::string& procedureFinishDate,
  77. const std::string& sessionId,
  78. const std::string& sessionTime,
  79. const std::string& clientIpAddress,
  80. const std::string& userName,
  81. const std::string& operation,
  82. const EVENT::EProcedureResult procedureResult,
  83. const std::string& additionalText,
  84. const boost::optional<EVENT::EErrorCode>& errorCode
  85. );
  86. };
  87.  
  88. int main()
  89. {
  90. int a = sizeof(EVENT);
  91. std::cout << "ym a: " << a << std::endl;
  92.  
  93. return 0;
  94. }
Success #stdin #stdout 0.01s 5408KB
stdin
1
2
10
42
11
stdout
ym a: 288