MAST3
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
MAST::Base::ParameterData Class Reference

Detailed Description

Definition at line 31 of file parameter_data.hpp.

#include <parameter_data.hpp>

Public Member Functions

 ParameterData ()
 
virtual ~ParameterData ()
 
template<typename T >
T & add (const std::string &nm)
 
template<typename T >
get (const std::string &nm) const
 

Private Member Functions

template<typename T >
T & _add_to_map (const std::string &nm, std::map< const std::string, T > &m)
 
template<typename T >
_get_from_map (const std::string &nm, const std::map< const std::string, T > &m) const
 
std::map< const std::string, int_t > & _get_map (int v)
 
std::map< const std::string, real_t > & _get_map (real_t v)
 
const std::map< const std::string, int_t > & _get_map (int v) const
 
const std::map< const std::string, real_t > & _get_map (real_t v) const
 

Private Attributes

std::map< const std::string, int_t_int_data
 
std::map< const std::string, real_t_real_data
 

Constructor & Destructor Documentation

◆ ParameterData()

MAST::Base::ParameterData::ParameterData ( )
inline

Definition at line 35 of file parameter_data.hpp.

35 { }

◆ ~ParameterData()

virtual MAST::Base::ParameterData::~ParameterData ( )
inlinevirtual

Definition at line 38 of file parameter_data.hpp.

38 { }

Member Function Documentation

◆ _add_to_map()

template<typename T >
T& MAST::Base::ParameterData::_add_to_map ( const std::string &  nm,
std::map< const std::string, T > &  m 
)
inlineprivate

Definition at line 90 of file parameter_data.hpp.

91  {
92 
93  typename std::map<const std::string, T>::iterator
94  it = m.find(nm);
95 
96  Assert0(it == m.end(), "Data already exists for name: " + nm);
97 
98  m[nm] = T();
99  return m[nm];
100  }
#define Assert0(cond, msg)
Definition: exceptions.hpp:134

◆ _get_from_map()

template<typename T >
T MAST::Base::ParameterData::_get_from_map ( const std::string &  nm,
const std::map< const std::string, T > &  m 
) const
inlineprivate

Definition at line 104 of file parameter_data.hpp.

105  {
106 
107  typename std::map<const std::string, T>::const_iterator
108  it = m.find(nm);
109 
110  Assert0(it != m.end(), "Data does not exist for name: " + nm);
111 
112  return it->second;
113  }
#define Assert0(cond, msg)
Definition: exceptions.hpp:134

◆ _get_map() [1/4]

std::map<const std::string, int_t>& MAST::Base::ParameterData::_get_map ( int  v)
inlineprivate

Definition at line 61 of file parameter_data.hpp.

61  {
62 
63  return _int_data;
64  }
std::map< const std::string, int_t > _int_data

◆ _get_map() [2/4]

std::map<const std::string, real_t>& MAST::Base::ParameterData::_get_map ( real_t  v)
inlineprivate

Definition at line 68 of file parameter_data.hpp.

68  {
69 
70  return _real_data;
71  }
std::map< const std::string, real_t > _real_data

◆ _get_map() [3/4]

const std::map<const std::string, int_t>& MAST::Base::ParameterData::_get_map ( int  v) const
inlineprivate

Definition at line 75 of file parameter_data.hpp.

75  {
76 
77  return _int_data;
78  }
std::map< const std::string, int_t > _int_data

◆ _get_map() [4/4]

const std::map<const std::string, real_t>& MAST::Base::ParameterData::_get_map ( real_t  v) const
inlineprivate

Definition at line 82 of file parameter_data.hpp.

82  {
83 
84  return _real_data;
85  }
std::map< const std::string, real_t > _real_data

◆ add()

template<typename T >
T& MAST::Base::ParameterData::add ( const std::string &  nm)
inline

Definition at line 43 of file parameter_data.hpp.

43  {
44 
45  return _add_to_map<T>(nm, _get_map(T()));
46  }
std::map< const std::string, int_t > & _get_map(int v)

◆ get()

template<typename T >
T MAST::Base::ParameterData::get ( const std::string &  nm) const
inline

Definition at line 51 of file parameter_data.hpp.

51  {
52 
53  return _get_from_map<T>(nm, _get_map(T()));
54  }
std::map< const std::string, int_t > & _get_map(int v)

Member Data Documentation

◆ _int_data

std::map<const std::string, int_t> MAST::Base::ParameterData::_int_data
private

Definition at line 116 of file parameter_data.hpp.

◆ _real_data

std::map<const std::string, real_t> MAST::Base::ParameterData::_real_data
private

Definition at line 117 of file parameter_data.hpp.


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