idaeim studio
 PVL: Parameter Value Language

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | Friends
Parameter Class Reference

A Parameter is a general-purpose, abstract, named parameter entity. More...

#include <Parameter.hh>

Inheritance diagram for Parameter:
Inheritance graph
[legend]
Collaboration diagram for Parameter:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Integer Default_Value
 Default Value type for an Assignment.
enum  MODE {
  Verbatim_Strings,
  Indenting,
  TOTAL_LOCAL_MODES
}
 Mode selectors. More...
enum  MODE_STATE {
  MODE_FALSE = 0,
  MODE_TRUE = 1,
  MODE_INHERITED = 2
}
 States for local/inherited modes. More...
enum  Type {
  ASSIGNMENT = (Value::ARRAY << 1),
  TOKEN,
  AGGREGATE = (ASSIGNMENT << 1),
  GROUP,
  OBJECT,
  END = (AGGREGATE << 1),
  END_GROUP,
  END_OBJECT
}
 Type specifications. More...
enum  WHICH_MODE {
  LOCAL_MODE_SET = 0,
  DEFAULT_MODE_SET = 1,
  RECURSIVE_MODE_SET = 2
}
 Selects which mode set is applicable. More...

Public Member Functions

bool at_pathname (std::string pathname, bool case_sensitive, const Parameter *root=NULL) const
 Test if the Parameter is at an optionally case-insensitive pathname, possibly from a specific root Parameter.
bool at_pathname (std::string pathname) const
 Test if the Parameter is at a pathname from the top of the Parameter heirarchy.
bool at_pathname (std::string pathname, bool case_sensitive, const Parameter &root) const
 Test if the Parameter is at an optionally case-insensitive pathname from from a root Parameter.
virtual Parameterclone () const =0
 Creates a Parameter clone of the Parameter.
std::string comment () const
 Gets the Parameter comment.
Parametercomment (const std::string &comment)
 Sets the Parameter comment.
virtual int compare (const Parameter &parameter) const =0
 Compares this Parameter with another Parameter.
bool has_children () const
Parameterindenting (const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET)
 Enable or disable indenting.
Parameterindenting (const bool enable)
 Enable or disable indenting for this Parameter.
MODE_STATE indenting (const WHICH_MODE which=RECURSIVE_MODE_SET) const
 Test if indenting will be used.
virtual bool is (const Type type) const =0
 Test if the Parameter is of some Type.
virtual bool is_Aggregate () const
 Test if the Parameter is an Aggregate.
virtual bool is_Assignment () const
 Test if the Parameter is an Assignment.
virtual bool is_Group () const
 Test if the Parameter is a Group Aggregate.
virtual bool is_Object () const
 Test if the Parameter is an Object Aggregate.
virtual bool is_Token () const
 Test if the Parameter is a Token Assignment.
Parametermode_state (const MODE mode, const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET)
 Sets the state of a syntax mode.
const MODE_STATEmode_state (const WHICH_MODE which=LOCAL_MODE_SET) const
 Gets the array of syntax mode states.
MODE_STATE mode_state (const MODE mode, const WHICH_MODE which=RECURSIVE_MODE_SET) const
 Gets the state of a syntax mode.
Parametermode_state (const MODE_STATE *const modes, const WHICH_MODE which=LOCAL_MODE_SET)
 Sets the state of all syntax modes.
std::string name () const
 Gets the name of the Parameter.
Parametername (const std::string &name)
 Sets the Parameter's name.
bool operator!= (const Parameter &parameter) const
 Test if a Parameter is logically not equivalent to another Parameter.
bool operator< (const Parameter &parameter) const
 Test if this Parameter is logically less than another Parameter.
bool operator<= (const Parameter &parameter) const
 Test if a Parameter is logically less than or equal to another Parameter.
virtual Parameteroperator= (const Value &value)=0
 Assigns a Value to this Parameter.
virtual Parameteroperator= (const Parameter &parameter)=0
 Assigns the defining characteristics of another Parameter to this Parameter.
bool operator== (const Parameter &parameter) const
 Test if this Parameter is logically equivalent to another Parameter.
bool operator> (const Parameter &parameter) const
 Test if a Parameter is logically greater than another Parameter.
bool operator>= (const Parameter &parameter) const
 Test if a Parameter is logically greater than or equal to another Parameter.
virtual Parameteroperator[] (unsigned int index)
 Array notation accessor.
virtual const Parameteroperator[] (unsigned int index) const
 Array notation accessor.
 Parameter (const Parameter &parameter)
 Parameter copy constructor.
 Parameter (const std::string &name="")
 Constructs a Parameter base class.
Aggregateparent () const
 Gets the Parameter's parent.
std::string pathname (const Parameter *root=NULL) const
 Gets the fully qualified (absolute) pathname of the Parameter, optionally from some root Parameter.
std::string pathname (const Parameter &root) const
 Gets the fully qualified (absolute) pathname of the Parameter from some root Parameter.
std::string pathname_to (const Parameter *root=NULL) const
 Gets the pathname to the Parameter without the Parameter's name.
std::string pathname_to (const Parameter &root) const
 Gets the pathname to the Parameter without the Parameter's name.
std::ostream & print (std::ostream &out=std::cout) const
 Prints the Parameter on an output stream using PVL syntax.
virtual void read (std::istream &in=std::cin)=0
 Reads an input stream parsed as PVL syntax into this Parameter.
virtual void read (Parser &parser)=0
 Assigns the next Parameter from a Parser to this Parameter.
Aggregateroot () const
 Gets the root Aggregate enclosing this Parameter.
virtual Type type () const =0
 Gets the Parameter's Type specification.
virtual Parametertype (const int type)=0
 Sets the Parameter's Type specification.
virtual std::string type_name () const =0
 Gets the Parameter's Type specification name.
virtual Valuevalue () const =0
 Gets the Value of an Assignment.
MODE_STATE verbatim_strings (const WHICH_MODE which=RECURSIVE_MODE_SET) const
 Test if quoted strings will be written verbatim.
Parameterverbatim_strings (const bool enable)
 Enable or disable verbatim quoted strings for this Parameter.
Parameterverbatim_strings (const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET)
 Enable or disable verbatim quoted strings in PVL syntax.
unsigned int write (std::ostream &out=std::cout, int depth=0) const
 Writes the Parameter on an output stream using PVL syntax.
virtual ~Parameter ()
 Virtual destructor.

Static Public Member Functions

static bool case_sensitive ()
 Gets the default case sensitivity state.
static bool case_sensitive (bool enable)
 Sets the default case sensitivity state.
static char path_delimiter (const char delimiter)
 Sets the pathname delimiter.
static char path_delimiter ()
 Gets the current Path_Name delimiter.
static std::string type_name (const Type type)
 Gets name of a Type specification.

Static Public Attributes

static const bool DEFAULT_CASE_SENSITIVITY
 Default case sensitivity.
static const char DEFAULT_PATHNAME_DELIMITER
 Default pathname delimiter.
static const char *const ID
 Class identification name with source code version and date.

Protected Attributes

std::string Comment
 Comment string associated with the Parameter.
MODE_STATE Modes [TOTAL_LOCAL_MODES]
 Local mode states.
std::string Name
 The Parameter name.
AggregateParent
 The Parameter parent Aggregate (NULL if none).

Static Protected Attributes

static bool Case_Sensitive
 Default case sensitivity.
static MODE_STATE DEFAULT_MODES [TOTAL_LOCAL_MODES]
 Default mode states.
static char Path_Delimiter
 Delimter character for pathname components.

Friends

class Aggregate
class Assignment

Detailed Description

A Parameter is a general-purpose, abstract, named parameter entity.

Every Parameter has a name, which is a string of zero or more characters. A Parameter may also have a comment string associated with it that contains any descriptive text.

