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

Public Member Functions

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 &a_out)
 
virtual bool s_value (std::string &a_s) const
 
virtual bool s2value (const std::string &a_s)
 
 sf ()
 
 sf (const T &a_value)
 
virtual ~sf ()
 
 sf (const sf &a_from)
 
sfoperator= (const sf &a_from)
 
sfoperator= (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 ()
 

Static Public Member Functions

static const std::string & s_class ()
 
- Static Public Member Functions inherited from tools::sg::bsf< T >
static const std::string & s_class ()
 

Additional Inherited Members

- 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< T >

Definition at line 24 of file sf.

Constructor & Destructor Documentation

◆ sf() [1/3]

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

Definition at line 62 of file sf.

62 {}

◆ sf() [2/3]

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

Definition at line 63 of file sf.

63 :parent(a_value){}

◆ ~sf()

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

Definition at line 64 of file sf.

64 {}

◆ sf() [3/3]

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

Definition at line 66 of file sf.

67  :parent(a_from)
68  {}

Member Function Documentation

◆ cast()

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

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

Definition at line 31 of file sf.

31  {
32  if(void* p = cmp_cast< sf<T> >(this,a_class)) {return p;}
33  return parent::cast(a_class);
34  }

◆ dump()

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

Implements tools::sg::field.

Definition at line 43 of file sf.

43  {
44  a_out << parent::m_value << std::endl;
45  return true;
46  }

◆ operator=() [1/2]

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

Definition at line 69 of file sf.

69  {
70  parent::operator=(a_from);
71  return *this;
72  }

◆ operator=() [2/2]

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

Definition at line 74 of file sf.

74  {
75  parent::operator=(a_value);
76  return *this;
77  }

◆ read()

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

Implements tools::sg::field.

Definition at line 40 of file sf.

40  {
41  return a_buffer.read(parent::m_value);
42  }

◆ s2value()

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

Implements tools::sg::field.

Definition at line 53 of file sf.

53  {
54  std::istringstream strm(a_s.c_str());
55  T v;
56  strm >> v;
57  if(strm.fail()) return false;
58  parent::value(v);
59  return true;
60  }

◆ s_class()

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

Definition at line 27 of file sf.

27  {
28  static const std::string s_v("tools::sg::sf<"+stype(T())+">");
29  return s_v;
30  }

◆ s_cls()

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

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

Definition at line 35 of file sf.

35 {return s_class();}

◆ s_value()

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

Implements tools::sg::field.

Definition at line 47 of file sf.

47  {
48  std::ostringstream strm;
49  strm << parent::m_value;
50  a_s = strm.str();
51  return true;
52  }

◆ write()

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

Implements tools::sg::field.

Definition at line 37 of file sf.

37  {
38  return a_buffer.write(parent::m_value);
39  }

The documentation for this class was generated from the following file:
tools::sg::bsf::m_value
T m_value
Definition: bsf:120
tools::sg::sf::s_class
static const std::string & s_class()
Definition: sf:27
tools::sg::bsf::cast
virtual void * cast(const std::string &a_class) const
Definition: bsf:27
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::stype
const std::string & stype(const mat4f &)
Definition: mat4f:73