ConfigTree Class Reference

#include <ConfigTree.h>

Inheritance diagram for ConfigTree:

Inheritance graph
[legend]

List of all members.

Public Types

enum  PropertyType { visible, hidden, other }

Public Member Functions

virtual ~ConfigTree ()
virtual void flush ()=0
virtual string getRootPath () const =0
virtual boost::shared_ptr
< ConfigNode
open (const string &path, PropertyType type, const string &otherId=string(""))=0
virtual list< string > getChildren (const string &path)=0


Detailed Description

This class organizes the access to config nodes in a tree. Nodes are identified by a relative path name, using a slash / as separator between levels. Each node can have user-visible and hidden properties. The two sets might be stored in the same ConfigNode, i.e. properties should have unique names per node. For each path there's also a second, separate namespace of key/value pairs. The intented use for that is saving state by sync sources close to, but without interfering with their configuration and the state maintained by the client library itself.

A ConfigNode can list all its properties while the tree lists nodes at a specific level and creates nodes.

This model is similar to the Funambol C++ DeviceManagementTree. Besides being implemented differently, it also provides additional functionality:

Definition at line 61 of file ConfigTree.h.


Member Enumeration Documentation

Selects which node attached to a path name is to be used. This is similar in concept to multiple data forks in a file.

Enumerator:
visible  visible configuration properties
hidden  hidden read/write properties
other  additional node selected via otherID

Definition at line 76 of file ConfigTree.h.


Constructor & Destructor Documentation

virtual ConfigTree::~ConfigTree (  )  [inline, virtual]

frees all resources *without* flushing changed nodes

Definition at line 64 of file ConfigTree.h.


Member Function Documentation

virtual void ConfigTree::flush (  )  [pure virtual]

ensure that all changes are saved persistently

Implemented in FileConfigTree, and VolatileConfigTree.

virtual list<string> ConfigTree::getChildren ( const string &  path  )  [pure virtual]

returns names of all existing nodes beneath the given path

Implemented in FileConfigTree.

virtual string ConfigTree::getRootPath (  )  const [pure virtual]

a string identifying the root of the configuration - exact meaning varies

Implemented in FileConfigTree.

virtual boost::shared_ptr<ConfigNode> ConfigTree::open ( const string &  path,
PropertyType  type,
const string &  otherId = string("") 
) [pure virtual]

Open the specified node. Opening it multiple times will return the same instance, so the content is always synchronized.

Parameters:
path a relative path with / as separator
type selects which fork of that path is to be opened (visible, hidden, change tracking)
otherId an additional string to be attached to the other node's name (allows having multiple different such nodes); an empty string is allowed

Implemented in FileConfigTree.


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

Generated on Sat Oct 18 17:17:03 2008 for SyncEvolution and Funambol by  doxygen 1.5.7.1