Diana Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QVdt Class Reference

Variable Data Type. More...

Public Types

enum  QVdt_type {
  Int_QVdt = 'I' , Double_QVdt = 'F' , String_QVdt = 'S' , Vector_QVdt = 'V' ,
  Unassigned_QVdt = 'U'
}
 
typedef std::vector< QVdtQVdt_vector
 

Public Member Functions

 QVdt ()
 
 QVdt (const std::string &value, const std::string &name="", QVdt_type type=Unassigned_QVdt)
 
 QVdt (long int value)
 
 QVdt (double value)
 
template<typename V >
 QVdt (const std::vector< V, std::allocator< V > > &value)
 
 QVdt (int value)
 
 QVdt (short value)
 
 QVdt (char value)
 
 QVdt (unsigned long value)
 
 QVdt (unsigned short value)
 
 QVdt (unsigned char value)
 
 QVdt (float value)
 
void SetName (const std::string &name)
 
std::string GetName () const
 
const QVdtoperator= (const std::string &value)
 
const QVdtoperator= (long int value)
 
const QVdtoperator= (double value)
 
template<typename V >
const QVdtoperator= (const std::vector< V, std::allocator< V > > &value)
 
const QVdtoperator= (int value)
 
const QVdtoperator= (short value)
 
const QVdtoperator= (char value)
 
const QVdtoperator= (unsigned long value)
 
const QVdtoperator= (unsigned short value)
 
const QVdtoperator= (unsigned char value)
 
const QVdtoperator= (float value)
 
const QVdtoperator= (const QVdt &other)
 
bool is_valid () const
 
QVdt_type GetType () const
 
bool IsScalar () const
 
bool IsVector () const
 
long int GetInt () const
 
double GetDouble () const
 
const std::string & GetString () const
 
bool GetBool () const
 
const QVdt_vectorGetVector () const
 
std::vector< int > GetVectorInt () const
 
std::vector< double > GetVectorDouble () const
 
std::vector< std::string > GetVectorString () const
 
std::vector< bool > GetVectorBool () const
 
std::set< int > GetSetInt () const
 
std::set< std::string > GetSetString () const
 

Private Member Functions

void CheckType (QVdt_type new_type) const
 
std::string ToString () const
 
QVdt_type SearchType (const std::string &str)
 
void AssignValue (const std::string &str)
 
template<class T >
std::vector< T > GetStdVector () const
 
template<class T >
std::set< T > GetStdSet () const
 
template<class T >
Get () const
 
template<>
int Get () const
 
template<>
double Get () const
 
template<>
bool Get () const
 
template<>
int Get () const
 
template<>
double Get () const
 
template<>
bool Get () const
 

Private Attributes

QVdt_type type_internal
 
long int value_i
 
double value_f
 
std::string value_s
 
QVdt_vector value_v
 
std::string name_s
 
bool fBuiltFromString
 

Detailed Description

Variable Data Type.

Author
A. Razeto
M. Vignati (mantainer)

Variable Data Type is an object which is constructed from a string and holds the type of the assigne value. QVdt("1000") creates a QVdt obj holding an integer with value

  1. Later the obj value can be fetced only if the query matches the QVdt type, else an exception is generated. An assignement operator is present, which does not allow runtime type change (except float/int).

Definition at line 26 of file QVdt.hh.

Member Typedef Documentation

◆ QVdt_vector

typedef std::vector<QVdt> QVdt::QVdt_vector

Definition at line 38 of file QVdt.hh.

Member Enumeration Documentation

◆ QVdt_type

Enumerator
Int_QVdt 
Double_QVdt 
String_QVdt 
Vector_QVdt 
Unassigned_QVdt 

Definition at line 30 of file QVdt.hh.

Constructor & Destructor Documentation

◆ QVdt() [1/12]

QVdt::QVdt ( )
inline

Definition at line 40 of file QVdt.hh.

◆ QVdt() [2/12]

QVdt::QVdt ( const std::string &  value,
const std::string &  name = "",
QVdt_type  type = Unassigned_QVdt 
)

◆ QVdt() [3/12]

QVdt::QVdt ( long int  value)
inline

Definition at line 44 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [4/12]

QVdt::QVdt ( double  value)
inline

Definition at line 46 of file QVdt.hh.

References Double_QVdt, fBuiltFromString, type_internal, and value_f.

◆ QVdt() [5/12]

template<typename V >
QVdt::QVdt ( const std::vector< V, std::allocator< V > > &  value)
inline

Definition at line 48 of file QVdt.hh.

References fBuiltFromString, type_internal, value_v, and Vector_QVdt.

◆ QVdt() [6/12]

