Public Member Functions | List of all members
openfluid::core::VectorValue Class Reference

#include <core/VectorValue.hpp>

Inheritance diagram for openfluid::core::VectorValue:
Inheritance graph
[legend]
Collaboration diagram for openfluid::core::VectorValue:
Collaboration graph
[legend]

Public Member Functions

 VectorValue ()
 
 VectorValue (const VectorValue &Val)
 
 VectorValue (unsigned long Size)
 
 VectorValue (unsigned long Size, double InitValue)
 
 VectorValue (double *Data, unsigned long Size)
 
virtual ~VectorValue ()
 
Valueoperator= (const Value &Other)
 
Type getType () const
 
Valueclone () const
 
void writeToStream (std::ostream &OutStm) const
 
void writeQuotedToStream (std::ostream &OutStm) const
 
- Public Member Functions inherited from openfluid::core::CompoundValue
 CompoundValue ()
 
bool isSimple () const
 
bool isCompound () const
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()
 
virtual ~Value ()
 
virtual bool convert (Value &) const
 
bool isDoubleValue () const
 
const DoubleValueasDoubleValue () const
 
DoubleValueasDoubleValue ()
 
bool isIntegerValue () const
 
const IntegerValueasIntegerValue () const
 
IntegerValueasIntegerValue ()
 
bool isBooleanValue () const
 
const BooleanValueasBooleanValue () const
 
BooleanValueasBooleanValue ()
 
bool isStringValue () const
 
const StringValueasStringValue () const
 
StringValueasStringValue ()
 
bool isNullValue () const
 
const NullValueasNullValue () const
 
NullValueasNullValue ()
 
bool isVectorValue () const
 
const VectorValueasVectorValue () const
 
VectorValueasVectorValue ()
 
bool isMatrixValue () const
 
const MatrixValueasMatrixValue () const
 
MatrixValueasMatrixValue ()
 
bool isMapValue () const
 
const MapValueasMapValue () const
 
MapValueasMapValue ()
 
bool isTreeValue () const
 
const TreeValueasTreeValue () const
 
TreeValueasTreeValue ()
 
std::string toString () const
 
- Public Member Functions inherited from openfluid::core::Vector< double >
 Vector ()
 
 Vector (const Vector &Vector)
 
 Vector (unsigned long Size)
 
 Vector (unsigned long Size, doubleInitValue)
 
 Vector (double *Data, unsigned long Size)
 
 ~Vector ()
 
unsigned long getSize () const
 
unsigned long size () const
 
double * data () const
 
void setData (double *Data, unsigned long Size)
 
double getElement (unsigned long Index) const
 
double at (unsigned long Index) const
 
double get (unsigned long Index) const
 
void setElement (unsigned long Index, doubleElement)
 
void set (unsigned long Index, doubleElement)
 
double & operator[] (unsigned long Index)
 
Vector< double > & operator= (const Vector &A)
 
void fill (const double &Val)
 
void clear ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Additional Inherited Members

- Public Types inherited from openfluid::core::Value
enum  Type {
  NONE, BOOLEAN, INTEGER, DOUBLE,
  STRING, VECTOR, MATRIX, MAP,
  TREE, NULLL
}
 
- Public Types inherited from openfluid::core::Vector< double >
typedef double * iterator
 
typedef const double * const_iterator
 
- Static Public Member Functions inherited from openfluid::core::Value
static bool getValueTypeFromString (const std::string &ValueTypeString, Value::Type &ValueType)
 
static std::string getStringFromValueType (const Value::Type ValueType)
 
- Protected Member Functions inherited from openfluid::core::Vector< double >
bool allocate (unsigned long Size)
 
void init ()
 
- Static Protected Member Functions inherited from openfluid::core::Vector< double >
static void copy (const Vector &Source, Vector &Dest)
 
- Protected Attributes inherited from openfluid::core::Vector< double >
double * m_Data
 
unsigned long m_Size
 

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
// declaration of a VectorValue of 7 elements, with values initialized to 0.0
// declaration of a VectorValue of 7 elements, with values initialized to 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

// 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

openfluid::core::VectorValue::VectorValue ( )
inline

Default constructor

openfluid::core::VectorValue::VectorValue ( const VectorValue Val)
inline

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 ( )
inlinevirtual

Member Function Documentation

Value* openfluid::core::VectorValue::clone ( ) const
inlinevirtual

Reimplemented from openfluid::core::Value.

Type openfluid::core::VectorValue::getType ( ) const
inlinevirtual
Value& openfluid::core::VectorValue::operator= ( const Value )
virtual

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::VectorValue::writeQuotedToStream ( std::ostream &  OutStm) const
inlinevirtual
void openfluid::core::VectorValue::writeToStream ( std::ostream &  OutStm) const
virtual

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