PSCF v1.3
Util::FArrayParam< Type, Capacity > Class Template Reference

A Parameter associated with a FArray container. More...

#include <FArrayParam.h>

Inheritance diagram for Util::FArrayParam< Type, Capacity >:
Util::ArrayParam< Type > Util::Parameter Util::ParamComponent Util::Serializable Util::MpiFileIo

Public Member Functions

 FArrayParam (const char *label, FArray< Type, Capacity > &array, bool isRequired=true)
 Constructor.
void writeParam (std::ostream &out) const
 Write parameter to stream.
Public Member Functions inherited from Util::ArrayParam< Type >
 ArrayParam (const char *label, int n, bool isRequired=true)
 Constructor.
virtual ~ArrayParam ()
 Destructor.
int n () const
 Get the logical array dimension.
std::string indent () const
 Return indent string for this object (string of spaces).
virtual void load (Serializable::IArchive &ar)
 Load from an archive.
virtual void save (Serializable::OArchive &ar)
 Save to an archive.
std::string label () const
 Return label string.
bool isRequired () const
 Is this an optional parameter?
bool isActive () const
 Is this parameter active?
Public Member Functions inherited from Util::Parameter
 Parameter (const char *label, bool isRequired=true)
 Constructor.
virtual ~Parameter ()
 Destructor.
virtual void readParam (std::istream &in)
 Read a label and (if the label matches) a parameter value.
std::string label () const
 Return label string.
bool isRequired () const
 Is this an optional parameter?
bool isActive () const
 Is this parameter active?
Public Member Functions inherited from Util::ParamComponent
virtual ~ParamComponent ()
 Destructor.
virtual void resetParam ()
 Nontrivial implementation provided by ParamComposite subclass.
void setIndent (const ParamComponent &parent, bool next=true)
 Set indent level.
std::string indent () const
 Return indent string for this object (string of spaces).
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Serialize this ParamComponent as a string.
Public Member Functions inherited from Util::Serializable
virtual ~Serializable ()
 Destructor.
Public Member Functions inherited from Util::MpiFileIo
 MpiFileIo ()
 Constructor.
 MpiFileIo (const MpiFileIo &other)
 Copy constructor.
bool isIoProcessor () const
 Can this processor do file I/O ?

Protected Member Functions

Type & element (int i)
 Return a reference to one element of the array (non-const).
Type const & element (int i) const
 Return a reference to one element of the array (const).
virtual void readValue (std::istream &in)
 Read parameter value from an input stream.
virtual void loadValue (Serializable::IArchive &ar)
 Load bare parameter value from an archive.
virtual void saveValue (Serializable::OArchive &ar)
 Save parameter value to an archive.
Protected Member Functions inherited from Util::ArrayParam< Type >
virtual void readLabel (std::istream &in)
 Read parameter label from an input stream.
void readEndBracket (std::istream &in)
 Read a closing bracket, if necessary.
bool hasBrackets () const
 Are square brackets being used as delimiters?
Protected Member Functions inherited from Util::ParamComponent
 ParamComponent ()
 Constructor.
 ParamComponent (const ParamComponent &other)
 Copy constructor.

Additional Inherited Members

Public Types inherited from Util::Serializable
typedef BinaryFileOArchive OArchive
 Type of output archive used by save method.
typedef BinaryFileIArchive IArchive
 Type of input archive used by load method.
Static Public Member Functions inherited from Util::Parameter
template<class Type>
static void saveOptional (Serializable::OArchive &ar, Type &value, bool isActive)
 Save an optional parameter value to an output archive.
template<class Type>
static void saveOptionalCArray (Serializable::OArchive &ar, Type *ptr, int n, bool isActive)
 Save an optional C-array of n values to an output archive.
template<class Type>
static void saveOptionalCArray2D (Serializable::OArchive &ar, Type *ptr, int m, int n, int np, bool isActive)
 Save an optional two-dimensional C array to an output archive.
