PSCF v1.1
|
A Parameter associated with a FArray container. More...
#include <FArrayParam.h>
Public Member Functions | |
FArrayParam (const char *label, FArray< Type, Capacity > &array, bool isRequired=true) | |
Constructor. More... | |
void | writeParam (std::ostream &out) const |
Write parameter to stream. More... | |
![]() | |
ArrayParam (const char *label, int n, bool isRequired=true) | |
Constructor. More... | |
virtual | ~ArrayParam () |
Destructor. More... | |
void | writeParam (std::ostream &out) const |
Write an array-valued parameter to stream. More... | |
int | n () const |
Get the logical array dimension. More... | |
std::string | indent () const |
Return indent string for this object (string of spaces). More... | |
virtual void | load (Serializable::IArchive &ar) |
Load from an archive. More... | |
virtual void | save (Serializable::OArchive &ar) |
Save to an archive. More... | |
std::string | label () const |
Return label string. More... | |
bool | isRequired () const |
Is this an optional parameter? More... | |
bool | isActive () const |
Is this parameter active? More... | |
![]() | |
Parameter (const char *label, bool isRequired=true) | |
Constructor. More... | |
virtual | ~Parameter () |
Destructor. More... | |
virtual void | readParam (std::istream &in) |
Read a label and (if the label matches) a parameter value. More... | |
virtual void | load (Serializable::IArchive &ar) |
Load from an archive. More... | |
virtual void | save (Serializable::OArchive &ar) |
Save to an archive. More... | |
std::string | label () const |
Return label string. More... | |
bool | isRequired () const |
Is this an optional parameter? More... | |
bool | isActive () const |
Is this parameter active? More... | |
![]() | |
virtual | ~ParamComponent () |
Destructor. More... | |
virtual void | readParam (std::istream &in)=0 |
Read parameter(s) from file. More... | |
virtual void | writeParam (std::ostream &out) const =0 |
Read parameter(s) to file. More... | |
virtual void | load (Serializable::IArchive &ar) |
Load internal state from an archive. More... | |
virtual void | save (Serializable::OArchive &ar) |
Save internal state to an archive. More... | |
virtual void | resetParam () |
Nontrivial implementation provided by ParamComposite subclass. More... | |
void | setIndent (const ParamComponent &parent, bool next=true) |
Set indent level. More... | |
std::string | indent () const |
Return indent string for this object (string of spaces). More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize this ParamComponent as a string. More... | |
![]() | |
virtual | ~Serializable () |
Destructor. More... | |
virtual void | save (OArchive &ar)=0 |
Save to an archive. More... | |
virtual void | load (IArchive &ar)=0 |
Load from an archive. More... | |
![]() | |
MpiFileIo () | |
Constructor. More... | |
MpiFileIo (const MpiFileIo &other) | |
Copy constructor. More... | |
bool | isIoProcessor () const |
Can this processor do file I/O ? More... | |
void | setIoCommunicator (MPI::Intracomm &communicator) |
Set the communicator. More... | |
void | clearCommunicator () |
Clear (nullify) the communicator. More... | |
bool | hasIoCommunicator () const |
Does this object have an associated MPI communicator? More... | |
MPI::Intracomm & | ioCommunicator () const |
Get the MPI communicator by reference. More... | |
Protected Member Functions | |
Type & | element (int i) |
Return a reference to one element of the array (non-const). More... | |
Type const & | element (int i) const |
Return a reference to one element of the array (const). More... | |
virtual void | readValue (std::istream &in) |
Read parameter value from an input stream. More... | |
virtual void | loadValue (Serializable::IArchive &ar) |
Load bare parameter value from an archive. More... | |
virtual void | saveValue (Serializable::OArchive &ar) |
Save parameter value to an archive. More... | |
virtual void | bcastValue () |
Broadcast parameter value within the ioCommunicator. More... | |
![]() | |
virtual void | readLabel (std::istream &in) |
Read parameter label from an input stream. More... | |
virtual void | readValue (std::istream &in) |
Read array of element values from an input stream. More... | |
void | readEndBracket (std::istream &in) |
Read a closing bracket, if necessary. More... | |
virtual Type & | element (int i)=0 |
Return a non-const reference to one element of the array. More... | |
virtual Type const & | element (int i) const =0 |
Return a non-const reference to one element of the array. More... | |
bool | hasBrackets () const |
Are square brackets being used as delimiters? More... | |
virtual void | readLabel (std::istream &in) |
Read and attempt to match label string. More... | |
virtual void | readValue (std::istream &in) |
Read parameter value from an input stream. More... | |
virtual void | loadValue (Serializable::IArchive &ar) |
Load bare parameter value from an archive. More... | |
virtual void | saveValue (Serializable::OArchive &ar) |
Save parameter value to an archive. More... | |
virtual void | bcastValue () |
Broadcast parameter value within the ioCommunicator. More... | |
![]() | |
ParamComponent () | |
Constructor. More... | |
ParamComponent (const ParamComponent &other) | |
Copy constructor. More... | |
Additional Inherited Members | |
![]() | |
typedef BinaryFileOArchive | OArchive |
Type of output archive used by save method. More... | |
typedef BinaryFileIArchive | IArchive |
Type of input archive used by load method. More... | |
![]() | |
template<class Type > | |
static void | saveOptional (Serializable::OArchive &ar, Type &value, bool isActive) |
Save an optional parameter value to an output archive. More... | |
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. More... | |
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. More... | |
![]() | |
static void | initStatic () |
Initialize static echo member to false. More... | |
static void | setEcho (bool echo=true) |
Enable or disable echoing for all subclasses of ParamComponent. More... | |
static bool | echo () |
Get echo parameter. More... | |
![]() | |
static const int | Width = 20 |
Width of output field for a scalar variable. More... | |
static const int | Precision = 12 |
Precision for io of floating point data field. More... | |
![]() | |
Label | label_ |
Label object that contains parameter label string. More... | |
![]() | |
Label | label_ |
Label object that contains parameter label string. More... | |
bool | isActive_ |
Is this parameter active (always true if isRequired). More... | |
A Parameter associated with a FArray container.
Definition at line 26 of file FArrayParam.h.
Util::FArrayParam< Type, Capacity >::FArrayParam | ( | const char * | label, |
FArray< Type, Capacity > & | array, | ||
bool | isRequired = true |
||
) |
Constructor.
label | label for array |
array | associated FArray<Type, Capacity> container |
isRequired | Is this a required parameter (true) or optional ? |
Definition at line 105 of file FArrayParam.h.
|
virtual |
Write parameter to stream.
out | output stream |
Reimplemented from Util::ArrayParam< Type >.
Definition at line 116 of file FArrayParam.h.
References Util::Parameter::isActive(), UTIL_THROW, and Util::ArrayParam< Type >::writeParam().
|
inlineprotectedvirtual |
Return a reference to one element of the array (non-const).
Implements Util::ArrayParam< Type >.
Definition at line 55 of file FArrayParam.h.
|
inlineprotectedvirtual |
Return a reference to one element of the array (const).
Implements Util::ArrayParam< Type >.
Definition at line 61 of file FArrayParam.h.
|
protectedvirtual |
Read parameter value from an input stream.
in | input stream from which to read |
Reimplemented from Util::ArrayParam< Type >.
Definition at line 130 of file FArrayParam.h.
References Util::ArrayParam< Type >::readValue(), and UTIL_THROW.
|
protectedvirtual |
Load bare parameter value from an archive.
ar | input archive from which to load |
Reimplemented from Util::Parameter.
Definition at line 142 of file FArrayParam.h.
References UTIL_THROW.
|
protectedvirtual |
Save parameter value to an archive.
ar | output archive to which to save |
Reimplemented from Util::Parameter.
Definition at line 154 of file FArrayParam.h.
References UTIL_THROW.
|
protectedvirtual |
Broadcast parameter value within the ioCommunicator.
Reimplemented from Util::Parameter.
Definition at line 167 of file FArrayParam.h.