All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
openfluid::core::VectorValue Class Reference

#include <core/VectorValue.hpp>

Inheritance diagram for openfluid::core::VectorValue:
openfluid::core::CompoundValue openfluid::core::Vector< double > openfluid::core::Value

List of all members.

Public Member Functions

 VectorValue ()
 VectorValue (const VectorValue &Val)
 VectorValue (unsigned long Size)
 VectorValue (unsigned long Size, double InitValue)
 VectorValue (double *Data, unsigned long Size)
Valueoperator= (const Value &Other)
virtual ~VectorValue ()
Type getType () const
Valueclone () const
void writeToStream (std::ostream &OutStm) const

Detailed Description

VectorValue is a container for a 1D vector of signed double precision floating point values.

See also:
Value
Vector


Example : declaration

  // declaration of a VectorValue, empty by default
  openfluid::core::VectorValue Val1;

  // declaration of a VectorValue of 7 elements, with values initialized to 0.0
  openfluid::core::VectorValue Val2(7);

  // declaration of a VectorValue of 7 elements, with values initialized to 1.99
  openfluid::core::VectorValue Val3(7,1.99);

Example : getting the contained values

  double Tmp1;

  // using the get method
  Tmp1 = Val1.get(2);

  // or using the [] operator
  Tmp1 = Val1[2];

Example : getting all values as a c-style array of double

  double DblArrayVal[];

  DblArrayVal = Val1.getData();

Example : setting the contained values

  // using the set method
  Val1.set(0,101.99);

  // or using the [] operator
  Val1[0] = 101.99;

Example : conversion from string

  openfluid::core::StringValue StringVal;
  openfluid::core::VectorValue Val2;

  // to VectorValue, using a string values separator
  StringVal.set("3;5;2.8;6;17.999923;1;1;1;1;1;2.11;2.12;2.13;2.14;2.15");
  StringVal.toVectorValue(";",Val2);

Example : conversion to string

  std::string StdStrVal = Val1.toString();

Constructor & Destructor Documentation

Default constructor

Copy constructor

openfluid::core::VectorValue::VectorValue ( unsigned long  Size) [inline]

Constructor, creates a vector containing Size elements

openfluid::core::VectorValue::VectorValue ( unsigned long  Size,
double  InitValue 
) [inline]

Constructor, creates a vector containing Size elements, initialized with value InitValue

openfluid::core::VectorValue::VectorValue ( double *  Data,
unsigned long  Size 
) [inline]

Constructor, creates a vector of size Size, containing Data

virtual openfluid::core::VectorValue::~VectorValue ( ) [inline, virtual]

Member Function Documentation

Value* openfluid::core::VectorValue::clone ( ) const [inline, virtual]

Reimplemented from openfluid::core::Value.

Type openfluid::core::VectorValue::getType ( ) const [inline, virtual]
Value& openfluid::core::VectorValue::operator= ( const Value ) [virtual]

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::VectorValue::writeToStream ( std::ostream &  OutStm) const [virtual]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines