ISIS Core Library 0.7.2 (api 3.0.0)
Public Member Functions

isis::util::PropertyValue Class Reference

A very generic class to store values of properties. More...

#include <property.hpp>

Inheritance diagram for isis::util::PropertyValue:
isis::util::_internal::GenericReference< TYPE_TYPE > isis::util::ProgParameter

Public Member Functions

template<class T >
as () const
 

Interpret the value as value of any (other) type.

hook for ValueBase::as
template<class T >
T & castTo () const
 

Dynamically cast the ValueBase up to its actual value of type T.

hook for ValueBase::castTo
unsigned short getTypeID () const
  hook for ValueBase::getTypeID
std::string getTypeName () const
  hook for ValueBase::getTypeName
template<class T >
bool is () const
  hook for ValueBase::is
bool isNeeded () const
 returns true if PropertyValue is marked as needed, false otherwise
bool & needed ()
 accessor to mark as (not) needed
bool operator!= (const PropertyValue &second) const
 Unequality to another PropertyValue.
template<typename T >
bool operator== (const T &second) const
 Equality to a Value of type T (convenience function).
bool operator== (const ValueBase &second) const
 Equality to another Value-Object (this cannot be empty but PropertyValue can).
bool operator== (const PropertyValue &second) const
 Equality to another PropertyValue.
template<typename T >
 PropertyValue (const Value< T > &ref, bool _needed=false)
template<typename T >
 PropertyValue (const T &ref, bool _needed=false)
 Default constructor.
 PropertyValue ()
 Empty constructor.

Detailed Description

A very generic class to store values of properties.

PropertyValue may store a value of any type (defined in types.cpp) otherwise it's empty. Non-empty ValueValues are equal-compareable. But empty PropertyValues are neigther equal nor unequal to anything (not even to empty ValueValues).

Author:
Enrico Reimer

Definition at line 33 of file property.hpp.


Constructor & Destructor Documentation

template<typename T >
isis::util::PropertyValue::PropertyValue ( const T &  ref,
bool  _needed = false 
) [inline]

Default constructor.

Creates and stores a value from any known type. If the type is not known (there is no Value<type> available) an compiler error will be raised.

Parameters:
refthe value to be stored
_neededflag if this PropertyValue is needed an thus not allowed to be empty (a.k.a. undefined)

Definition at line 47 of file property.hpp.

template<typename T >
isis::util::PropertyValue::PropertyValue ( const Value< T > &  ref,
bool  _needed = false 
) [inline]

Definition at line 51 of file property.hpp.

isis::util::PropertyValue::PropertyValue ( )

Empty constructor.

Creates an empty property value. So PropertyValue().isEmpty() will allways be true.

Definition at line 40 of file property.cpp.


Member Function Documentation

template<class T >
T isis::util::PropertyValue::as ( ) const [inline]

Interpret the value as value of any (other) type.

hook for ValueBase::as

Definition at line 129 of file property.hpp.

template<class T >
T& isis::util::PropertyValue::castTo ( ) const [inline]

Dynamically cast the ValueBase up to its actual value of type T.

hook for ValueBase::castTo

Definition at line 159 of file property.hpp.

short unsigned int isis::util::PropertyValue::getTypeID ( ) const

hook for ValueBase::getTypeID

Definition at line 48 of file property.cpp.

std::string isis::util::PropertyValue::getTypeName ( ) const

hook for ValueBase::getTypeName

Definition at line 42 of file property.cpp.

template<class T >
bool isis::util::PropertyValue::is ( ) const [inline]

hook for ValueBase::is

Definition at line 138 of file property.hpp.

bool isis::util::PropertyValue::isNeeded ( ) const

returns true if PropertyValue is marked as needed, false otherwise

Definition at line 21 of file property.cpp.

bool & isis::util::PropertyValue::needed ( )

accessor to mark as (not) needed

Definition at line 20 of file property.cpp.

bool isis::util::PropertyValue::operator!= ( const PropertyValue second) const

Unequality to another PropertyValue.

Properties are ONLY unequal if:

  • only one of both properties is empty
  • or both properties contain a different value of same type T
  • or they contain different types If both are empty, they are not unequal
    Returns:
    true if they differ in type T or in value of same type, false otherwise.

Definition at line 28 of file property.cpp.

template<typename T >
bool isis::util::PropertyValue::operator== ( const T &  second) const [inline]

Equality to a Value of type T (convenience function).

Properties are ONLY equal to Values if:

  • the property is not empty
  • the property contains the value type T or is convertible into it
  • stored/converted value is equal to the given value
    Warning:
    because of rounding in the conversion the following will be true.
     PropertyValue(4.5)==5 
    
    If Debug is enabled and its loglevel is at least warning, a message will be send to the logger.
    Returns:
    true if both contain the same value of type T, false otherwise.

Definition at line 103 of file property.hpp.

bool isis::util::PropertyValue::operator== ( const PropertyValue second) const

Equality to another PropertyValue.

Properties are ONLY equal if:

  • both properties are not empty
  • both properties contain the same value type T
  • the stored values are equal
    Returns:
    true if both contain the same value of type T, false otherwise.

Definition at line 24 of file property.cpp.

bool isis::util::PropertyValue::operator== ( const ValueBase second) const

Equality to another Value-Object (this cannot be empty but PropertyValue can).

Properties are ONLY equal to Value-Object if:

  • the property and the Value-Object contain the same value type T
  • both stored values are equal
    Returns:
    true if both contain the same value of type T, false otherwise.

Definition at line 34 of file property.cpp.


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