Manual for OpenFLUID 2.1.11

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

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.data();

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

#include <core/VectorValue.hpp>

Public Member Functions

 VectorValue ()
 
 VectorValue (const VectorValue &Val)
 
 VectorValue (VectorValue &&Val)
 
 VectorValue (unsigned long Size)
 
 VectorValue (unsigned long Size, double InitValue)
 
 VectorValue (double *Data, unsigned long Size)
 
VectorValueoperator= (const Value &Other) override
 
VectorValueoperator= (Value &&Other) override
 
VectorValueoperator= (const VectorValue &Other)
 
VectorValueoperator= (VectorValue &&Other)
 
virtual ~VectorValue ()=default
 
Type getType () const override
 
Valueclone () const override
 
void writeToStream (std::ostream &OutStm) const override
 
void writeQuotedToStream (std::ostream &OutStm) const override
 
- Public Member Functions inherited from openfluid::core::CompoundValue
bool isSimple () const override
 
bool isCompound () const override
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()=default
 
 Value (const Value &)=default
 
 Value (Value &&)=default
 
virtual ~Value ()=default
 
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 &Other)
 
 Vector (unsigned long Size)
 
 Vector (unsigned long Size, const double &InitValue)
 
 Vector (double *Data, unsigned long Size)
 
Vector< double > & operator= (const Vector &Other)
 
Vector< double > & operator= (Vector &&Other)
 
virtual ~Vector ()=default
 
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, const double &Val)
 
void set (unsigned long Index, const double &Val)
 
double & operator[] (unsigned long Index)
 
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
 
- 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)
 
- Public Attributes inherited from openfluid::core::Vector< double >
const typedef double * const_iterator
 
- 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 >
std::unique_ptr< double[]> m_Data
 
unsigned long m_Size
 
Inheritance diagram for openfluid::core::VectorValue:
Inheritance graph
[legend]
Collaboration diagram for openfluid::core::VectorValue:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ VectorValue() [1/6]

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

Default constructor

◆ VectorValue() [2/6]

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

Copy constructor

◆ VectorValue() [3/6]

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

Move constructor

◆ VectorValue() [4/6]

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

Constructor, creates a vector containing Size elements

◆ VectorValue() [5/6]

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

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

◆ VectorValue() [6/6]

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

Constructor, creates a vector of size Size, containing Data

◆ ~VectorValue()

virtual openfluid::core::VectorValue::~VectorValue ( )
virtualdefault

Member Function Documentation

◆ clone()

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

Reimplemented from openfluid::core::Value.

◆ getType()

Type openfluid::core::VectorValue::getType ( ) const
inlineoverridevirtual

◆ operator=() [1/4]

VectorValue& openfluid::core::VectorValue::operator= ( const Value )
overridevirtual

Assignment operator

Reimplemented from openfluid::core::Value.

◆ operator=() [2/4]

VectorValue& openfluid::core::VectorValue::operator= ( const VectorValue Other)

◆ operator=() [3/4]

VectorValue& openfluid::core::VectorValue::operator= ( Value &&  )
overridevirtual

Move operator

Reimplemented from openfluid::core::Value.

◆ operator=() [4/4]

VectorValue& openfluid::core::VectorValue::operator= ( VectorValue &&  Other)

◆ writeQuotedToStream()

void openfluid::core::VectorValue::writeQuotedToStream ( std::ostream &  OutStm) const
inlineoverridevirtual

◆ writeToStream()

void openfluid::core::VectorValue::writeToStream ( std::ostream &  OutStm) const
overridevirtual

The documentation for this class was generated from the following file:
openfluid::core::VectorValue
Definition: VectorValue.hpp:84
openfluid::core::StringValue::set
void set(const std::string &Val)
Definition: StringValue.hpp:200
openfluid::core::Value::toString
std::string toString() const
openfluid::core::StringValue::toVectorValue
bool toVectorValue(VectorValue &Val) const
openfluid::core::Vector::data
T * data() const
Definition: Vector.hpp:143
openfluid::core::Vector::get
T get(unsigned long Index) const
Definition: Vector.hpp:169
openfluid::core::Vector::set
void set(unsigned long Index, const T &Val)
Definition: Vector.hpp:183
openfluid::core::StringValue
Definition: StringValue.hpp:76