Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
parameterlist
src
Teuchos_StandardParameterEntryXMLConverters.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef TEUCHOS_STANDARDPARAMETERENTRYXMLCONVERTERS_HPP
11
#define TEUCHOS_STANDARDPARAMETERENTRYXMLCONVERTERS_HPP
12
16
17
18
#include "Teuchos_ParameterEntryXMLConverter.hpp"
19
20
21
namespace
Teuchos
{
22
23
29
class
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
AnyParameterEntryConverter
:
public
ParameterEntryXMLConverter
{
30
31
public
:
32
35
37
const
std::string
getTypeAttributeValue
()
const
;
38
40
const
std::string
getValueAttributeValue
(
41
RCP<const ParameterEntry>
entry)
const
;
42
44
any
getAny
(
const
XMLObject
& xmlObj)
const
;
46
47
};
48
49
54
template
<
class
T>
55
class
StandardTemplatedParameterConverter
:
56
public
ParameterEntryXMLConverter
57
{
58
59
public
:
60
63
65
virtual
const
std::string
getTypeAttributeValue
()
const
{
66
return
TypeNameTraits<T>::name
();
67
}
68
70
virtual
const
std::string
getValueAttributeValue
(
71
RCP<const ParameterEntry>
entry)
const
{
72
return
toString(
any_cast<T>
(entry->getAny(
false
)));
73
}
74
76
any
getAny
(
const
XMLObject
& xmlObj)
const
{
77
return
any
(xmlObj.
getRequired
<T>(
getValueAttributeName
()));
78
}
79
81
82
};
83
84
85
86
}
// namespace Teuchos
87
88
89
#endif
// TEUCHOS_STANDARDPARAMETERENTRYXMLCONVERTERS_HPP
Teuchos::AnyParameterEntryConverter
A last resort converter for when no others will do.
Definition
Teuchos_StandardParameterEntryXMLConverters.hpp:29
Teuchos::AnyParameterEntryConverter::getValueAttributeValue
const std::string getValueAttributeValue(RCP< const ParameterEntry > entry) const
Definition
Teuchos_StandardParameterEntryXMLConverters.cpp:19
Teuchos::AnyParameterEntryConverter::getAny
any getAny(const XMLObject &xmlObj) const
Definition
Teuchos_StandardParameterEntryXMLConverters.cpp:25
Teuchos::AnyParameterEntryConverter::getTypeAttributeValue
const std::string getTypeAttributeValue() const
Definition
Teuchos_StandardParameterEntryXMLConverters.cpp:15
Teuchos::ParameterEntryXMLConverter
A class used to convert parameter entries to xml and vice versa.
Definition
Teuchos_ParameterEntryXMLConverter.hpp:29
Teuchos::ParameterEntryXMLConverter::getValueAttributeName
static const std::string & getValueAttributeName()
Definition
Teuchos_ParameterEntryXMLConverter.hpp:94
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos::StandardTemplatedParameterConverter
A standard ParameterEntryXMLConverter for most data types.
Definition
Teuchos_StandardParameterEntryXMLConverters.hpp:57
Teuchos::StandardTemplatedParameterConverter::getAny
any getAny(const XMLObject &xmlObj) const
Definition
Teuchos_StandardParameterEntryXMLConverters.hpp:76
Teuchos::StandardTemplatedParameterConverter::getValueAttributeValue
virtual const std::string getValueAttributeValue(RCP< const ParameterEntry > entry) const
Definition
Teuchos_StandardParameterEntryXMLConverters.hpp:70
Teuchos::StandardTemplatedParameterConverter::getTypeAttributeValue
virtual const std::string getTypeAttributeValue() const
Definition
Teuchos_StandardParameterEntryXMLConverters.hpp:65
Teuchos::TypeNameTraits::name
static std::string name()
Definition
Teuchos_TypeNameTraits.hpp:56
Teuchos::XMLObject
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
Definition
Teuchos_XMLObject.hpp:30
Teuchos::XMLObject::getRequired
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.
Definition
Teuchos_XMLObject.cpp:61
Teuchos::any
Modified boost::any class, which is a container for a templated value.
Definition
Teuchos_any.hpp:123
Teuchos::any::any_cast
ValueType & any_cast(any &operand)
Used to extract the templated value held in Teuchos::any to a given value type.
Definition
Teuchos_any.hpp:327
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0