Listing 1: AppWatchMan.h

// Declarations for the Application Watch Man Class

#if !defined(APPWATCHMAN_H_INCLUDED)
#define APPWATCHMAN_H_INCLUDED

class AppWatchMan
{
  public:

  typedef enum
  {
    CHECK_HEAP       = 0x01,
    TAKE_SNAPSHOT    = 0x02,
    DUMP_SNAPSHOT    = 0x04,
    COMP_TO_PREV     = 0x08,
    COMP_TO_START    = 0x10,
    LEAKS_FROM_PREV  = 0x20,
    LEAKS_FROM_START = 0x40,

    // Composite Definitions for Scenarios
    BEGIN_CONF_CHECK   = ( CHECK_HEAP    |
                           TAKE_SNAPSHOT |
                           DUMP_SNAPSHOT ),
    END_CONF_CHECK     = ( CHECK_HEAP    |
                           TAKE_SNAPSHOT |
                           DUMP_SNAPSHOT |
                           LEAKS_FROM_START ),
    BEGIN_LEAK_TEST    = ( TAKE_SNAPSHOT | DUMP_SNAPSHOT ),
    END_LEAK_TEST      = ( TAKE_SNAPSHOT | LEAKS_FROM_PREV |
                                           DUMP_SNAPSHOT),
    BEGIN_PROFILE_TEST = ( TAKE_SNAPSHOT | DUMP_SNAPSHOT ),
    END_PROFILE_TEST   = ( TAKE_SNAPSHOT | 
                           DUMP_SNAPSHOT |
                           COMP_TO_PREV)
  } FLAGS;

  AppWatchMan();

  virtual ~AppWatchMan(void){};
  bool DoRounds(const char* szComment, FLAGS flags);

  private:

  static const bool m_bOnDuty; // always false for rel. cfg

  ostream_withassign* m_pStrLog;

  _CrtMemState    m_stFirst;
  _CrtMemState    m_stPrevious;
  _CrtMemState    m_stLast;
  _CrtMemState    m_stDiff;

  // Logging String Definitions Omitted

};
#endif  // !defined(APPWATCHMAN_H_INCLUDED)

— End of Listing —