Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SmartSockets::Option Class Reference

#include <toption.h>

List of all members.

Public Methods

 Option (T_OPTION opt) throw (OptionException)
 constructor compatible with the C API.

 Option (const char *name) throw (OptionException)
 constructor that looks up an option by name.
Parameters:
name  name of a previously created user option, or of a standard option.
Exceptions:
OptionException  if the name passed in doesn't match any options.


virtual ~Option () throw ()
 destructor.

bool getBool () const throw (OptionException)
 gets a bool property.

void setBool (bool value) throw (OptionException)
 sets a bool property.

const char * getEnum () const throw (OptionException)
 gets a enum property.

void setEnum (const char *value) throw (OptionException)
 sets a enum property.

T_STR_LIST getEnumList () const throw (OptionException)
 gets a enum list property.

void setEnumList (T_STR_LIST value) throw (OptionException)
 sets a enum list property.

real8 getReal8 () const throw (OptionException)
 gets a numeric property.

void setReal8 (real8 value) throw (OptionException)
 sets a numeric property.

int4 getInt4 () const throw (OptionException)
 gets a numeric property.

void setInt4 (int4 value) throw (OptionException)
 sets a numeric property.

const char * getString () const throw (OptionException)
 gets a string property.

void setString (const char *value) throw (OptionException)
 sets a string property.

T_STR_LIST getStringList () const throw (OptionException)
void setStringList (T_STR_LIST value) throw (OptionException)
 sets a string list property.

T_OPT_TYPE getType () const throw (OptionException)
bool isKnown () const throw (OptionException)
 ???is the property known?

void setUnKnown () throw (OptionException)
 ???sets whether the property is known?

bool getReadOnly () const throw (OptionException)
 is the property read only?

void setReadOnly (bool is_read_only) throw (OptionException)
 sets whether the property is read only.

bool getRequired () const throw (OptionException)
 Determines whether or not a property is required.

void setRequired (bool is_required) throw (OptionException)
 sets whether the property is required.

const char * getName () throw (OptionException)
 gets the name of the option.

void legValAdd (const char *value) throw (OptionException)
 Adds a legal value to enumerated option.

CallBack< OptionChangeCallBack > * optionChangeCbCreate (OptionChangeCallBack *impl, void *arg=NULL) throw (OptionException)
 creates an option change callback.


Static Public Methods

Option create (const char *name, T_OPT_TYPE optType) throw (OptionException)
void destroyOption (const char *name) throw (OptionException)
 destroys a property.


Static Protected Methods

void T_ENTRY1 optionChangeCbDelegator (T_OPTION, T_OPTION_CHANGE_CB_DATA, T_CB_ARG)
 delegator method called when callback is triggered.


Detailed Description

Implements all the TutOption methods.


Member Function Documentation

Option SmartSockets::Option::create const char *    name,
T_OPT_TYPE    optType
throw (OptionException) [static]
 

Creates a user-defined SmartSockets option. Matches a Call to TutOptionCreate().

Parameters:
name  option name
optType: 
  • T_OPT_TYPE_BOOLEAN
  • T_OPT_TYPE_ENUM
  • T_OPT_TYPE_NUMERIC
  • T_OPT_TYPE_STRING
  • T_OPT_TYPE_LIST_ENUM
  • T_OPT_TYPE_LIST_NUMERIC
  • T_OPT_TYPE_LIST_STRING
Exceptions:
OptionException  if option already exists

T_STR_LIST SmartSockets::Option::getStringList   const throw (OptionException)
 

Gets a string list property. The following example shows how to use the return value:
Option serverNames("server_names");
T_STR_LIST servNamesVal = serverNames.getStringList();
// Dump the string values
for (T_STR_LIST node = str_list_val;
node != NULL;
node = node->next)
{
TutOut("s
", node->string);
}

T_OPT_TYPE SmartSockets::Option::getType   const throw (OptionException)
 

Gets the type of a property.

Returns:
(one of T_OPT_TYPE_BOOLEAN,T_OPT_TYPE_ENUM,T_OPT_TYPE_NUMERIC T_OPT_TYPE_STRING,T_OPT_TYPE_LIST_ENUM,T_OPT_TYPE_LIST_NUMERIC, T_OPT_TYPE_LIST_STRING)


The documentation for this class was generated from the following file:
Generated on Fri Jul 14 15:05:55 2006 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001