antioch-0.4.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Antioch::SIPrefixes< T > Class Template Reference

Prefixes in unit. More...

#include <siprefix.h>

Public Member Functions

 SIPrefixes (const std::string &str, const std::string &na, const T &num)
 Default constructor, a std::string and a value. More...
 
 ~SIPrefixes ()
 Default destructor. More...
 
template<typename P = T>
const P value () const
 Value getter. More...
 
const std::string symbol () const
 Symbol getter. More...
 
const std::string name () const
 Name getter. More...
 
template<typename P >
SIPrefixesoperator= (const SIPrefixes< P > &rhs)
 Assignement operator, copy value and std::string. More...
 
template<typename P >
bool operator== (const SIPrefixes< P > &rhs) const
 Comparison operator, equal if values are equal. More...
 
template<typename P >
bool operator!= (const SIPrefixes< P > &rhs) const
 Comparison operator, not equal is not "equal". More...
 
template<typename P >
SIPrefixes< T > & operator= (const SIPrefixes< P > &rhs)
 

Private Member Functions

 SIPrefixes ()
 Default constructor, never uninitialize this stuff. More...
 

Private Attributes

std::string _symbol
 Two std::strings for the symbol and the name. More...
 
std::string _name
 
_value
 A double for the value. More...
 

Detailed Description

template<typename T = double>
class Antioch::SIPrefixes< T >

Prefixes in unit.

This class associates a std::string and a double. We store here the prefixes and the associated value defined in the file unit_defs.hpp

To add prefixes, one needs to add a SIPrefixes instance in the const SIPrefixes Prefixes[] variable in the unit_defs.hpp file:

SIPrefixes("prefix",value)

Definition at line 52 of file siprefix.h.

Constructor & Destructor Documentation

template<typename T = double>
Antioch::SIPrefixes< T >::SIPrefixes ( const std::string &  str,
const std::string &  na,
const T &  num 
)
inline

Default constructor, a std::string and a value.

Definition at line 56 of file siprefix.h.

56  :
57  _symbol(str),_name(na),_value(num){}
std::string _symbol
Two std::strings for the symbol and the name.
Definition: siprefix.h:83
std::string _name
Definition: siprefix.h:83
T _value
A double for the value.
Definition: siprefix.h:85
template<typename T = double>
Antioch::SIPrefixes< T >::~SIPrefixes ( )
inline

Default destructor.

Definition at line 59 of file siprefix.h.

59 {}
template<typename T = double>
Antioch::SIPrefixes< T >::SIPrefixes ( )
inlineprivate

Default constructor, never uninitialize this stuff.

Definition at line 81 of file siprefix.h.

References antioch_error.

81 {antioch_error();}
#define antioch_error()

Member Function Documentation

template<typename T = double>
const std::string Antioch::SIPrefixes< T >::name ( ) const
inline

Name getter.

Definition at line 67 of file siprefix.h.

References Antioch::SIPrefixes< T >::_name.

67 {return _name;}
std::string _name
Definition: siprefix.h:83
template<typename T = double>
template<typename P >
bool Antioch::SIPrefixes< T >::operator!= ( const SIPrefixes< P > &  rhs) const
inline

Comparison operator, not equal is not "equal".

Definition at line 77 of file siprefix.h.

77 {return !(*this == rhs);}
template<typename T = double>
template<typename P >
SIPrefixes& Antioch::SIPrefixes< T >::operator= ( const SIPrefixes< P > &  rhs)

Assignement operator, copy value and std::string.

template<typename T = double>
template<typename P >
SIPrefixes<T>& Antioch::SIPrefixes< T >::operator= ( const SIPrefixes< P > &  rhs)
inline

Definition at line 91 of file siprefix.h.

References Antioch::init_clone(), Antioch::SIPrefixes< T >::symbol(), and Antioch::SIPrefixes< T >::value().

92 {
93  if(this == &rhs){return *this;}
94  _symbol = rhs.symbol();
95  Antioch::init_clone(_value,rhs.value());
96  return *this;
97 }
std::string _symbol
Two std::strings for the symbol and the name.
Definition: siprefix.h:83
void init_clone(T &output, const T &example)
T _value
A double for the value.
Definition: siprefix.h:85
template<typename T = double>
template<typename P >
bool Antioch::SIPrefixes< T >::operator== ( const SIPrefixes< P > &  rhs) const
inline

Comparison operator, equal if values are equal.

Definition at line 74 of file siprefix.h.

References Antioch::SIPrefixes< T >::_value, and Antioch::SIPrefixes< T >::value().

74 {return (_value == rhs.value());}
T _value
A double for the value.
Definition: siprefix.h:85
template<typename T = double>
const std::string Antioch::SIPrefixes< T >::symbol ( ) const
inline

Symbol getter.

Definition at line 65 of file siprefix.h.

References Antioch::SIPrefixes< T >::_symbol.

Referenced by Antioch::SIPrefixes< T >::operator=().

65 {return _symbol;}
std::string _symbol
Two std::strings for the symbol and the name.
Definition: siprefix.h:83
template<typename T = double>
template<typename P = T>
const P Antioch::SIPrefixes< T >::value ( ) const
inline

Value getter.

Definition at line 63 of file siprefix.h.

References Antioch::SIPrefixes< T >::_value.

Referenced by Antioch::SIPrefixes< T >::operator=(), and Antioch::SIPrefixes< T >::operator==().

63 {return _value;}
T _value
A double for the value.
Definition: siprefix.h:85

Member Data Documentation

template<typename T = double>
std::string Antioch::SIPrefixes< T >::_name
private

Definition at line 83 of file siprefix.h.

Referenced by Antioch::SIPrefixes< T >::name().

template<typename T = double>
std::string Antioch::SIPrefixes< T >::_symbol
private

Two std::strings for the symbol and the name.

Definition at line 83 of file siprefix.h.

Referenced by Antioch::SIPrefixes< T >::symbol().

template<typename T = double>
T Antioch::SIPrefixes< T >::_value
private

A double for the value.

Definition at line 85 of file siprefix.h.

Referenced by Antioch::SIPrefixes< T >::operator==(), and Antioch::SIPrefixes< T >::value().


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

Generated on Thu Jul 7 2016 11:09:50 for antioch-0.4.0 by  doxygen 1.8.8