Listing 1 A pattern file, which serves as a template for code generation

// [CLASS] Definition
//////////////////////////////////////////////////////
#if !defined([CLASS]_HPP)
#define [CLASS]_HPP
#if !defined(RC_INVOKED)    // no Windows RC compiler
#[ NewHandler = 1
#include <mem.h>
#]

class [CLASS] {
public:
   [CLASS]();
#[ CCAO = 0
   [CLASS](const [CLASS]&);
   [CLASS]& operator=(const [CLASS]&);
#]
#[ VirtDest = 1
   virtual ~[CLASS]();
#]
#[ VirtDest =0
   ~[CLASS]();
#]
#[ CountInst = 1
   static unsigned long HowMany();
#]
#[ NewHandler = 1
   void * operator new(size_t size);
#]

protected:
#[ VirtDest = 1
   virtual void invariant();
#]
#[ VirtDest = 0
   void invariant();
#]

private:
#[ CCAO = 2
   [CLASS](const [CLASS]&);
   [CLASS]& operator=(const [CLASS]&);
#]
   void _commonCtorJob();            // called from all ctors
#[ CountInst = 1
   static unsigned long _HowMany;
#]
#[ NewHandler = 1

   static void NoMemory();
#]
#[ CRC = 1
#if !defined(NDEBUG)
   unsigned short _crcVal;
   unsigned short _crc();
   void _setCRC() {_crcVal = 0; _crcVal = _crc(); }
#else
   void _setCRC() {}
#endif
#]
};
#endif
#endif
// End of File