g4tools  5.4.0
Public Member Functions | Static Public Member Functions | List of all members
tools::sg::mf< T > Class Template Reference
Inheritance diagram for tools::sg::mf< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::mf< 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 &)
 
 mf ()
 
 mf (const T &a_v)
 
 mf (const std::vector< T > &a_v)
 
virtual ~mf ()
 
 mf (const mf &a_from)
 
mfoperator= (const mf &a_from)
 
mfoperator= (const std::vector< T > &a_from)
 
mfoperator= (const T &a_v)
 
- Public Member Functions inherited from tools::sg::bmf< T >
 bmf ()
 
 bmf (const T &a_value)
 
 bmf (const std::vector< T > &a_v)
 
virtual ~bmf ()
 
 bmf (const bmf &a_from)
 
bmfoperator= (const bmf &a_from)
 
bmfoperator= (const std::vector< T > &a_from)
 
bool operator== (const bmf &a_from) const
 
bool operator!= (const bmf &a_from) const
 
const T & operator[] (size_t a_index) const
 
T & operator[] (size_t a_index)
 
size_t size () const
 
bool empty () const
 
const std::vector< T > & values () const
 
std::vector< T > & values ()
 
void add (const T &a_value)
 
void add (const std::vector< T > &a_vals)
 
void add_allocated (size_t &a_pos, const T &a_1, const T &a_2, const T &a_3)
 
void insert (const it_t &a_it, const T &a_value)
 
bool set_value (size_t a_index, const T &a_value)
 
bool get_value (size_t a_index, T &a_value)
 
void clear ()
 
void set_values (const std::vector< T > &a_values)
 
void set_value (const T &a_value)
 
bool setValues (size_t a_index, size_t a_num, const T *a_vs)
 
bool set1Value (size_t a_index, const T &a_value)
 
bool setValue (const T &a_value)
 
bmfoperator= (const T &a_v)
 
size_t getNum () const
 
T * getValues (size_t a_start)
 
- 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::bmf< T >
static const std::string & s_class ()
 

Additional Inherited Members

- Public Types inherited from tools::sg::bmf< T >
typedef std::vector< T >::iterator it_t
 
- Protected Member Functions inherited from tools::sg::field
 field ()
 
 field (const field &)
 
fieldoperator= (const field &)
 
- Protected Attributes inherited from tools::sg::bmf< T >
std::vector< T > m_values
 
- Protected Attributes inherited from tools::sg::field
bool m_touched
 

Detailed Description

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

Definition at line 21 of file mf.

Constructor & Destructor Documentation

◆ mf() [1/4]

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

Definition at line 54 of file mf.

54 {}

◆ mf() [2/4]

template<class T >
tools::sg::mf< T >::mf ( const T &  a_v)
inline

Definition at line 55 of file mf.

55 :parent(a_v){}

◆ mf() [3/4]

template<class T >
tools::sg::mf< T >::mf ( const std::vector< T > &  a_v)
inline

Definition at line 56 of file mf.

56 :parent(a_v){}

◆ ~mf()

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

Definition at line 57 of file mf.

57 {}

◆ mf() [4/4]

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

Definition at line 59 of file mf.

59 :parent(a_from){}

Member Function Documentation

◆ cast()

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

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

Definition at line 28 of file mf.

28  {
29  if(void* p = cmp_cast< mf<T> >(this,a_class)) {return p;}
30  return parent::cast(a_class);
31  }

◆ dump()

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

Implements tools::sg::field.

Definition at line 42 of file mf.

42  {
43  const std::vector<T>& vec = parent::m_values;
44  a_out << "size : " << vec.size() << std::endl;
45  typedef typename std::vector<T>::const_iterator cit_t;
46  for(cit_t it=vec.begin();it!=vec.end();++it) {
47  a_out << " " << (*it) << std::endl;
48  }
49  return true;
50  }

◆ operator=() [1/3]

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

Definition at line 60 of file mf.

60  {
61  //typedef typename parent::iterator bmf_t;
62  parent::operator=(a_from);
63  return *this;
64  }

◆ operator=() [2/3]

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

Definition at line 66 of file mf.

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

◆ operator=() [3/3]

template<class T >
mf& tools::sg::mf< T >::operator= ( const T &  a_v)
inline

Definition at line 70 of file mf.

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

◆ read()

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

Implements tools::sg::field.

Definition at line 38 of file mf.

38  {
39  std::vector<T>& vec = parent::m_values;
40  return a_buffer.read_std_vec(vec);
41  }

◆ s2value()

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

Implements tools::sg::field.

Definition at line 52 of file mf.

52 {return false;}

◆ s_class()

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

Definition at line 24 of file mf.

24  {
25  static const std::string s_v("tools::sg::mf<"+stype(T())+">");
26  return s_v;
27  }

◆ s_cls()

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

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

Definition at line 32 of file mf.

32 {return s_class();}

◆ s_value()

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

Implements tools::sg::field.

Definition at line 51 of file mf.

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

◆ write()

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

Implements tools::sg::field.

Definition at line 34 of file mf.

34  {
35  const std::vector<T>& vec = parent::m_values;
36  return a_buffer.write_vec((uint32)vec.size(),vec_data(vec));
37  }

The documentation for this class was generated from the following file:
tools::vec_data
const T * vec_data(const std::vector< T > &a_vec)
Definition: vdata:18
tools::sg::mf::s_class
static const std::string & s_class()
Definition: mf:24
tools::sg::bmf::operator=
bmf & operator=(const bmf &a_from)
Definition: bmf:42
tools::cmp_cast
void * cmp_cast(const TO *a_this, const std::string &a_class)
Definition: scast:15
tools::sg::bmf::m_values
std::vector< T > m_values
Definition: bmf:163
tools::stype
const std::string & stype(const mat4f &)
Definition: mat4f:73
tools::sg::bmf::cast
virtual void * cast(const std::string &a_class) const
Definition: bmf:30
tools::uint32
unsigned int uint32
Definition: typedefs:71