head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.36; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.50; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.59; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.54; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# SGRawValue< T > Class Template Reference

Abstract base class for a raw value. More...

`#include <props.hxx>`

Inheritance diagram for SGRawValue< T >:

List of all members.

## Public Methods
| SGRawValue ()
| Constructor.
virtual | ~SGRawValue ()
| Destructor.
virtual T | getValue () const=0
| Return the underlying value.
virtual bool | setValue (T value)=0
| Assign a new underlying value.
virtual SGRawValue * | clone () const=0
| Create a new deep copy of this raw value.
## Static Public Attributes
const T | DefaultValue
| The default underlying value for this type.

## Detailed Description

### template<class T>
class SGRawValue< T >

Abstract base class for a raw value.

The property manager is implemented in two layers. The SGPropertyNode is the highest and most abstract layer, representing an LValue/RValue pair: it records the position of the property in the property tree and contains facilities for navigation to other nodes. It is guaranteed to be persistent: the SGPropertyNode will not change during a session, even if the property is bound and unbound multiple times.

When the property value is not managed internally in the SGPropertyNode, the SGPropertyNode will contain a reference to an SGRawValue (this class), which provides an abstract way to get, set, and clone the underlying value. The SGRawValue may change frequently during a session as a value is retyped or bound and unbound to various data source, but the abstract SGPropertyNode layer insulates the application from those changes. The raw value contains no facilities for data binding or for type conversion: it is simply the abstraction of a primitive data type (or a compound data type, in the case of a string).

The SGPropertyNode class always keeps a *copy* of a raw value, not the original one passed to it; if you override a derived class but do not replace the clone method, strange things will happen.

All derived SGRawValue classes must implement getValue, setValue, and clone for the appropriate type.

See also:
  SGPropertyNode , SGRawValuePointer , SGRawValueFunctions , SGRawValueFunctionsIndexed , SGRawValueMethods , SGRawValueMethodsIndexed

Definition at line 145 of file props.hxx.

## Constructor & Destructor Documentation

template<class T>
SGRawValue< T >::SGRawValue | ( |  | ) | `[inline]`

| Constructor. Use the default value for this type. Definition at line 166 of file props.hxx.

## Member Function Documentation

template<class T>
virtual SGRawValue* SGRawValue< T >::clone | ( |  | ) | const`[pure virtual]`

| Create a new deep copy of this raw value. The copy will contain its own version of the underlying value as well. Returns: A deep copy of the current object. Implemented in SGRawValuePointer< T >, SGRawValueFunctions< T >, SGRawValueFunctionsIndexed< T >, SGRawValueMethods< C, T >, and SGRawValueMethodsIndexed< C, T >. Referenced by SGPropertyNode::tie().

template<class T>
virtual T SGRawValue< T >::getValue | ( |  | ) | const`[pure virtual]`

| Return the underlying value. Returns: The actual value for the property. See also: setValue Implemented in SGRawValuePointer< T >, SGRawValueFunctions< T >, SGRawValueFunctionsIndexed< T >, SGRawValueMethods< C, T >, and SGRawValueMethodsIndexed< C, T >.

template<class T>
virtual bool SGRawValue< T >::setValue | ( | T | value | ) | `[pure virtual]`

  | Assign a new underlying value. If the new value cannot be set (because this is a read-only raw value, or because the new value is not acceptable for some reason) this method returns false and leaves the original value unchanged. Parameters:
  value | The actual value for the property.
Returns: true if the value was set successfully, false otherwise. See also: getValue Implemented in SGRawValuePointer< T >, SGRawValueFunctions< T >, SGRawValueFunctionsIndexed< T >, SGRawValueMethods< C, T >, and SGRawValueMethodsIndexed< C, T >.

## Member Data Documentation

template<class T>
const T SGRawValue< T >::DefaultValue`[static]`

| The default underlying value for this type. Every raw value has a default; the default is false for a boolean, 0 for the various numeric values, and "" for a string. If additional types of raw values are added in the future, they may need different kinds of default values (such as epoch for a date type). The default value is used when creating new values. Definition at line 158 of file props.hxx.

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

- props.hxx

@ 1.3 log @Oops, try again. @ text @d268 1 a268 1