Parameter Class Reference

#include <Parameter.h>

Inheritance diagram for Parameter:
Inheritance graph
[legend]

List of all members.

Public Types

enum   Type {
  kString, kDouble, kDouble2, kDouble3,
  kDouble4, kAffineMatrix, kProjMatrix, kFile,
  kUnknown
}
enum   Property { kIsModified, kIsNotSaved, kIsDisabled }

Public Member Functions

  Parameter ()
virtual ParameterRef  clone () const =0
template<class T >
aw::Reference< T >  as ()
template<class T >
aw::Reference< const T >  as () const
virtual Parameter::Type  getType () const =0
virtual const awString::IString &  getName () const =0
virtual double  getValueAsDouble (int index, bool &ok) const =0
  Return the value at the given index as a double if: 1) the given index is valid for the Parameter::Type.
double  getValueAsDoubleWithDefault (int index, double defaultValue) const
  Same as getValueAsDoubleWithDefault( index, ok ), but returns the defaultValue if retrival was not ok.
virtual bool  setValueAsDouble (int index, double value)=0
  Sets the specified double inside the ValueParameter's value.
virtual bool  operator== (const Parameter &parameter) const =0
bool  operator!= (const Parameter &parameter) const
virtual bool  getValueAsAffineMatrix (awLinear::AffineMatrix &) const =0
  A few convenience methods for setting all values when dealing with the affine matrix case.
virtual bool  setValueAsAffineMatrix (const awLinear::AffineMatrix &)=0
virtual bool  getValueAsProjMatrix (awLinear::ProjMatrix &) const =0
virtual bool  setValueAsProjMatrix (const awLinear::ProjMatrix &)=0
virtual bool  checkConnectAssetValid ()=0
const awString::IString &  getValueAsString () const
virtual bool  setValueAsString (const awString::IString &value)=0

Static Public Member Functions

static const awString::IString  getTypeAsString (const Parameter::Type &type)
static const Parameter::Type  getTypeFromString (const awString::IString &stringType)
static void  parseFilenames (const awString::IString &stringToParse, awString::IString &filename1, awString::IString &filename2)
  Parses the given string delimited by this separator into its two parts.

Protected Member Functions

  Parameter (const Parameter &src)
virtual  ~Parameter ()
virtual void  recomputeValueAsString () const =0

Protected Attributes

awString::IString  myValueAsString
bool  myValueAsStringValid

Member Enumeration Documentation


Constructor & Destructor Documentation

Parameter ( )
Parameter ( const Parameter src ) [protected]
virtual ~Parameter ( ) [protected, virtual]

Member Function Documentation

virtual ParameterRef clone ( ) const [pure virtual]
aw::Reference< T > as ( )
{
    return dynamic_cast<T *>( this );
}
aw::Reference< const T > as ( ) const
{
    return dynamic_cast<const T *>( this );
}
virtual Parameter::Type getType ( ) const [pure virtual]
static const awString::IString getTypeAsString ( const Parameter::Type type ) [static]
static const Parameter::Type getTypeFromString ( const awString::IString &  stringType ) [static]
virtual const awString::IString& getName ( ) const [pure virtual]
const awString::IString& getValueAsString ( ) const

Access the parameter's value. It does not matter whether the Parameter is of type string or not -- you can always read/write it's string representation through getValueAsString and setValueAsString.

virtual bool setValueAsString ( const awString::IString &  value ) [pure virtual]
virtual double getValueAsDouble ( int  index,
bool &  ok 
) const [pure virtual]

Return the value at the given index as a double if: 1) the given index is valid for the Parameter::Type.

and 2) the value at the given index is valid. Otherwise, return 0 and set the boolean to false.

Implemented in ProteinParameter, and ValueParameter.

double getValueAsDoubleWithDefault ( int  index,
double  defaultValue 
) const

Same as getValueAsDoubleWithDefault( index, ok ), but returns the defaultValue if retrival was not ok.

virtual bool setValueAsDouble ( int  index,
double  value 
) [pure virtual]

Sets the specified double inside the ValueParameter's value.

Note that this will affect the result of getValueAsString Returns false if the parameter is not of the right type or if it's not mutable and the parameter will remain unmodified.

Implemented in ProteinParameter, and ValueParameter.

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

Implemented in ProteinParameter, and ValueParameter.

bool operator!= ( const Parameter parameter ) const
virtual bool getValueAsAffineMatrix ( awLinear::AffineMatrix &  ) const [pure virtual]

A few convenience methods for setting all values when dealing with the affine matrix case.

Implemented in ProteinParameter, and ValueParameter.

virtual bool setValueAsAffineMatrix ( const awLinear::AffineMatrix &  ) [pure virtual]
virtual bool getValueAsProjMatrix ( awLinear::ProjMatrix &  ) const [pure virtual]
virtual bool setValueAsProjMatrix ( const awLinear::ProjMatrix &  ) [pure virtual]
static void parseFilenames ( const awString::IString &  stringToParse,
awString::IString &  filename1,
awString::IString &  filename2 
) [static]

Parses the given string delimited by this separator into its two parts.

virtual bool checkConnectAssetValid ( ) [pure virtual]
virtual void recomputeValueAsString ( ) const [protected, pure virtual]

Member Data Documentation

awString::IString myValueAsString [mutable, protected]

Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter
Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter Parameter