# bdm::UI Class Reference

This class serves to load and/or save DOMElements into/from files stored on a hard-disk. More...

`#include <user_info.h>`

List of all members.

## Classes
class | Link_Expander
class | Mapped_UI
## Static Public Member Functions
static void | ui_error (string message, const Setting &element)
template<class T >
static T * | build (const Setting &element, const int index)
| Prototype of a UI builder. Return value is by the second argument since it type checking via `dynamic_cast`.
template<class T >
static T * | build (const Setting &element, const string &name)
template<class T >
static bool | get (T &instance, const Setting &element, const string &name)
| This methods tries to build a new double matrix.
template<class T >
static bool | get (T &instance, const Setting &element, const int index)
| This methods tries to build a new double matrix.
template<class T >
static bool | get (Array< T > &array_to_load, const Setting &element, const string &name)
| This methods tries to build a new double matrix.
template<class T >
static bool | get (Array< T > &array_to_load, const Setting &element, const int index)
| This methods tries to build a new double matrix.
template<class T >
static void | save (const T *const instance, Setting &element, const string &name="")
template<class T >
static void | save (const Array< T > &array_to_save, Setting &element, const string &name="")
| This methods tries to save a double vec.
static void | save (const mat &matrix, Setting &element, const string &name="")
| This methods tries to save a double matrix.
static void | save (const ivec &vec, Setting &element, const string &name="")
| This methods tries to save a double vec.
## Protected Member Functions
| UI (const string &class_name, const type_info *const class_type_info)
| default constructor
virtual | ~UI ()
| Virtual destructor for future use;.

## Detailed Description

This class serves to load and/or save DOMElements into/from files stored on a hard-disk.

Firstly, you associate new RootElement instance with some filename during a time of its construtcion. Then, you save some object into the new RootElement instance, and save it into the file this way:

            CAudi audi;
            RootElement root("cars.xml");
            UserInfo::save( audi, root, "TT");
            root.save();

In the other way round, when loading object from a XML file, the appropriate code looks like this:

            RootElement root("cars.xml");
            root.load();
            UserInfo::build<T>(root,"TT");

UserInfo is an abstract is for internal purposes only. Use CompoundUserInfo<T> or Particular_UI<T> instead. The raison d'etre of this class is to allow pointers to its templated descendants.Also, the main functions of the whole UserInfo library are included within this class, see static methods 'build' and 'save'.

/*!Builds computational object from a UserInfo structureReturn value is a pointer to the created object (memory management issue?) /

## Member Function Documentation

template<class T >

static T* bdm::UI::build | ( | const Setting & | element,
|  | const int | index |
| ) |  |  | `[inline, static]`

Prototype of a UI builder. Return value is by the second argument since it type checking via `dynamic_cast`.

This methods tries to build a new instance of type T (or some of its descendant types) according to a data stored in a DOMNode named class_name within a child nodes of the passed element. If an ui_error occurs, it returns a NULL pointer.

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

- user_info.h
- user_info.cpp