Static Public Member Functions inherited from Util::ParamComponent
static void initStatic ()
 Initialize static echo member to false.
static void setEcho (bool echo=true)
 Enable or disable echoing for all subclasses of ParamComponent.
static bool echo ()
 Get echo parameter.
Static Public Attributes inherited from Util::Parameter
static const int Width = 20
 Width of output field for a scalar variable.
static const int Precision = 12
 Precision for io of floating point data field.
Protected Attributes inherited from Util::ArrayParam< Type >
Label label_
 Label object that contains parameter label string.
Protected Attributes inherited from Util::Parameter
Label label_
 Label object that contains parameter label string.
bool isActive_
 Is this parameter active (always true if isRequired).

Detailed Description

template<typename Type, int Capacity>
class Util::FArrayParam< Type, Capacity >

A Parameter associated with a FArray container.

Definition at line 26 of file FArrayParam.h.

Constructor & Destructor Documentation

◆ FArrayParam()

template<typename Type, int Capacity>
Util::FArrayParam< Type, Capacity >::FArrayParam ( const char * label,
FArray< Type, Capacity > & array,
bool isRequired = true )

Constructor.

Parameters
labellabel for array
arrayassociated FArray<Type, Capacity> container
isRequiredIs this a required parameter (true) or optional ?

Definition at line 105 of file FArrayParam.h.

References Util::ArrayParam< Type >::ArrayParam(), Util::ArrayParam< Type >::isRequired(), and Util::ArrayParam< Type >::label().

Member Function Documentation

◆ writeParam()

template<typename Type, int Capacity>
void Util::FArrayParam< Type, Capacity >::writeParam ( std::ostream & out) const
virtual

Write parameter to stream.

Parameters
outoutput stream

Reimplemented from Util::ArrayParam< Type >.

Definition at line 116 of file FArrayParam.h.

References Util::Parameter::isActive(), Util::ArrayParam< Type >::n(), UTIL_THROW, and Util::ArrayParam< Type >::writeParam().

◆ element() [1/2]

template<typename Type, int Capacity>
Type & Util::FArrayParam< Type, Capacity >::element ( int i)
inlineprotectedvirtual

Return a reference to one element of the array (non-const).

Implements Util::ArrayParam< Type >.

Definition at line 55 of file FArrayParam.h.

◆ element() [2/2]

template<typename Type, int Capacity>
Type const & Util::FArrayParam< Type, Capacity >::element ( int i) const
inlineprotectedvirtual

Return a reference to one element of the array (const).

Implements Util::ArrayParam< Type >.

Definition at line 61 of file FArrayParam.h.

◆ readValue()

template<typename Type, int Capacity>
void Util::FArrayParam< Type, Capacity >::readValue ( std::istream & in)
protectedvirtual

Read parameter value from an input stream.

Parameters
ininput stream from which to read

Reimplemented from Util::ArrayParam< Type >.

Definition at line 130 of file FArrayParam.h.

References Util::ArrayParam< Type >::n(), Util::ArrayParam< Type >::readValue(), and UTIL_THROW.

◆ loadValue()

template<typename Type, int Capacity>
void Util::FArrayParam< Type, Capacity >::loadValue ( Serializable::IArchive & ar)
protectedvirtual

Load bare parameter value from an archive.

Parameters
arinput archive from which to load

Reimplemented from Util::Parameter.

Definition at line 142 of file FArrayParam.h.

References Util::ArrayParam< Type >::n(), and UTIL_THROW.

◆ saveValue()

template<typename Type, int Capacity>
void Util::FArrayParam< Type, Capacity >::saveValue ( Serializable::OArchive & ar)
protectedvirtual

Save parameter value to an archive.

Parameters
aroutput archive to which to save

Reimplemented from Util::Parameter.

Definition at line 154 of file FArrayParam.h.

References Util::ArrayParam< Type >::n(), and UTIL_THROW.


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