Main Page   Class Hierarchy   Compound List   Header Files   Compound Members  

BGObject Class Reference

Generic abstract superclass of all. More...

#include <bgobject.h>

Class diagram for BGObject:

BGType BGSocket BGServerSocket BGInetAddress BGOctet BGNumber BGString

List of all members.


Public Members

long cid ( )
Returns unique class identifier. More...

virtual BGString toString ( ) = 0
Generates string representation of this object. More...

virtual unsigned long hash ( ) = 0
Generates a 'unique' hashvalue of this object. More...

virtual bool equals ( BGObject &obj ) = 0
Returns true, if specified object is equal to own instance. More...

virtual BGString className ( ) = 0
Return the class name for this class. More...


Detailed Description

Generic abstract superclass of all.

Some useful methods are defined here, which are implemented in all derived classes (i.e. toString for debugging purposes). Very cool is the cid() method which returns a unique long value for each class. Use that before casting to specific type. The equals method is responsible for comparision between two instances. Hash() will return a pseudo unique long value.


Member Function Documentation

long BGObject::cid ()

Returns unique class identifier.

Returns:
unique class identifier

virtual BGString BGObject::toString () [pure virtual]

Generates string representation of this object.

This is useful for logging, etc. - This method will replace dump !

Returns:
Stringrepresentation of this object

Reimplemented in BGArray, BGInetAddress, BGServerSocket, BGSocket, and BGString.

virtual unsigned long BGObject::hash () [pure virtual]

Generates a 'unique' hashvalue of this object.

Note: The returned pointer will point to class buffer. Therefore do not delete it, dupe it if you need it outside of instance lifecycle.

Returns:
Hash of this object

Reimplemented in BGArray, BGInetAddress, BGServerSocket, BGSocket, and BGString.

virtual bool BGObject::equals (BGObject & obj) [pure virtual]

Returns true, if specified object is equal to own instance.

First we compare class identifier. If both object has same class type, we dispatch to compare method, which should always be able to compare instances with same type.

Parameters:
obj   Object reference to compare with us
Returns:
True, if object is equal to own instance

Reimplemented in BGArray, BGInetAddress, BGServerSocket, BGSocket, and BGType.

virtual BGString BGObject::className () [pure virtual]

Return the class name for this class.

Subclasses should overwrite this method to return their own name.

Reimplemented in BGArray, BGInetAddress, BGServerSocket, BGSocket, and BGString.


The documentation for this class was generated from the following file:
Generated at Fri Feb 18 10:57:06 2000 for bgclass by doxygen 0.49-991205 written by Dimitri van Heesch, © 1997-1999