- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Models::Base::BaseModelDoubleValue Class Reference

`#include <BaseModelDoubleValue.h>`

Inheritance diagram for Mers::Models::Base::BaseModelDoubleValue:

[legend]
Collaboration diagram for Mers::Models::Base::BaseModelDoubleValue:

[legend]
List of all members.

## Public Member Functions
| BaseModelDoubleValue (double myValue=0.0, char const *myName=NULL, BaseModelDoubleDomain *myDomain=NULL)
| BaseModelDoubleValue (BaseModelDoubleValue const &other)
virtual | ~BaseModelDoubleValue ()
virtual void | setDouble (double newValue)
virtual double | getDouble () const
virtual void | setDomain (BaseModelDomain *newDomain)
BaseModelDoubleValue const & | operator= (BaseModelDoubleValue const &other)
virtual void | print (std::ostream &out) const
## Protected Member Functions
virtual void | destroy ()
virtual int | copy (BaseModelValue const &value)
virtual int | copy (BaseModelDoubleValue const &value)
## Protected Attributes
double | dValue
| the double value of this value object

## Detailed Description

A value of a domain which can be assigned to a variable. The value is a double as oppose to an integer or string. The variable should be of the BaseModelDoubleDomain class Note that the Domain has to keep track of the UID's to allow the domain to function like other domains, so changing values should be done in the domain's copy only.

Author:
  Paul H. Elliott

Definition at line 39 of file BaseModelDoubleValue.h.

## Constructor & Destructor Documentation

BaseModelDoubleValue::BaseModelDoubleValue | ( | double | myValue = `0.0`,
|  | char const * | myName = `NULL`,
|  | BaseModelDoubleDomain * | myDomain = `NULL` |
| ) |  |  |

Creates a new value of the requested value with the specified domain.

Parameters:

  | myValue | the value of this double value object.
  | myName | the name of the Double Value, which should be a double value string.
  | myDomain | the domain that this value should reside in. The value will add itself to the domain if appropriate.

Definition at line 27 of file BaseModelDoubleValue.cpp.

References dValue, and Mers::Models::Base::BaseModelDoubleDomain::registerValue().

Here is the call graph for this function:

BaseModelDoubleValue::BaseModelDoubleValue | ( | BaseModelDoubleValue const & | other | ) |

Creates a new value with a copy of the contents from the other value.

Parameters:

  | other | the value being copied

Definition at line 38 of file BaseModelDoubleValue.cpp.

References copy().

Here is the call graph for this function:

BaseModelDoubleValue::~BaseModelDoubleValue | ( |  | ) | `[virtual]`

Destroys the value.

Definition at line 46 of file BaseModelDoubleValue.cpp.

References destroy().

Here is the call graph for this function:

## Member Function Documentation

void BaseModelDoubleValue::setDouble | ( | double | newValue | ) | `[virtual]`

Sets the double value of this value object.

Parameters:

  | newValue | the new double value of this object

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 53 of file BaseModelDoubleValue.cpp.

References dValue.

double BaseModelDoubleValue::getDouble | ( |  | ) | const`[virtual]`

Returns the double value of this value object.

Returns:
  the double value of this value object

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 60 of file BaseModelDoubleValue.cpp.

References dValue.

Referenced by Mers::Models::Base::BaseModelDoubleDomain::getValue().

void BaseModelDoubleValue::setDomain | ( | BaseModelDomain * | newDomain | ) | `[virtual]`

Sets the domain of this object. This value object will register itself with the new domain and unregister itself with the old domain as appropriate.

Parameters:

  | newDomain | the new domain of this value

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 67 of file BaseModelDoubleValue.cpp.

References Mers::Models::Base::BaseModelValue::domain, Mers::Models::Base::BaseModelDomain::domainTypeToString(), and Mers::Models::Base::BaseModelDomain::getDomainType().

Referenced by Mers::Models::Base::BaseModelDoubleDomain::operator+=().

Here is the call graph for this function:

BaseModelDoubleValue const & BaseModelDoubleValue::operator= | ( | BaseModelDoubleValue const & | other | ) |

Copies the other value to this value. The origional data in this value is destroyed. The new copy is registered with the other value's domain as appropriate.

Parameters:

  | other | the value supplying the data for this value.

Returns:
  the other value

Definition at line 87 of file BaseModelDoubleValue.cpp.

References copy().

Here is the call graph for this function:

void BaseModelDoubleValue::print | ( | std::ostream & | out | ) | const`[virtual]`

Prints the contents of this clause to the ostream out. Derived classes should overide this function to change printing behavior.

Parameters:

  | out | all the data from this object is printed to this ostream object.

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 97 of file BaseModelDoubleValue.cpp.

References dValue.

void BaseModelDoubleValue::destroy | ( |  | ) | `[protected, virtual]`

Destroys the contents of this value object, freeing all allocated memory and reseting all values in preperation for a copy or delete operation. Derived classes should ensure this function is called as well

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 106 of file BaseModelDoubleValue.cpp.

References Mers::Models::Base::BaseModelValue::destroy(), and Mers::Models::Base::BaseModelValue::domain.

Referenced by ~BaseModelDoubleValue().

Here is the call graph for this function:

int BaseModelDoubleValue::copy | ( | BaseModelValue const & | value | ) | `[protected, virtual]`

Copies the contents of the other value to this value. This destroys the contents of this value.

Parameters:

  | value | the value being copied to this value.

Returns:
  0 on success or a positive number if the copy failed

Reimplemented from Mers::Models::Base::BaseModelValue.

Definition at line 116 of file BaseModelDoubleValue.cpp.

References Mers::Models::Base::BaseModelValue::getValueType(), and Mers::Models::Base::BaseModelValue::valueTypeToString().

Referenced by BaseModelDoubleValue(), and operator=().

Here is the call graph for this function:

int BaseModelDoubleValue::copy | ( | BaseModelDoubleValue const & | value | ) | `[protected, virtual]`

Copies the contents of the other value to this value. This destroys the contents of this value.

Parameters:

  | value | the value being copied to this value.

Returns:
  0 on success or a positive number if the copy failed

Definition at line 129 of file BaseModelDoubleValue.cpp.

References Mers::Models::Base::BaseModelValue::copy(), Mers::Models::Base::BaseModelValue::domain, and dValue.

Here is the call graph for this function:

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

- /Users/fpy/titan-1-5-MBARI/Mers/Models/Base/BaseModelDoubleValue.h
- /Users/fpy/titan-1-5-MBARI/Mers/Models/Base/BaseModelDoubleValue.cpp