xplConfigItem Class Reference

#include <xplConfigItem.h>

Inherits xplMsgItem.

List of all members.


Detailed Description

Represents a variable whose value can be edited in xPLHal.

A config item is used to reflect the value of a variable so that it may be changed by the user in xPLHal. A good example is a com port index. It is impossible for an application to reliably detect which com port a piece of hardware is attached to, so it becomes necessary to let the user set the value. By exposing the com port index via an xplConfigItem, this becomes possible.

Once an xplConfigItem has been created, its default value (or values - the item can be an array) must be set through calls to AddValue. The xplConfigItem is then added to the xplDevice by calling xplDevice::AddConfigItem. Once an xplConfigItem has been added to the xplDevice, it will automatically be presented to the user in xPLHal. Its value will also be saved to the registry or config file (depending on how the xplDevice was defined), and it will be restored when the application is next started.


Public Member Functions

 xplConfigItem (string const &_name, string const &_type, unsigned int const _maxValues=1)
 Constructor.
 ~xplConfigItem ()
 Destructor.
virtual bool AddValue (string const &_value)
 Adds a value to this config item.
string const & GetType () const
 Gets the configuration type for this item.
unsigned int const GetMaxValues () const
 Gets the maximum number of values that can be stored in this item.
string const & GetName () const
 Gets the name of this item.
uint32 const GetNumValues () const
 Gets the number of values stored in this item.
string const GetValue (const uint32 _index=0) const
 Gets specific value.
virtual bool AddValue (string const &_value, char const _delimiter= ',')
 Adds a value to this item.
bool SetValue (string const &_value, const uint32 _index=0)
 Changes a specific value.
void ClearValues ()
 Removes all the values stored in this item.


Generated on Sun Jan 21 14:30:23 2007 for xPL SDK by  doxygen 1.5.1-p1