There are two types of Parameter implementations: an Assignment has a Value; an Aggregate is a list of Parameters. Because Parameters are typically grouped into Aggregate hierarchical structures, each Parameter contains a pointer to its parent Aggregate; Parameters that are not contained within an Aggregate have a NULL parent. Parameters in an Aggregate hierarchy may be referred to by their pathname - as in a filename directory hierachy - in either an absolute or relative manner. N.B.: The name of a Parameter need not be unique within an Aggregate list; as a result pathnames need not be unique either.

A Parser is used for interpreting the Parameter Value Language syntax text into Parameter objects. A Lister is used for generating Parameter Value Language syntax from Parameter objects. There are also syntax modes that may be set for each Parameter to control the operation of the Lister. These modes may be specific to the Parameter object or inherited from a parent Parameter or a static default setting.

See also:
Value
Parser
Lister
Author:
Bradford Castalia
Version:
1.52

Member Typedef Documentation

Default Value type for an Assignment.


Member Enumeration Documentation

enum Type

Type specifications.

There are two specific implementations of Parameter: Assignment and Aggregate. However, a Parameter can also be distinguished in the way it is represented with the PVL syntax. Since this distinction is not functional - in fact is a characteristic that can be readily changed - additional subclasses are not used. Instead, a Type code is provided and used as a "subtype" characteristic, in addition to offering a convenient means of identifying the general type (class) of a Parameter:

ASSIGNMENT
The fundamental Parameter containing a Value object. If an Assignment does not have an effective Value, it is a TOKEN. A token has a Default_Value which is usually ignored unless the Parameter is elevated to full Assignment status.
AGGREGATE
A Parameter that contains a list of zero or more Parameters. An Aggregate may have a GROUP or OBJECT Type specification; a distinction without a functional difference (but which may be useful to the application).
END
A special ephemeral token parameter that marks the end of an Aggregate Parameter list. The Type specifications END_GROUP and END_OBJECT are expected to be paired with a preceeding GROUP or OBJECT Aggregate, with the general END token marking the last Parameter in an input container (Parser::CONTAINER_NAME) Aggregate. These Type specifications are used by the Parser class during parsing of PVL syntax into Aggregate objects; they should not be needed otherwise.

Type specification codes are bit flags. These are organized such that the general Type bit is present for all specific members: A TOKEN contains the ASSIGNMENT bit, both GROUP and OBJECT contain the AGGREGATE bit, and both END_GROUP and END_OBJECT contain the END bit.

Note: Parameter Type codes are guaranteed to be distinct from Value Type codes: they occupy completely separate bit fields and can not be accidently confused.

Enumerator:
ASSIGNMENT 
TOKEN 
AGGREGATE 
GROUP 
OBJECT 
END 
END_GROUP 
END_OBJECT 
enum MODE

Mode selectors.

Enumerator:
Verbatim_Strings 
Indenting 
TOTAL_LOCAL_MODES 
enum MODE_STATE

States for local/inherited modes.

Enumerator:
MODE_FALSE 
MODE_TRUE 
MODE_INHERITED 
enum WHICH_MODE

Selects which mode set is applicable.

Enumerator:
LOCAL_MODE_SET 
DEFAULT_MODE_SET 
RECURSIVE_MODE_SET 

Constructor & Destructor Documentation

Parameter ( const std::string &  name = "") [explicit]

Constructs a Parameter base class.

The Parameter will have no parent and no comment.

Parameters:
nameThe name of the Parameter.
Parameter ( const Parameter parameter)

Parameter copy constructor.

The parent of the copied Parameter will not be inherited; i.e. the new Paramter will have no parent.

Parameters:
parameterThe Parameter to be copied.
virtual ~Parameter ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

virtual Parameter* clone ( ) const [pure virtual]

Creates a Parameter clone of the Parameter.

This method is required by the Aggregate Vectal.

Implemented in Assignment, and Aggregate.

std::string name ( ) const [inline]

Gets the name of the Parameter.

Returns:
The name of the Parameter.

References Parameter::Name.

Parameter& name ( const std::string &  name) [inline]

Sets the Parameter's name.

Parameters:
nameThe name string.
Returns:
This Parameter.

References Parameter::name().

Referenced by Parameter::name().

