- Main Page
- Classes
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# TObject Class Reference

Base class for all project classes. More...

`#include <tobject.h>`

Inheritance diagram for TObject:

List of all members.

## Public Member Functions

virtual const char * | getType () const
| Return type of class.
virtual bool | hasParent (const char *className) const
| Check if class is inherited from class named className.
virtual bool | compareTo (TObject *object) const
| Compare two objects.
virtual const string & | toString () const
| Simple text dump.
virtual TObject * | clone ()
| Create deep-clone of object.
bool | typeOf (const char *type) const
| Check if this instance is of type "type".
void | upcount () const
| Increase number of refences count. Do not call directly, use Ptr class instead.
void | downcount () const
| Decrease number of refences count. Do not call directly, use Ptr class instead.

## Detailed Description

Base class for all project classes.

Handles reference counting, type checking, provides virtual methods for cloning, comparing and text dump.

For valid type-checking should all subclasses declare static member type and override getType method like this :

     class MyClass:public TObject {
     public:
        static const char* type;
        const char* getType() const {
           return type;
        }
     };

     const char* MyClass::type="MyClass";

Date:
  01-13-2006

Author:
  Ondrej Svejdar

Todo:

Bug:

## Member Function Documentation

TObject * TObject::clone | ( |  | ) | `[virtual]`

| Create deep-clone of object.

Returns:
  deep-clone of object

Reimplemented in TkBase, TkButton, TkCheckButton, TkEntry, TkFrame, TkGridConstraints, TkLabel, TkListbox, TkMenu, TkPlaceConstraints, TkRadioButton, TkScrollBar, TkSpinBox, TkText, and TkTopLevel.

bool TObject::compareTo | ( | TObject * | object | ) | const`[virtual]`

| Compare two objects.

Note:
  If method is not overriden it throws ExceptionNoImplementation when called.

Parameters:

  | object | pointer to another object

Returns:
  true if object are equal

Reimplemented in TkBase.

void TObject::downcount | ( |  | ) | const`[inline]`

| Decrease number of refences count. Do not call directly, use Ptr class instead.

See also:
  Ptr

const char * TObject::getType | ( |  | ) | const`[virtual]`

| Return type of class.

Returns:
  type of class

Reimplemented in AppWindow, Designer, FrmList, Exception, ExceptionBase, ExceptionEval, ExceptionIO, ExceptionNoImplementation, ExceptionNullPtr, ExceptionType, Command, IModule, MesgVarChange, MesgCommand, MesgApplicationExit, ModuleManager, ModuleType, VarDef, VarBool, VarChar, VarInteger, VarDouble, VarString, TkPhoto, TkButton, TkCheckButton, TkEntry, TkFrame, TkGridConstraints, TkGridLayout, TkLabel, TkLayout, TkListbox, TkMenuSeparator, TkMenuCommand, TkMenu, TkPlaceConstraints, TkPlaceLayout, TkRadioButton, TkScrollBar, TkSpinBox, TkText, TkTopLevelListener, TkTopLevel, TclInterp, TclBoolVar, TclDoubleVar, TclIntVar, TclListVar, TclStringVar, TclVar, and TXmlObject.

bool TObject::hasParent | ( | const char * | className | ) | const`[virtual]`

| Check if class is inherited from class named className. We're using pointer comparation, so typicall usage should be like this :
     bool isInheritedFromMyClass=hasParent(MyClass::type)

Parameters:

  | className | pointer to type of class

Returns:
  true, if this instance is inherited from class named className

Reimplemented in TXmlObject.

const string & TObject::toString | ( |  | ) | const`[virtual]`

| Simple text dump.

Returns:
  if not overriden, it returns type of class

Reimplemented in VarInst, VarBool, VarChar, VarInteger, VarDouble, VarString, TkPhoto, TkBase, TkGridConstraints, TkPlaceConstraints, and TclVar.

bool TObject::typeOf | ( | const char * | type | ) | const`[inline]`

| Check if this instance is of type "type".

Note:
  we're using pointer comparation

Parameters:

  | type | pointer to type of class

Returns:
  true, if this instance is instance of class named type

void TObject::upcount | ( |  | ) | const`[inline]`

| Increase number of refences count. Do not call directly, use Ptr class instead.

See also:
  Ptr

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

- H:/projs/dotNET/eda/src/tobject.h
- H:/projs/dotNET/eda/src/tobject.cpp