- Main Page
- Classes
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# TXmlObject Class Reference

Base class for all object, which can be serialized/deserialized. More...

`#include <txmlobject.h>`

Inheritance diagram for TXmlObject:

List of all members.

## Public Member Functions

const char * | getType () const
| Return type of class.
bool | hasParent (const char *className) const
| Check if class is inherited from class named className.
TiXmlElement & | serialize () const
| Serialization. Create XML element from object instance.

## Static Public Member Functions

static TXmlObject * | getXmlObject (const TiXmlElement &element)
| Deserialization. Create new TXmlObject from XML element.
static const char * | getClassUid (const string &name)
| Translate class name to pointer, required to pointer comparation.
static void | registerClass (const char *className, t_xml_factory method)
| Enregister factory for creating instances of specific class.
static void | registerAll ()
| Enregister all classes, which can perform serialization/deserialization.

## Detailed Description

Base class for all object, which can be serialized/deserialized.

Date:
  01-13-2006

Author:
  Ondrej Svejdar

Todo:

Bug:

## Member Function Documentation

const char * TXmlObject::getClassUid | ( | const string & | name | ) | `[static]`

| Translate class name to pointer, required to pointer comparation.

Note:
  This works only on classes enregistred by registerClass method

Parameters:

  | name | class name

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

| Return type of class.

Returns:
  type of class

Reimplemented from TObject.

Reimplemented in TkPhoto, TkButton, TkCheckButton, TkEntry, TkFrame, TkGridConstraints, TkGridLayout, TkLabel, TkLayout, TkListbox, TkMenu, TkPlaceConstraints, TkPlaceLayout, TkRadioButton, TkScrollBar, TkSpinBox, TkText, TkTopLevel, TclBoolVar, TclDoubleVar, TclIntVar, TclListVar, TclStringVar, and TclVar.

TXmlObject * TXmlObject::getXmlObject | ( | const TiXmlElement & | element | ) | `[static]`

| Deserialization. Create new TXmlObject from XML element.

Parameters:

  | element | XML element

Returns:
  new instance of TXmlObject

bool TXmlObject::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 from TObject.

void TXmlObject::registerClass | ( | const char * | className,
|  | t_xml_factory | method
| ) | `[static]`

| Enregister factory for creating instances of specific class.

Parameters:

  | className | name of class
  | method | pointer to factory method

TiXmlElement& TXmlObject::serialize | ( |  | ) | const`[inline]`

| Serialization. Create XML element from object instance.

Returns:
  XML element

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

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