Aggregate* parent ( ) const [inline]

Gets the Parameter's parent.

Note: The parent of a Parameter should only be set by using a containing Aggregate's Vectal interface methods (for convenience, see the Aggregate's add and remove methods).

Returns:
A pointer to the parent Aggregate. This will be NULL if this Parameter has no parent.

References Parameter::Parent.

bool has_children ( ) const [inline]
Aggregate* root ( ) const

Gets the root Aggregate enclosing this Parameter.

Returns:
A pointer to the root parent Aggregate; i.e. the base of the parent hierarchy for this Parameter. This will be NULL if this Parameter has no parent.
std::string pathname ( const Parameter root = NULL) const

Gets the fully qualified (absolute) pathname of the Parameter, optionally from some root Parameter.

A Parameter pathname is the name of the Parameter preceeded by the current path_delimiter character. If this Parameter has a parent that is not the root Parameter then the delimiter is preceeded by the parent's pathname. This recursion produces a pathname that starts with the path_delimiter character and includes the names of each Parameter from, but not including, the root up to, and including, this Parameter, with each name separated by the path_delimiter character.

If no root Parameter is specified (or the root is NULL), the first segment of the pathname will be the name of the Parameter with no parent; this is an "absolute" pathname. N.B.: As a special case when no root is specified the Aggregate named Parser::CONTAINER_NAME (see Parser::get_parameters()) will qualify as the root. If a (non-NULL) root is found the pathname is relative to the specified root. If the root Parameter does not enclose this Parameter - i.e. the root is not in the path to this Parameter - an Invalid_Argument exception will be thrown.

Parameters:
rootA pointer to a pathname root Parameter.
Returns:
The pathname string for the Parameter.
Exceptions:
Invalid_ArgumentIf the root Parameter is not in the path of this Parameter.
std::string pathname ( const Parameter root) const [inline]

Gets the fully qualified (absolute) pathname of the Parameter from some root Parameter.

Parameters:
rootA parent of this Parameter.
Returns:
The pathname string for the Parameter.
Exceptions:
PVL::Invalid_ArgumentIf the root Parameter is not in the path of this Parameter.
See also:
pathname(Parameter*)

References Parameter::pathname().

Referenced by Parameter::pathname().

std::string pathname_to ( const Parameter root = NULL) const

Gets the pathname to the Parameter without the Parameter's name.

The trailing path_delimiter character is included.

Parameters:
rootA pointer to a parent of this Parameter. [Default: NULL; the top Parameter of the hierarchy]
Returns:
The pathname string up to, but not including, this Parameter's Name.
See also:
pathname(const Parameter*) const
std::string pathname_to ( const Parameter root) const [inline]

Gets the pathname to the Parameter without the Parameter's name.

Parameters:
rootA parent of this Parameter.
Returns:
The pathname string for the Parameter.
Exceptions:
Invalid_ArgumentIf the root Parameter is not in the path of this Parameter.
See also:
pathname_to(Parameter*)

References Parameter::pathname_to().

Referenced by Parameter::pathname_to().

bool at_pathname ( std::string  pathname,
bool  case_sensitive,
const Parameter root = NULL 
) const

Test if the Parameter is at an optionally case-insensitive pathname, possibly from a specific root Parameter.

The pathname string argument may be a full (absolute) or partial (relative) name of the form:

[/]Name[/Name[...]]

A pathname string beginning with a path_delimiter character is "absolute". In this case a Parameter will test true when the pathname from the specified root Parameter exists and matches the specified pathname using the case_sensitive criteria. Note: This is the only case in which the root argument is used; it provides the absolute anchor for the pathname argument.

A pathname string that does not begin with a path_delimiter character is "relative". In this case a Parameter will test true when the pathname string matches (again, using the case_sensitive criteria) an ending substring of the Parameter pathname that is also preceded by a path_delimiter character. The basic form of a relative pathname is a simple name that contains no path_delimiter character.