QVdt::QVdt ( int  value)
inline

Definition at line 57 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [7/12]

QVdt::QVdt ( short  value)
inline

Definition at line 59 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [8/12]

QVdt::QVdt ( char  value)
inline

Definition at line 61 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [9/12]

QVdt::QVdt ( unsigned long  value)
inline

Definition at line 62 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [10/12]

QVdt::QVdt ( unsigned short  value)
inline

Definition at line 63 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [11/12]

QVdt::QVdt ( unsigned char  value)
inline

Definition at line 64 of file QVdt.hh.

References fBuiltFromString, Int_QVdt, type_internal, and value_i.

◆ QVdt() [12/12]

QVdt::QVdt ( float  value)
inline

Definition at line 65 of file QVdt.hh.

References Double_QVdt, fBuiltFromString, type_internal, and value_f.

Member Function Documentation

◆ AssignValue()

void QVdt::AssignValue ( const std::string &  str)
private

◆ CheckType()

void QVdt::CheckType ( QVdt_type  new_type) const
private

Definition at line 239 of file QVdt.cc.

References DianaThrow, Double_QVdt, err, Int_QVdt, name_s, QERR_TYPE_CONVERSION, and type_internal.

Referenced by GetDouble(), GetInt(), GetVector(), operator=(), and QVdt().

◆ Get() [1/7]

template<>
int QVdt::Get ( ) const
private

Definition at line 278 of file QVdt.cc.

References GetInt().

◆ Get() [2/7]

template<>
double QVdt::Get ( ) const
private

Definition at line 283 of file QVdt.cc.

References GetDouble().

◆ Get() [3/7]

template<>
bool QVdt::Get ( ) const
private

Definition at line 288 of file QVdt.cc.

References GetBool().

◆ Get() [4/7]

template<class T >
T QVdt::Get ( ) const
inlineprivate

Definition at line 148 of file QVdt.hh.

References DianaThrow.

◆ Get() [5/7]

template<>
int QVdt::Get ( ) const
private

◆ Get() [6/7]

template<>
double QVdt::Get ( ) const
private

◆ Get() [7/7]

template<>
bool QVdt::Get ( ) const
private

◆ GetBool()

bool QVdt::GetBool ( ) const
inline

Definition at line 102 of file QVdt.hh.

References GetInt().

Referenced by Get(), and QOptions::ReplaceUserParams().

◆ GetDouble()

double QVdt::GetDouble ( ) const

Definition at line 219 of file QVdt.cc.

References CheckType(), Double_QVdt, type_internal, value_f, and value_i.

Referenced by Get(), and operator<<().

◆ GetInt()

long int QVdt::GetInt ( ) const

Definition at line 213 of file QVdt.cc.

References CheckType(), Int_QVdt, and value_i.

Referenced by Get(), GetBool(), MGuiDriver::HandleCommand(), QObjectInspector::Inspect(), and operator<<().

◆ GetName()

std::string QVdt::GetName ( ) const
inline

Definition at line 68 of file QVdt.hh.

References name_s.

Referenced by MGuiDriver::ChangeModuleParameter(), QRootFileWriterBase::Open(), and operator<<().

◆ GetSetInt()

std::set<int> QVdt::GetSetInt ( ) const
inline

Definition at line 109 of file QVdt.hh.

◆ GetSetString()

std::set<std::string> QVdt::GetSetString ( ) const
inline

Definition at line 110 of file QVdt.hh.

◆ GetStdSet()

template<class T >
std::set<T> QVdt::GetStdSet ( ) const
inlineprivate

Definition at line 138 of file QVdt.hh.

References GetVector().

◆ GetStdVector()

template<class T >
std::vector<T> QVdt::GetStdVector ( ) const
inlineprivate

Definition at line 128 of file QVdt.hh.

References GetVector().

◆ GetString()

const std::string & QVdt::GetString ( ) const

◆ GetType()

QVdt_type QVdt::GetType ( ) const
inline

Definition at line 96 of file QVdt.hh.

References type_internal.

Referenced by operator<<(), operator=(), QGDUtils::QVdtToParameter(), and MRootNtpDumper::Require().

◆ GetVector()

const QVdt::QVdt_vector & QVdt::GetVector ( ) const

Definition at line 233 of file QVdt.cc.

References CheckType(), value_v, and Vector_QVdt.

Referenced by GetStdSet(), GetStdVector(), and operator<<().

◆ GetVectorBool()

std::vector<bool> QVdt::GetVectorBool ( ) const
inline

Definition at line 107 of file QVdt.hh.

◆ GetVectorDouble()

std::vector<double> QVdt::GetVectorDouble ( ) const
inline

