Main Page   Class Hierarchy   Compound List   Header Files   Compound Members  

BGType Class Reference

Superclass of all 'comparable' types (strings, integers, etc.). More...

#include <bgobject.h>

Class diagram for BGType:

BGObject BGOctet BGNumber BGString

List of all members.


Public Members

virtual int compare ( BGObject &obj ) = 0
Compares two objects (derived from bgobject). More...

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


Detailed Description

Superclass of all 'comparable' types (strings, integers, etc.).

We've defined compare method here, which will implicitely called from equals, because types often has more information than equals (i.e. numbers can be greater than...). With the help of this comparable behaviour, we can SORT all subclasses of BGType easily.


Member Function Documentation

virtual int BGType::compare (BGObject & obj) [pure virtual]

Compares two objects (derived from bgobject).

This method is pure virtual and must be overwritten in subclasses.

Parameters:
obj   Object reference to compare with us
Returns:
0=Equal <0=objIsLess >0=objIsGreater TODO: Discuss !

Reimplemented in BGString.

bool BGType::equals (BGObject & obj) [inline, 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 from BGObject.


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