Parameters:
pathnameThe pathname string to be matched.
case_sensitivetrue if case sensitive string matching is to be applied; false otherwise.
rootA Parameter pointer for the root Parameter of of an absolute pathname. [Default: NULL; the top Parameter of the hierarchy]
Returns:
true if this Parameter is located at the pathname; false otherwise.
bool at_pathname ( std::string  pathname,
bool  case_sensitive,
const Parameter root 
) const [inline]

Test if the Parameter is at an optionally case-insensitive pathname from from a root Parameter.

Parameters:
pathnameThe pathname string to be matched.
case_sensitivetrue if case sensitive string matching is to be applied; false otherwise.
rootA root Parameter of of an absolute pathname.
Returns:
true if this Parameter is located at the pathname; false otherwise.
See also:
at_pathname(string, bool, Parameter*)

References Parameter::at_pathname().

Referenced by Parameter::at_pathname().

bool at_pathname ( std::string  pathname) const [inline]

Test if the Parameter is at a pathname from the top of the Parameter heirarchy.

The case sensitivity is determined by the current case_sensitive state.

Parameters:
pathnameThe pathname string to be matched.
Returns:
true if this Parameter is located at the pathname; false otherwise.
See also:
at_pathname(string, bool, Parameter*)

References Parameter::at_pathname().

Referenced by Parameter::at_pathname().

static char path_delimiter ( ) [inline, static]

Gets the current Path_Name delimiter.

Returns:
The delimiter char used for constructing pathnames.

References Parameter::Path_Delimiter.

static char path_delimiter ( const char  delimiter) [static]

Sets the pathname delimiter.

Note: The delimiter is a static class variable that applies to all Parameters.

Parameters:
delimiterThe delimiter char.
Returns:
The previous delimiter character.
static bool case_sensitive ( ) [inline, static]

Gets the default case sensitivity state.

Returns:
true, if the default state is case sensitive; false otherwise.
See also:
case_sensitive(bool)

References Parameter::Case_Sensitive.

static bool case_sensitive ( bool  enable) [static]

Sets the default case sensitivity state.

Parameters:
enabletrue, if the default state is case sensitive; false otherwise.
Returns:
The previous case sensitive state.
std::string comment ( ) const [inline]

Gets the Parameter comment.

Returns:
A string, possibly multi-line, containing an arbitrary comment associated with the Parameter.

References Parameter::Comment.

Parameter& comment ( const std::string &  comment) [inline]

Sets the Parameter comment.

Parameters:
commentA string used to provide any commentary about the Parameter.
Returns:
This Parameter.

References Parameter::comment().

Referenced by Parameter::comment().

virtual bool is_Assignment ( ) const [inline, virtual]

Test if the Parameter is an Assignment.

Returns:
true if the implementing class is an Assignment; false otherwise.

Reimplemented in Assignment.

virtual bool is_Token ( ) const [inline, virtual]

Test if the Parameter is a Token Assignment.

Returns:
true if the implementing class is an Assignment having a TOKEN Type specification; false otherwise.

Reimplemented in Assignment.

virtual bool is_Aggregate ( ) const [inline, virtual]

Test if the Parameter is an Aggregate.

Returns:
true if the implementing class is an Aggregate; false otherwise.

Reimplemented in Aggregate.

Referenced by Parameter::has_children().

virtual bool is_Group ( ) const [inline, virtual]

Test if the Parameter is a Group Aggregate.

Returns:
true if the implementing class is an Aggregate having a GROUP Type specification; false otherwise.

Reimplemented in Aggregate.

virtual bool is_Object ( ) const [inline, virtual]

Test if the Parameter is an Object Aggregate.

Returns:
true if the implementing class is an Aggregate having an OBJECT Type specification; false otherwise.

Reimplemented in Aggregate.

virtual bool is ( const Type  type) const [pure virtual]

Test if the Parameter is of some Type.

The test is the logical AND of the Parameter Subtype and the specified Type value. Thus, conceptually, the test is if the Parameter is any one of a possible combination of Types. For example, parameter.is (GROUP | OBJECT) will be true for any AGGREGATE parameter, which could just as easily be tested by parameter.is (AGGREGATE); and parameter.is (ASSIGNMENT | AGGREGATE) can be expected to always be true.

