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.

87 lines
2.7 KiB

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