Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Object Class Reference

#include <object.hpp>

Inheritance diagram for Object:

Inheritance graph
[legend]

Public Member Functions

 Object (void)
 Object (const Object &aObject)
virtual ~Object (void)
 Common virtual destructor.

Protected Attributes

int myId

Static Private Attributes

static int objectCount
static int objectId
static int objectPeak

Detailed Description

A base class for nearly every class in this project.
Date:
Sun Jan 09 2005
Author:
Jan Wedekind (wedesoft@users.sourceforge.net)

Definition at line 30 of file object.hpp.


Constructor & Destructor Documentation

Object::Object ( void   ) 

Standard constructor. The allocated object is counted. If the PRINTALLOC is defined, a comment will be printed out. If NDEBUG is not defined, the objects identity myId will be defined.

See also:
objectCount

myId

Definition at line 28 of file object.cpp.

References myId, objectCount, objectId, and objectPeak.

00029 {
00030   assert( objectCount >= 0 );
00031   if ( !objectCount )
00032     cerr << "There are objects existing by now.\n";
00033   myId = objectId;
00034 #ifdef PRINTALLOC
00035   cerr.form( "object %8d is allocated\n", myId );
00036 #endif
00037   objectCount++;
00038   objectId++;
00039   if ( objectPeak < objectCount )
00040     objectPeak = objectCount;
00041 }

Object::Object ( const Object aObject  ) 

Copy constructor. The allocated objects are counted. If the macro PRINTALLOC is defined, a comment will be printed out.

Definition at line 46 of file object.cpp.

References myId.

00048 {
00049   assert( objectCount > 0 );// one object must exist already!
00050   myId = objectId;
00051 #ifdef PRINTALLOC
00052   cerr.form( "object %8d is allocated (copy from %8d)\n", myId, aObject.myId );
00053 #endif
00054   objectCount++;
00055   objectId++;
00056   if ( objectPeak < objectCount )
00057     objectPeak = objectCount;
00058 }

Object::~Object ( void   )  [virtual]

Common virtual destructor.

Definition at line 60 of file object.cpp.

References myId, objectCount, objectId, and objectPeak.

00061 {
00062 #ifdef PRINTALLOC
00063   cerr.form( "object %8d is disposed\n", myId );
00064 #endif
00065   assert( myId >= 0 );
00066   myId = -1;
00067   objectCount--;
00068   if ( !objectCount ) {
00069     cerr << "There are no objects existing by now." << endl
00070          << "Number of object-allocations:" << objectId << endl
00071          << "Peak number of allocations:" << objectPeak << endl;
00072   };
00073   assert( objectCount >= 0 );
00074 }


Field Documentation

int Object::myId [protected]

Definition at line 55 of file object.hpp.

Referenced by Object(), and ~Object().

int Object::objectCount [static, private]

Definition at line 58 of file object.hpp.

Referenced by Object(), and ~Object().

int Object::objectId [static, private]

Definition at line 60 of file object.hpp.

Referenced by Object(), and ~Object().

int Object::objectPeak [static, private]

Definition at line 62 of file object.hpp.

Referenced by Object(), and ~Object().


The documentation for this class was generated from the following files:

anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Wed Sep 26 01:40:29 2007 - GNU Free Documentation License