Parameters:
typeThe Type specification code against which to test the Parameter.
Returns:
true if the implementing class is of the specified Type. an OBJECT Type specification; false otherwise.

Implemented in Aggregate.

virtual Type type ( ) const [pure virtual]

Gets the Parameter's Type specification.

Returns:
A Type specification code.

Implemented in Assignment, and Aggregate.

Referenced by Aggregate::is(), and Assignment::is().

virtual Parameter& type ( const int  type) [pure virtual]

Sets the Parameter's Type specification.

Parameters:
typeA Type specification code.
Returns:
This Parameter.
Exceptions:
Invalid_ArgumentIf the Parameter's implementing class can not accept the specified Type.

Implemented in Assignment, and Aggregate.

virtual std::string type_name ( ) const [pure virtual]

Gets the Parameter's Type specification name.

Returns:
A one word name string corresponding to the Parameter's Type specification code.

Implemented in Assignment, and Aggregate.

Referenced by Aggregate::type_name(), and Assignment::type_name().

static std::string type_name ( const Type  type) [static]

Gets name of a Type specification.

A Type specification name is the same as its token name (except only the first letter is capitalized). If the specified value is not a valid Parameter Type specification code, then "Invalid" is returned.

Parameters:
typeA Type specification code.
Returns:
A one word name string corresponding to the Type specification code.
virtual Value& value ( ) const [pure virtual]

Gets the Value of an Assignment.

Returns:
A reference to an Assignment Parameter's Value.
Exceptions:
Invalid_Argumentif the Parameter is not an Assignment.

Implemented in Assignment, and Aggregate.

virtual Parameter& operator[] ( unsigned int  index) [virtual]

Array notation accessor.

Parameters:
indexThe index in the Aggregate of the Parameter to reference.
Returns:
A reference to the index-th Aggregate Parameter.
Exceptions:
Invalid_ArgumentIf the Parameter is not an Aggregate.
See also:
Aggregate::operator[]

Reimplemented in Aggregate.

Referenced by Aggregate::operator[]().

virtual const Parameter& operator[] ( unsigned int  index) const [virtual]

Array notation accessor.

Parameters:
indexThe index in the Aggregate of the Parameter to reference.
Returns:
A const reference to the index-th Aggregate Parameter.
Exceptions:
Invalid_ArgumentIf the Parameter is not an Aggregate.
See also:
Aggregate::operator[]

Reimplemented in Aggregate.

virtual Parameter& operator= ( const Parameter parameter) [pure virtual]

Assigns the defining characteristics of another Parameter to this Parameter.

The name, comment and Type specification are copied, but not the parent. Assignment Parameters clone the assigned Value. Aggregate Parameters clone the assigned Aggregate's Parameter list.

Parameters:
parameterThe Parameter to be assigned.
Returns:
This Parameter.
Exceptions:
Invalid_ArgumentIf the Parameter to be assigned is not of the same implementing class as this Parameter.

Implemented in Assignment, and Aggregate.

Referenced by Aggregate::operator=().

virtual Parameter& operator= ( const Value value) [pure virtual]

Assigns a Value to this Parameter.

The current Value is deleted and the assigned Value is cloned in its place. A token Parameter becomes an Assignment.

Parameters:
valueThe Value to be assigned.
Returns:
This Parameter.
Exceptions:
Invalid_ArgumentIf this Parameter is not an Assignment (or token).

Implemented in Assignment, and Aggregate.

virtual int compare ( const Parameter parameter) const [pure virtual]

Compares this Parameter with another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
An int that is less than, equal to, or greater than 0 if this Parameter is logically less than, equal to, or greater than, respectively, the other Parameter.
See also:
Assignment::compare(const Parameter&)
Aggregate::compare(const Parameter&)

Implemented in Assignment, and Aggregate.

Referenced by Parameter::operator!=(), Parameter::operator<(), Parameter::operator<=(), Parameter::operator==(), Parameter::operator>(), and Parameter::operator>=().

