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

Public Member Functions

 TOOLS_T_SCLASS (T, tools::sg::sf_enum)
 
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const
 
virtual bool write (io::iwbuf &a_buffer)
 
virtual bool read (io::irbuf &a_buffer)
 
virtual bool dump (std::ostream &)
 
virtual bool s_value (std::string &a_s) const
 
virtual bool s2value (const std::string &)
 
virtual void set_value (int a_value)
 
 sf_enum ()
 
 sf_enum (const T &a_value)
 
virtual ~sf_enum ()
 
 sf_enum (const sf_enum &a_from)
 
sf_enumoperator= (const sf_enum &a_from)
 
sf_enumoperator= (const T &a_value)
 
- Public Member Functions inherited from tools::sg::bsf< T >
 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 ~field ()
 
void touch ()
 
bool touched () const
 
void reset_touched ()
 
- Public Member Functions inherited from tools::sg::bsf_enum
 TOOLS_SCLASS (tools::sg::bsf_enum)
 
 bsf_enum ()
 
virtual ~bsf_enum ()
 
 bsf_enum (const bsf_enum &)
 
bsf_enumoperator= (const bsf_enum &)
 

Additional Inherited Members

- Static Public Member Functions inherited from tools::sg::bsf< T >
static const std::string & s_class ()
 
- Protected Member Functions inherited from tools::sg::bsf< T >
 bsf ()
 
- Protected Member Functions inherited from tools::sg::field
 field ()
 
 field (const field &)
 
fieldoperator= (const field &)
 
- Protected Attributes inherited from tools::sg::bsf< T >
m_value
 
- Protected Attributes inherited from tools::sg::field
bool m_touched
 

Detailed Description

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

Definition at line 31 of file sf_enum.

Constructor & Destructor Documentation

◆ sf_enum() [1/3]

template<class T >
tools::sg::sf_enum< T >::sf_enum ( )
inline

Definition at line 60 of file sf_enum.

60 :parent(),bsf_enum(){}

◆ sf_enum() [2/3]

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

Definition at line 61 of file sf_enum.

61 :parent(a_value),bsf_enum(){}

◆ ~sf_enum()

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

Definition at line 62 of file sf_enum.

62 {}

◆ sf_enum() [3/3]

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

Definition at line 64 of file sf_enum.

64 :parent(a_from),bsf_enum(a_from){}

Member Function Documentation

◆ cast()

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

Reimplemented from tools::sg::bsf< T >.

Definition at line 35 of file sf_enum.

35  {
36  {if(void* p = cmp_cast< sf_enum<T> >(this,a_class)) {return p;}}
37  {if(void* p = bsf_enum::cast(a_class)) {return p;}}
38  return parent::cast(a_class);
39  }

◆ dump()

template<class T >
virtual bool tools::sg::sf_enum< T >::dump ( std::ostream &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 51 of file sf_enum.

51  {
52  //a_out << parent::m_value << std::endl;
53  return true;
54  }

◆ operator=() [1/2]

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

Definition at line 65 of file sf_enum.

65  {
66  parent::operator=(a_from);
67  return *this;
68  }

◆ operator=() [2/2]

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

Definition at line 70 of file sf_enum.

70  {
71  parent::operator=(a_value);
72  return *this;
73  }

◆ read()

template<class T >
virtual bool tools::sg::sf_enum< T >::read ( io::irbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 45 of file sf_enum.

45  {
46  int16 v;
47  if(!a_buffer.read(v)) return false;
48  parent::m_value = (T)v;
49  return true;
50  }

◆ s2value()

template<class T >
virtual bool tools::sg::sf_enum< T >::s2value ( const std::string &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 56 of file sf_enum.

56 {return false;}

◆ s_cls()

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

Reimplemented from tools::sg::bsf< T >.

Definition at line 40 of file sf_enum.

40 {return s_class();}

◆ s_value()

template<class T >
virtual bool tools::sg::sf_enum< T >::s_value ( std::string &  a_s) const
inlinevirtual

Implements tools::sg::field.

Definition at line 55 of file sf_enum.

55 {a_s.clear();return false;}

◆ set_value()

template<class T >
virtual void tools::sg::sf_enum< T >::set_value ( int  a_value)
inlinevirtual

Implements tools::sg::bsf_enum.

Definition at line 58 of file sf_enum.

58 {parent::value(T(a_value));}

◆ TOOLS_T_SCLASS()

template<class T >
tools::sg::sf_enum< T >::TOOLS_T_SCLASS ( ,
tools::sg::sf_enum< T >   
)

◆ write()

template<class T >
virtual bool tools::sg::sf_enum< T >::write ( io::iwbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 42 of file sf_enum.

42  {
43  return a_buffer.write((int16)parent::m_value);
44  }

The documentation for this class was generated from the following file:
tools::sg::bsf::m_value
T m_value
Definition: bsf:120
tools::sg::bsf::cast
virtual void * cast(const std::string &a_class) const
Definition: bsf:27
tools::sg::bsf_enum::bsf_enum
bsf_enum()
Definition: sf_enum:23
tools::sg::bsf_enum::cast
virtual void * cast(const std::string &a_class) const
Definition: sf_enum:15
tools::cmp_cast
void * cmp_cast(const TO *a_this, const std::string &a_class)
Definition: scast:15
tools::sg::bsf::operator=
bsf & operator=(const bsf &a_from)
Definition: bsf:49
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::bsf::s_class
static const std::string & s_class()
Definition: bsf:22
tools::int16
short int16
Definition: typedefs:100