Counter Strike : Global Offensive Source Code
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.

72 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: CValObject is used for tracking individual objects that report
  4. // in to CValidator. Whenever a new object reports in (via CValidator::Push),
  5. // we create a new CValObject to aggregate stats for it.
  6. //
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef VALOBJECT_H
  10. #define VALOBJECT_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #ifdef DBGFLAG_VALIDATE
  15. class CValObject
  16. {
  17. public:
  18. // Constructors & destructors
  19. CValObject( void ) { };
  20. ~CValObject( void );
  21. void Init( tchar *pchType, void *pvObj, tchar *pchName, CValObject *pValObjectParent,
  22. CValObject *pValObjectPrev );
  23. // Our object has claimed ownership of a memory block
  24. void ClaimMemoryBlock( void *pvMem );
  25. // A child of ours has claimed ownership of a memory block
  26. void ClaimChildMemoryBlock( int cubUser );
  27. // Accessors
  28. tchar *PchType( void ) { return m_rgchType; };
  29. void *PvObj( void ) { return m_pvObj; };
  30. tchar *PchName( void ) { return m_rgchName; };
  31. CValObject *PValObjectParent( void ) { return m_pValObjectParent; };
  32. int NLevel( void ) { return m_nLevel; };
  33. CValObject *PValObjectNext( void ) { return m_pValObjectNext; };
  34. int CpubMemSelf( void ) { return m_cpubMemSelf; };
  35. int CubMemSelf( void ) { return m_cubMemSelf; };
  36. int CpubMemTree( void ) { return m_cpubMemTree; };
  37. int CubMemTree( void ) { return m_cubMemTree; };
  38. int NUser( void ) { return m_nUser; };
  39. void SetNUser( int nUser ) { m_nUser = nUser; };
  40. void SetBNewSinceSnapshot( bool bNewSinceSnapshot ) { m_bNewSinceSnapshot = bNewSinceSnapshot; }
  41. bool BNewSinceSnapshot( void ) { return m_bNewSinceSnapshot; }
  42. private:
  43. bool m_bNewSinceSnapshot; // If this block is new since the snapshot.
  44. tchar m_rgchType[64]; // Type of the object we represent
  45. tchar m_rgchName[64]; // Name of this particular object
  46. void *m_pvObj; // Pointer to the object we represent
  47. CValObject *m_pValObjectParent; // Our parent object in the tree.
  48. int m_nLevel; // Our depth in the tree
  49. CValObject *m_pValObjectNext; // Next ValObject in the linked list
  50. int m_cpubMemSelf; // # of memory blocks we own directly
  51. int m_cubMemSelf; // Total size of the memory blocks we own directly
  52. int m_cpubMemTree; // # of memory blocks owned by us and our children
  53. int m_cubMemTree; // Total size of the memory blocks owned by us and our children
  54. int m_nUser; // Field provided for use by our users
  55. };
  56. #endif // DBGFLAG_VALIDATE
  57. #endif // VALOBJECT_H