g4tools  5.4.0
Public Member Functions | List of all members
tools::sg::desc_fields Class Reference
Inheritance diagram for tools::sg::desc_fields:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::desc_fields:
Collaboration graph
[legend]

Public Member Functions

 desc_fields ()
 
 desc_fields (const desc_fields &a_parent, size_t a_num,...)
 
virtual ~desc_fields ()
 
 desc_fields (const desc_fields &a_from)
 
desc_fieldsoperator= (const desc_fields &a_from)
 
void dump (std::ostream &a_out) const
 

Detailed Description

Definition at line 148 of file field_desc.

Constructor & Destructor Documentation

◆ desc_fields() [1/3]

tools::sg::desc_fields::desc_fields ( )
inline

Definition at line 151 of file field_desc.

151 {}

◆ desc_fields() [2/3]

tools::sg::desc_fields::desc_fields ( const desc_fields a_parent,
size_t  a_num,
  ... 
)
inline

Definition at line 152 of file field_desc.

152  {
153  parent::operator=(a_parent);
154  va_list args;
155  va_start(args,a_num);
156  for(size_t index=0;index<a_num;index++) {
157  field_desc* _fd = va_arg(args,field_desc*); //we get ownership.
158  parent::push_back(*_fd);
159  delete _fd;
160  }
161  va_end(args);
162  }

◆ ~desc_fields()

virtual tools::sg::desc_fields::~desc_fields ( )
inlinevirtual

Definition at line 163 of file field_desc.

163 {}

◆ desc_fields() [3/3]

tools::sg::desc_fields::desc_fields ( const desc_fields a_from)
inline

Definition at line 165 of file field_desc.

165 :parent(a_from) {}

Member Function Documentation

◆ dump()

void tools::sg::desc_fields::dump ( std::ostream &  a_out) const
inline

Definition at line 168 of file field_desc.

168  {
169  a_out << "num fields " << parent::size() << " :" << std::endl;
170  tools_vforcit(field_desc,*this,it) {
171  const field_desc& _fd = *it;
172  a_out << "name " << _fd.name() << std::endl;
173  a_out << "class " << _fd.cls() << std::endl;
174  a_out << "offset " << _fd.offset() << std::endl;
175  a_out << "editable " << (_fd.editable()?"yes":"no") << std::endl;
176  {const std::vector<field_desc::enum_t>& _enums = _fd.enums();
177  if(_enums.size()) {
178  a_out << "num enums " << _enums.size() << " :" << std::endl;
179  tools_vforcit(field_desc::enum_t,_enums,eit) {
180  a_out << "key " << (*eit).first << ", value " << (*eit).second << std::endl;
181  }
182  }}
183  {const std::vector<std::string>& _opts = _fd.opts();
184  if(_opts.size()) {
185  a_out << "num options " << _opts.size() << " :" << std::endl;
186  tools_vforcit(std::string,_opts,oit) {
187  a_out << " " << (*oit) << std::endl;
188  }
189  }}
190  }
191  }

◆ operator=()

desc_fields& tools::sg::desc_fields::operator= ( const desc_fields a_from)
inline

Definition at line 166 of file field_desc.

166 {parent::operator=(a_from);return *this;}

The documentation for this class was generated from the following file:
tools::sg::field_desc::enum_t
std::pair< std::string, int > enum_t
Definition: field_desc:76
tools::file::size
bool size(const std::string &a_file, long &a_size)
Definition: fsize:13
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7