bool operator== ( const Parameter parameter) const [inline]

Test if this Parameter is logically equivalent to another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

Referenced by Aggregate::Depth_Iterator::operator!=().

bool operator< ( const Parameter parameter) const [inline]

Test if this Parameter is logically less than another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

bool operator!= ( const Parameter parameter) const [inline]

Test if a Parameter is logically not equivalent to another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

bool operator> ( const Parameter parameter) const [inline]

Test if a Parameter is logically greater than another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

bool operator<= ( const Parameter parameter) const [inline]

Test if a Parameter is logically less than or equal to another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

bool operator>= ( const Parameter parameter) const [inline]

Test if a Parameter is logically greater than or equal to another Parameter.

Parameters:
parameterThe Parameter to compare against.
Returns:
true or false based on how the parameters compare.
See also:
compare(const Parameter&) const

References Parameter::compare().

unsigned int write ( std::ostream &  out = std::cout,
int  depth = 0 
) const

Writes the Parameter on an output stream using PVL syntax.

Parameters:
outThe ostream to receive the PVL syntax.
depthThe indenting depth.
Returns:
The number of characters written.
See also:
Lister::write(const Parameter&, int)

Referenced by Parameter::print().

std::ostream& print ( std::ostream &  out = std::cout) const [inline]

Prints the Parameter on an output stream using PVL syntax.

Parameters:
outThe ostream to receive the PVL syntax.
Returns:
The out ostream.
See also:
write(ostream&, int)

References Parameter::write().

virtual void read ( std::istream &  in = std::cin) [pure virtual]

Reads an input stream parsed as PVL syntax into this Parameter.

Parameters:
inThe istream to be parsed for PVL syntax.
See also:
Assignment::read(istream&)
Aggregate::read(istream&)

Implemented in Assignment, and Aggregate.

virtual void read ( Parser parser) [pure virtual]

Assigns the next Parameter from a Parser to this Parameter.

Parameters:
parserThe Parser from which to obtain a Parameter.
See also:
Assignment::read(istream&)
Aggregate::read(istream&)

Implemented in Assignment, and Aggregate.

Parameter& mode_state ( const MODE  mode,
const MODE_STATE  state,
const WHICH_MODE  which = LOCAL_MODE_SET 
)

Sets the state of a syntax mode.

Parameters:
modeThe selected MODE.
stateThe MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE.
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies).
Returns:
This Parameter.

Referenced by Parameter::indenting(), and Parameter::verbatim_strings().

MODE_STATE mode_state ( const MODE  mode,
const WHICH_MODE  which = RECURSIVE_MODE_SET 
) const

Gets the state of a syntax mode.

Parameters:
modeThe selected MODE.
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED.
Returns:
The MODE_STATE found.
Parameter& mode_state ( const MODE_STATE *const  modes,
const WHICH_MODE  which = LOCAL_MODE_SET 
)

Sets the state of all syntax modes.

Parameters:
modesA pointer to an array of syntax modes. If NULL the local modes will all be reset to MODE_INHERITED; the DEFAULT_MODES will be set to built-in defaults;
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies).
Returns:
This Parameter.
const MODE_STATE* mode_state ( const WHICH_MODE  which = LOCAL_MODE_SET) const [inline]

Gets the array of syntax mode states.

Parameters:
whichDEFAULT_MODE_SET if the DEFAULT_MODES are to be obtained; otherwise the local modes for this Parameter are to be obtained.
Returns:
A pointer to the array of mode states.

References Parameter::DEFAULT_MODE_SET, Parameter::DEFAULT_MODES, and Parameter::Modes.

Parameter& verbatim_strings ( const MODE_STATE  state,
const WHICH_MODE  which = LOCAL_MODE_SET 
) [inline]

Enable or disable verbatim quoted strings in PVL syntax.

When disabled (the default initial condition) multi-line quoted strings in PVL statements have white space surrounding the line breaks compressed to a single space character - except when the last non-white space character on the line is a dash ("-"), in which case no space is included. This is because output formatting is expected to be controlled by embedded format characters which are processed by the Parameter's write method:

