g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::sg::bsf< T > Class Template Reference
Inheritance diagram for tools::sg::bsf< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::bsf< T >:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const
 
 bsf (const T &a_value)
 
virtual ~bsf ()
 
 bsf (const bsf &a_from)
 
bsfoperator= (const bsf &a_from)
 
bsfoperator= (const T &a_value)
 
bool operator== (const bsf &a_from) const
 
bool operator!= (const bsf &a_from) const
 
bool operator== (const T &a_value) const
 
bool operator!= (const T &a_value) const
 
 operator const T & () const
 
 operator T ()
 
T & value ()
 
const T & value () const
 
void value (const T &a_value)
 
void value_no_cmp (const T &a_value)
 
void setValue (const T &a_value)
 
const T & getValue () const
 
- Public Member Functions inherited from tools::sg::field
virtual bool write (io::iwbuf &)=0
 
virtual bool read (io::irbuf &)=0
 
virtual bool dump (std::ostream &)=0
 
virtual bool s_value (std::string &) const =0
 
virtual bool s2value (const std::string &)=0
 
virtual ~field ()
 
void touch ()
 
bool touched () const
 
void reset_touched ()
 

Static Public Member Functions

static const std::string & s_class ()
 

Protected Member Functions

 bsf ()
 
- Protected Member Functions inherited from tools::sg::field
 field ()
 
 field (const field &)
 
fieldoperator= (const field &)
 

Protected Attributes

m_value
 
- Protected Attributes inherited from tools::sg::field
bool m_touched
 

Detailed Description

template<class T>
class tools::sg::bsf< T >

Definition at line 19 of file bsf.

Constructor & Destructor Documentation

◆ bsf() [1/3]

template<class T >
tools::sg::bsf< T >::bsf ( )
inlineprotected

Definition at line 40 of file bsf.

40 :m_value(T()){}

◆ bsf() [2/3]

template<class T >
tools::sg::bsf< T >::bsf ( const T &  a_value)
inline

Definition at line 42 of file bsf.

42 :m_value(a_value){}

◆ ~bsf()

template<class T >
virtual tools::sg::bsf< T >::~bsf ( )
inlinevirtual

Definition at line 43 of file bsf.

43 {}

◆ bsf() [3/3]

template<class T >
tools::sg::bsf< T >::bsf ( const bsf< T > &  a_from)
inline

Definition at line 45 of file bsf.

46  :parent(a_from)
47  ,m_value(a_from.m_value){}

Member Function Documentation

◆ cast()

template<class T >
virtual void* tools::sg::bsf< T >::cast ( const std::string &  a_class) const
inlinevirtual

◆ getValue()

template<class T >
const T& tools::sg::bsf< T >::getValue ( ) const
inline

Definition at line 118 of file bsf.

118 {return m_value;}

◆ operator const T &()

template<class T >
tools::sg::bsf< T >::operator const T & ( ) const
inline

Definition at line 75 of file bsf.

75 {return m_value;}

◆ operator T()

template<class T >
tools::sg::bsf< T >::operator T ( )
inline

Definition at line 76 of file bsf.

76 {return m_value;}

◆ operator!=() [1/2]

template<class T >
bool tools::sg::bsf< T >::operator!= ( const bsf< T > &  a_from) const
inline

Definition at line 64 of file bsf.

64  {
65  return !operator==(a_from);
66  }

◆ operator!=() [2/2]

template<class T >
bool tools::sg::bsf< T >::operator!= ( const T &  a_value) const
inline

Definition at line 71 of file bsf.

71  {
72  return !operator==(a_value);
73  }

◆ operator=() [1/2]

template<class T >
bsf& tools::sg::bsf< T >::operator= ( const bsf< T > &  a_from)
inline

Definition at line 49 of file bsf.

49  {
50  parent::operator=(a_from);
51  if(a_from.m_value!=m_value) m_touched = true;
52  m_value = a_from.m_value;
53  return *this;
54  }

◆ operator=() [2/2]

template<class T >
bsf& tools::sg::bsf< T >::operator= ( const T &  a_value)
inline

Definition at line 56 of file bsf.

56  {
57  if(a_value!=m_value) m_touched = true;
58  m_value = a_value;
59  return *this;
60  }

◆ operator==() [1/2]

template<class T >
bool tools::sg::bsf< T >::operator== ( const bsf< T > &  a_from) const
inline

Definition at line 61 of file bsf.

61  {
62  return m_value==a_from.m_value;
63  }

◆ operator==() [2/2]

template<class T >
bool tools::sg::bsf< T >::operator== ( const T &  a_value) const
inline

Definition at line 68 of file bsf.

68  {
69  return m_value==a_value;
70  }

◆ s_class()

template<class T >
static const std::string& tools::sg::bsf< T >::s_class ( )
inlinestatic

Definition at line 22 of file bsf.

22  {
23  //we do not use stype(T()).
24  static const std::string s_v("tools::sg::bsf");
25  return s_v;
26  }

◆ s_cls()

template<class T >
virtual const std::string& tools::sg::bsf< T >::s_cls ( ) const
inlinevirtual

◆ setValue()

template<class T >
void tools::sg::bsf< T >::setValue ( const T &  a_value)
inline

Definition at line 117 of file bsf.

117 {value(a_value);}

◆ value() [1/3]

template<class T >
T& tools::sg::bsf< T >::value ( )
inline

Definition at line 98 of file bsf.

98 {return m_value;}

◆ value() [2/3]

template<class T >
const T& tools::sg::bsf< T >::value ( ) const
inline

Definition at line 99 of file bsf.

99 {return m_value;}

◆ value() [3/3]

template<class T >
void tools::sg::bsf< T >::value ( const T &  a_value)
inline

Definition at line 100 of file bsf.

100  {
101  if(a_value!=m_value) m_touched = true;
102  m_value = a_value;
103  }

◆ value_no_cmp()

template<class T >
void tools::sg::bsf< T >::value_no_cmp ( const T &  a_value)
inline

Definition at line 104 of file bsf.

104  {
105  //if(a_value!=m_value) m_touched = true;
106  m_value = a_value;
107  }

Member Data Documentation

◆ m_value

template<class T >
T tools::sg::bsf< T >::m_value
protected

Definition at line 120 of file bsf.


The documentation for this class was generated from the following file:
tools::sg::field::m_touched
bool m_touched
Definition: field:63
tools::sg::bsf::m_value
T m_value
Definition: bsf:120
tools::sg::bsf::operator==
bool operator==(const bsf &a_from) const
Definition: bsf:61
tools::sg::field::cast
virtual void * cast(const std::string &a_class) const
Definition: field:28
tools::sg::field::operator=
field & operator=(const field &)
Definition: field:57
tools::cmp_cast
void * cmp_cast(const TO *a_this, const std::string &a_class)
Definition: scast:15
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::bsf::s_class
static const std::string & s_class()
Definition: bsf:22