Definition at line 105 of file QVdt.hh.

◆ GetVectorInt()

std::vector<int> QVdt::GetVectorInt ( ) const
inline

Definition at line 104 of file QVdt.hh.

◆ GetVectorString()

std::vector<std::string> QVdt::GetVectorString ( ) const
inline

Definition at line 106 of file QVdt.hh.

◆ is_valid()

bool QVdt::is_valid ( ) const
inline

Definition at line 94 of file QVdt.hh.

References type_internal, and Unassigned_QVdt.

◆ IsScalar()

bool QVdt::IsScalar ( ) const
inline

Definition at line 97 of file QVdt.hh.

References Double_QVdt, Int_QVdt, and type_internal.

◆ IsVector()

bool QVdt::IsVector ( ) const
inline

Definition at line 98 of file QVdt.hh.

References type_internal, and Vector_QVdt.

◆ operator=() [1/12]

const QVdt& QVdt::operator= ( char  value)
inline

Definition at line 87 of file QVdt.hh.

◆ operator=() [2/12]

const QVdt & QVdt::operator= ( const QVdt other)

◆ operator=() [3/12]

const QVdt & QVdt::operator= ( const std::string &  value)

◆ operator=() [4/12]

template<typename V >
const QVdt& QVdt::operator= ( const std::vector< V, std::allocator< V > > &  value)
inline

Definition at line 74 of file QVdt.hh.

References CheckType(), fBuiltFromString, type_internal, Unassigned_QVdt, value_v, and Vector_QVdt.

◆ operator=() [5/12]

const QVdt & QVdt::operator= ( double  value)

Definition at line 185 of file QVdt.cc.

References CheckType(), Double_QVdt, fBuiltFromString, type_internal, Unassigned_QVdt, and value_f.

◆ operator=() [6/12]

const QVdt& QVdt::operator= ( float  value)
inline

Definition at line 91 of file QVdt.hh.

◆ operator=() [7/12]

const QVdt& QVdt::operator= ( int  value)
inline

Definition at line 85 of file QVdt.hh.

◆ operator=() [8/12]

const QVdt & QVdt::operator= ( long int  value)

Definition at line 174 of file QVdt.cc.

References CheckType(), fBuiltFromString, Int_QVdt, type_internal, Unassigned_QVdt, and value_i.

◆ operator=() [9/12]

const QVdt& QVdt::operator= ( short  value)
inline

Definition at line 86 of file QVdt.hh.

◆ operator=() [10/12]

const QVdt& QVdt::operator= ( unsigned char  value)
inline

Definition at line 90 of file QVdt.hh.

◆ operator=() [11/12]

const QVdt& QVdt::operator= ( unsigned long  value)
inline

Definition at line 88 of file QVdt.hh.

◆ operator=() [12/12]

const QVdt& QVdt::operator= ( unsigned short  value)
inline

Definition at line 89 of file QVdt.hh.

◆ SearchType()

QVdt::QVdt_type QVdt::SearchType ( const std::string &  str)
private

Definition at line 10 of file QVdt.cc.

References Double_QVdt, Int_QVdt, String_QVdt, and Vector_QVdt.

Referenced by operator=(), and QVdt().

◆ SetName()

void QVdt::SetName ( const std::string &  name)
inline

Definition at line 67 of file QVdt.hh.

References name_s.

Referenced by QGDUtils::ParameterToQVdt().

◆ ToString()

std::string QVdt::ToString ( ) const
private

Member Data Documentation

◆ fBuiltFromString

bool QVdt::fBuiltFromString
private

Definition at line 121 of file QVdt.hh.

Referenced by GetString(), operator=(), and QVdt().

◆ name_s

std::string QVdt::name_s
private

Definition at line 120 of file QVdt.hh.

Referenced by AssignValue(), CheckType(), GetName(), operator=(), and SetName().

◆ type_internal

QVdt_type QVdt::type_internal
private

◆ value_f

double QVdt::value_f
private

Definition at line 116 of file QVdt.hh.

Referenced by AssignValue(), GetDouble(), operator=(), QVdt(), and ToString().

◆ value_i

long int QVdt::value_i
private

Definition at line 115 of file QVdt.hh.

Referenced by AssignValue(), GetDouble(), GetInt(), operator=(), QVdt(), and ToString().

◆ value_s

std::string QVdt::value_s
mutableprivate

Definition at line 117 of file QVdt.hh.

Referenced by AssignValue(), GetString(), operator=(), and ToString().

◆ value_v

QVdt_vector QVdt::value_v
private

Definition at line 118 of file QVdt.hh.

Referenced by AssignValue(), GetVector(), operator=(), QVdt(), and ToString().


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