FEDEM Model Database  R8.0
Source code of the FEDEM model database
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
FFaField< ValueT > Class Template Reference

Template class for field representation in the FEDEM model database. More...

#include <FFaField.H>

Inheritance diagram for FFaField< ValueT >:
Inheritance graph
[legend]
Collaboration diagram for FFaField< ValueT >:
Collaboration graph
[legend]

Public Member Functions

 FFaField ()
 Empty default constructor. More...
 
virtual ~FFaField ()
 Empty destructor. More...
 
ValueT & operator= (const ValueT &data)
 Assignment operator. More...
 
const ValueT & getValue () const
 Returns a const reference to myData. More...
 
ValueT & getValue ()
 Returns a reference to myData (for update). More...
 
bool setValue (const ValueT &newData, bool checkChanged=true)
 Assigns a new value to the field. More...
 
bool setDefaultValue (const ValueT &defaultVal, bool checkChanged=true)
 Assigns the default value of the field. More...
 
void reset () final
 Resets the field value to its default value. More...
 
void updateDefault () final
 Updates the default value of the field. More...
 
bool isDefault () const final
 Returns true, if the field value equals its default value. More...
 
bool isDataField () const override
 Returns true, if this is a numerical data field. More...
 
bool isPrintable () const override
 Returns true, if this field should be printed. More...
 
bool isPrintable () const
 Returns true, if this field should be printed. More...
 
- Public Member Functions inherited from FFaFieldBase
virtual void calculateChecksum (FFaCheckSum *) const
 Calculates the checksum of the field valiue. More...
 

Protected Member Functions

FFaFieldBase * copy (const FFaFieldBase *field, bool defaultValueToo) override
 Copies another database field into *this. More...
 
void write (std::ostream &os) const override
 Writes the field name and value to an output stream. More...
 
void read (std::istream &is) override
 Reads the field value from an input stream. More...
 
void write (std::ostream &os) const
 
void read (std::istream &is, FmBlockPortReference &v) const
 
- Protected Member Functions inherited from FFaFieldBase
 FFaFieldBase ()
 Empty default constructor. More...
 
virtual ~FFaFieldBase ()
 Empty destructor. More...
 

Protected Attributes

ValueT myData
 Current field value. More...
 
ValueT myDefaultValue
 Default field value. More...
 

Private Member Functions

void read (std::istream &is, ValueT &v) const
 Reads the field value from an input stream. More...
 
void read (const std::string &sval, ValueT &v) const
 Reads the field value from a std::string. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from FFaFieldBase
static void writeString (std::ostream &os, const std::string &str, const char *pfx=NULL)
 Writes the string value str to the output stream os. More...
 
static void readString (std::istream &is, std::string &str)
 Reads a string value from an input stream. More...
 
static void readStrings (std::istream &os, Strings &str)
 Reads a list of string values from an input stream. More...
 
static bool readInt (std::istream &is, int &val, bool silence=false)
 Reads an integer value from an input stream. More...
 

Detailed Description

template<typename ValueT>
class FFaField< ValueT >

Template class for field representation in the FEDEM model database.

The class type of the field value must have the logical operators defined (i.e., "==", "<" and ">") as well as the assignment operator.

Constructor & Destructor Documentation

◆ FFaField()

template<typename ValueT >
FFaField< ValueT >::FFaField ( )
inline

Empty default constructor.

◆ ~FFaField()

template<typename ValueT >
virtual FFaField< ValueT >::~FFaField ( )
inlinevirtual

Empty destructor.

Member Function Documentation

◆ copy()

template<typename ValueT >
FFaFieldBase* FFaField< ValueT >::copy ( const FFaFieldBase *  field,
bool  defaultValues 
)
inlineoverrideprotectedvirtual

◆ getValue() [1/2]

template<typename ValueT >
ValueT& FFaField< ValueT >::getValue ( )
inline

Returns a reference to myData (for update).

◆ getValue() [2/2]

template<typename ValueT >
const ValueT& FFaField< ValueT >::getValue ( ) const
inline

Returns a const reference to myData.

◆ isDataField()

template<typename ValueT >
bool FFaField< ValueT >::isDataField ( ) const
inlineoverridevirtual

Returns true, if this is a numerical data field.

Implements FFaFieldBase.

◆ isDefault()

template<typename ValueT >
bool FFaField< ValueT >::isDefault ( ) const
inlinefinalvirtual

Returns true, if the field value equals its default value.

Implements FFaFieldBase.

◆ isPrintable() [1/2]

bool FFaField< FmTriad::DOFStatusVec >::isPrintable ( ) const
inlinevirtual

◆ isPrintable() [2/2]

template<typename ValueT >
bool FFaField< ValueT >::isPrintable ( ) const
inlineoverridevirtual

◆ operator=()

template<typename ValueT >
ValueT& FFaField< ValueT >::operator= ( const ValueT &  data)
inline

Assignment operator.

◆ read() [1/4]

template<typename ValueT >
void FFaField< ValueT >::read ( const std::string &  sval,
ValueT &  v 
) const
inlineprivate

Reads the field value from a std::string.

◆ read() [2/4]

template<typename ValueT >
void FFaField< ValueT >::read ( std::istream &  is)
inlineoverrideprotectedvirtual

◆ read() [3/4]

void FFaField< FmBlockPortReference >::read ( std::istream &  is,
FmBlockPortReference &  v 
) const
inlineprotected

◆ read() [4/4]

template<typename ValueT >
void FFaField< ValueT >::read ( std::istream &  is,
ValueT &  v 
) const
inlineprivate

Reads the field value from an input stream.

◆ reset()

template<typename ValueT >
void FFaField< ValueT >::reset ( )
inlinefinalvirtual

Resets the field value to its default value.

Implements FFaFieldBase.

◆ setDefaultValue()

template<typename ValueT >
bool FFaField< ValueT >::setDefaultValue ( const ValueT &  defaultVal,
bool  checkChanged = true 
)
inline

Assigns the default value of the field.

Parameters
[in]defaultValThe new default field value to be assigned
[in]checkChangedIf true, notify if defaultVal differs from myDefaultValue
Returns
true if defaultVal is different from myDefaultValue when checkChanges is true

◆ setValue()

template<typename ValueT >
bool FFaField< ValueT >::setValue ( const ValueT &  newData,
bool  checkChanged = true 
)
inline

Assigns a new value to the field.

Parameters
[in]newDataThe new field value to be assigned
[in]checkChangedIf true, notify if newData differs from myData
Returns
true if newData is different from myData when checkChanges is true

◆ updateDefault()

template<typename ValueT >
void FFaField< ValueT >::updateDefault ( )
inlinefinalvirtual

Updates the default value of the field.

Implements FFaFieldBase.

◆ write() [1/2]

void FFaField< FmBlockPortReference >::write ( std::ostream &  os) const
inlineprotectedvirtual

◆ write() [2/2]

template<typename ValueT >
void FFaField< ValueT >::write ( std::ostream &  os) const
inlineoverrideprotectedvirtual

Member Data Documentation

◆ myData

template<typename ValueT >
ValueT FFaField< ValueT >::myData
protected

Current field value.

◆ myDefaultValue

template<typename ValueT >
ValueT FFaField< ValueT >::myDefaultValue
protected

Default field value.


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