visObject Class Reference

[VisAPI Index] [VisAPI Hierarchy]


Base class for all objects in the VisApi. More...

#include <VisApi/platform.h>

Public Members

Protected Members

Private Members


Detailed Description

Specifies the basic functionality of objects in the VisApi: A reference counter to be able to provide cleaner interfaces in cases where instances of objects are returned. Allocation/Deallocation specification - an extension to the simple construction, destruction scheme where objects can be instanciated without being initialized (allocated).


virtual bool instanceOf(visClassId id)

virtual bool instanceOf(visClassId id) { if (id == Id) return true; return ::instanceOf(id); }

 visObject()

Constructor sets reference count to one and allocated to false.

virtual ~visObject()

Destructor.

virtual bool allocate()

Allocate object. Parameters may be added in sub classes.

virtual void deallocate()

Deallocate object and free resources. Is internally called by the destructor and reallocations.

virtual inline bool isAllocated()

Returns true if object is allocated with the allocate() method.

void operator delete(void *theObject)

Overloading of the operator delete. On some systems this might make trouble when using with const pointers so you should prefer the decRef() method.

virtual unsigned int getNumberOfRefs()

Return number of references to this object. Initial value at construction time is one. If this values becomes zero then this object deletes itself.

virtual void incRef()

Increment number of refences by one.

virtual void decRef()

Decrement number of refences by one. If this values becomes zero then this object deletes itself.

virtual inline void hasChanged()

Call this method to sign a substancial change in this object. If you do so then properly document this behavour in all methods and conditions that cause this change. Also think of adding new methods to handle changes. E.g. if members of an array change then you could add methods like isModified() in the public declaration or a change of a window size could result in a new method like isChangedWindowSize() etc.

unsigned int myRefCount

Number of references.

bool myIsAllocated

True if allocated.


  • Author: Peter Breitling Peter Breitling
  • Version: 05-11-98 03-17-98
  • Documentation generated by breitlip@atzenger10 on Mon Jan 17 19:29:23 CET 2000
Kdoc