\n - line break. \t - horizontal tab. \f - form feed (page break). \ - backslash character. \v - verbatim (no formatting) till next \v.

When enabled all string values written as-is.

Parameters:
stateThe MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE.
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies).
Returns:
This Parameter.

References Parameter::mode_state(), and Parameter::Verbatim_Strings.

Parameter& verbatim_strings ( const bool  enable) [inline]

Enable or disable verbatim quoted strings for this Parameter.

This is equivalent to using the corresponding method with a MODE_STATE of either MODE_TRUE or MODE_FALSE if enable is true or false, respectively and WHICH_MODE of LOCAL_MODE_SET;

Parameters:
enabletrue if the mode is to be enabled; false otherwise.
Returns:
This Parameter.
See also:
verbatim_strings(const MODE_STATE, const WHICH_MODE)

References Parameter::LOCAL_MODE_SET, Parameter::MODE_FALSE, Parameter::mode_state(), Parameter::MODE_TRUE, and Parameter::Verbatim_Strings.

MODE_STATE verbatim_strings ( const WHICH_MODE  which = RECURSIVE_MODE_SET) const [inline]

Test if quoted strings will be written verbatim.

If the mode is not set locally, then the state of the inherited mode, whether from a parent or the default, will be used.

Parameters:
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED.
Returns:
The MODE_STATE found.

References Parameter::mode_state(), and Parameter::Verbatim_Strings.

Parameter& indenting ( const MODE_STATE  state,
const WHICH_MODE  which = LOCAL_MODE_SET 
) [inline]

Enable or disable indenting.

Parameters:
stateThe MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE.
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies).
Returns:
This Parameter.

References Parameter::Indenting, and Parameter::mode_state().

Parameter& indenting ( const bool  enable) [inline]

Enable or disable indenting for this Parameter.

This is equivalent to using the corresponding method with a MODE_STATE of either MODE_TRUE or MODE_FALSE if enable is true or false, respectively and WHICH_MODE of LOCAL_MODE_SET;

Parameters:
enabletrue if the mode is to be enabled; false otherwise.
Returns:
This Parameter.
See also:
indenting(const MODE_STATE, const WHICH_MODE)

References Parameter::Indenting, Parameter::LOCAL_MODE_SET, Parameter::MODE_FALSE, Parameter::mode_state(), and Parameter::MODE_TRUE.

MODE_STATE indenting ( const WHICH_MODE  which = RECURSIVE_MODE_SET) const [inline]

Test if indenting will be used.

If the mode is not set locally, then the state of the inherited mode, whether from a parent or the default, will be used.

Parameters:
whichDEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED.
Returns:
The MODE_STATE found.

References Parameter::Indenting, and Parameter::mode_state().


Friends And Related Function Documentation

friend class Assignment [friend]

Referenced by Assignment::clone().

friend class Aggregate [friend]

Referenced by Aggregate::clone().


Member Data Documentation

const char* const ID [static]

Class identification name with source code version and date.

const char DEFAULT_PATHNAME_DELIMITER [static]

Default pathname delimiter.

const bool DEFAULT_CASE_SENSITIVITY [static]

Default case sensitivity.

Aggregate* Parent [protected]

The Parameter parent Aggregate (NULL if none).

Referenced by Parameter::parent().

std::string Name [protected]

The Parameter name.

Referenced by Parameter::name().

char Path_Delimiter [static, protected]

Delimter character for pathname components.

Referenced by Parameter::path_delimiter().

bool Case_Sensitive [static, protected]

Default case sensitivity.

Referenced by Parameter::case_sensitive().

std::string Comment [protected]

Comment string associated with the Parameter.

Referenced by Parameter::comment().

MODE_STATE DEFAULT_MODES[TOTAL_LOCAL_MODES] [static, protected]

Default mode states.

Referenced by Parameter::mode_state().

MODE_STATE Modes[TOTAL_LOCAL_MODES] [protected]

Local mode states.

Referenced by Parameter::mode_state().


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