43#ifndef TEUCHOS_PARAMETER_ENTRY_H
44#define TEUCHOS_PARAMETER_ENTRY_H
53#include "Teuchos_ParameterEntryValidator.hpp"
57#ifndef DOXYGEN_SHOULD_SKIP_THIS
92 template <
typename T,
typename = std::enable_if_t< ! std::is_same_v<std::decay_t<T>, ParameterEntry>>>
94 T&& value,
bool isDefault =
false,
bool isList =
false,
95 const std::string &docString =
"",
119 T value,
bool isDefault =
false,
120 const std::string &docString =
"",
131 const any &value,
bool isDefault =
false
140 void setDocString(
const std::string &docString);
144 bool isDefault =
false,
145 const std::string &docString =
""
160 T& getValue(
T *ptr)
const;
189 template <
typename T>
194 bool isArray()
const;
197 bool isTwoDArray()
const;
201 bool isDefault()
const;
205 std::string docString()
const;
221 std::ostream& leftshift(std::ostream& os,
bool printFlags =
true)
const;
227 static const std::string
tagName =
"Parameter";
242 mutable bool isUsed_;
245 mutable bool isDefault_;
248 std::string docString_;
254#pragma warning(disable:4251)
271 return entry.
getValue(
static_cast<T*
>(0));
282 return entry->getValue(
static_cast<T*
>(0));
291 e1.getAny() ==
e2.getAny()
292 &&
e1.isList()==
e2.isList()
293 &&
e1.isUsed() ==
e2.isUsed()
294 &&
e1.isDefault() ==
e2.isDefault()
303 return !(
e1 ==
e2 );
311 return e.leftshift(os);
319template<
typename T,
typename>
334 static_assert(std::is_same<typename Teuchos::is_comparable<T>::type, std::true_type>::value &&
335 std::is_same<typename Teuchos::is_printable<T>::type, std::true_type>::value,
336 "ParameterList values must be comparable and printable!");
348 static_assert(std::is_same<typename Teuchos::is_comparable<T>::type, std::true_type>::value &&
349 std::is_same<typename Teuchos::is_printable<T>::type, std::true_type>::value,
350 "ParameterList values must be comparable and printable!");
396{
return val_.
type() ==
typeid(
T); }
400{
return isDefault_; }
404{
return docString_; }
409{
return validator_; }
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Reference-counted pointer class and non-member templated function implementations.
Modified boost::any class for holding a templated value.
This object is held as the "value" in the Teuchos::ParameterList std::map.
unsigned int ParameterEntryID
bool isType() const
Test the type of the data being contained.
bool isUsed() const
Return whether or not the value has been used; i.e., whether or not the value has been retrieved via ...
any & getAny(bool activeQry=true)
Direct access to the Teuchos::any data value underlying this object. The bool argument activeQry (def...
T & getValue(T *ptr) const
Templated get method that uses the input pointer type to determine the type of parameter to return.
RCP< const ParameterEntryValidator > validator() const
Return the (optional) validator object.
ParameterEntry()
Default Constructor.
void setValue(T value, bool isDefault=false, const std::string &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Templated set method that uses the input value type to determine the type of parameter.
T & getValue(const ParameterEntry &entry)
A templated helper function for returning the value of type T held in the ParameterEntry object,...
bool operator==(const ParameterEntry &e1, const ParameterEntry &e2)
Returns true if two ParameterEntry objects are equal.
std::string docString() const
Return the (optional) documentation std::string.
bool operator!=(const ParameterEntry &e1, const ParameterEntry &e2)
Returns true if two ParameterEntry objects are not equal.
T & getValue(RCP< const ParameterEntry > entry)
A templated helper function for returning the value of type T held in the ParameterEntry object,...
std::ostream & operator<<(std::ostream &os, const ParameterEntry &e)
Output stream operator for handling the printing of parameter entries.
static const std::string & getTagName()
Get the string that should be used as the tag name for all parameters when they are serialized to xml...
bool isDefault() const
Indicate whether this entry takes on the default value.
A list of parameters of arbitrary type.
Smart reference counting pointer class for automatic garbage collection.
T * get() const
Get the raw C++ pointer to the underlying object.
Modified boost::any class, which is a container for a templated value.
const std::type_info & type() const
Return the type of value being stored.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...