Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5 KiB

  1. // StructureWrappers.h: interface for the CStructureWrappers class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_STRUCTUREWRAPPERS_H__138A24E0_ED34_11D2_804A_009027345EE2__INCLUDED_)
  5. #define AFX_STRUCTUREWRAPPERS_H__138A24E0_ED34_11D2_804A_009027345EE2__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CPersistor;
  10. class CEventTraceProperties;
  11. // Need to be declared before seen in class. Well, duh!
  12. t_ostream& operator<<
  13. (t_ostream &ros,const CEventTraceProperties &r);
  14. t_istream& operator>>
  15. (t_istream &ris,CEventTraceProperties &r);
  16. // The general methodology used here may seem clunky to
  17. // a C programmer.
  18. // If you want to serialize an existing
  19. // EVENT_TRACE_PROPERTIES instance use the Constructor
  20. // "CEventTraceProperties(PEVENT_TRACE_PROPERTIES pProps)"
  21. // to create a CEventTraceProperties instance, call
  22. // Persist, and then destroy the CEventTraceProperties
  23. // instance.
  24. // If you want to de-deserialize an instance call the
  25. // Constructor "CEventTraceProperties()", call Persist,
  26. // call GetEventTracePropertiesInstance, then destroy the
  27. // CEventTraceProperties instance.
  28. // The copy constructor and assignment operators are included
  29. // only for completeness and it is anticipated that they
  30. // will not be used.
  31. // Using Persist for de-serialization assumes you have a valid
  32. // stream which contains a serialized instance.
  33. class CEventTraceProperties
  34. {
  35. private:
  36. friend t_ostream& operator<<
  37. (t_ostream &ros,const CEventTraceProperties &r);
  38. friend t_istream& operator>>
  39. (t_istream &ris,CEventTraceProperties &r);
  40. friend class CPersistor;
  41. public:
  42. CEventTraceProperties();
  43. // This constructor creates a new EVENT_TRACE_PROPERTIES
  44. // instance.
  45. CEventTraceProperties(PEVENT_TRACE_PROPERTIES pProps);
  46. virtual ~CEventTraceProperties();
  47. CEventTraceProperties(CEventTraceProperties &rhs);
  48. CEventTraceProperties &CEventTraceProperties::operator=
  49. (CEventTraceProperties &rhs);
  50. virtual HRESULT Persist (CPersistor &rPersistor);
  51. bool DeSerializationOK() {return m_bDeSerializationOK;}
  52. // Constructs an new EVENT_TRACE_PROPERTIES instance and
  53. // returns it.
  54. PEVENT_TRACE_PROPERTIES GetEventTracePropertiesInstance();
  55. bool IsNULL() {return m_bIsNULL;}
  56. protected:
  57. bool m_bDeSerializationOK;
  58. bool m_bIsNULL;
  59. void Initialize(PEVENT_TRACE_PROPERTIES pProps);
  60. void InitializeMemberVar(TCHAR *ptszValue, int nVar);
  61. void *m_pVarArray[19];
  62. PEVENT_TRACE_PROPERTIES m_pProps;
  63. };
  64. #endif // !defined(AFX_STRUCTUREWRAPPERS_H__138A24E0_ED34_11D2_804A_009027345EE2__INCLUDED_)