#include <typemodel.hh>
Public Types | |
typedef std::list< Field > | FieldList |
Public Member Functions | |
Compound (std::string const &name) | |
FieldList const & | getFields () const |
field, or the Field object | |
| |
FieldList | m_fields |
Field const * | getField (const std::string &name) const |
void | addField (const Field &field, size_t offset) |
void | addField (const std::string &name, const Type &type, size_t offset) |
unsigned int | getTrailingPadding () const |
virtual std::set< Type const * > | dependsOn () const |
virtual bool | do_compare (Type const &other, bool equality, RecursionStack &stack) const |
virtual Type * | do_merge (Registry ®istry, RecursionStack &stack) const |
bool | do_resize (Registry ®istry, std::map< std::string, std::pair< size_t, size_t > > &new_sizes) |
Base class for types that are composed of other types (structures and enums)
Definition at line 314 of file typemodel.hh.
typedef std::list<Field> Typelib::Compound::FieldList |
Definition at line 317 of file typemodel.hh.
Compound::Compound | ( | std::string const & | name | ) |
Definition at line 209 of file typemodel.cc.
void Compound::addField | ( | const Field & | field, |
size_t | offset | ||
) |
Add a new field
Definition at line 271 of file typemodel.cc.
void Compound::addField | ( | const std::string & | name, |
const Type & | type, | ||
size_t | offset | ||
) |
Add a new field
Definition at line 269 of file typemodel.cc.
std::set< Type const * > Compound::dependsOn | ( | ) | const [virtual] |
The set of types this type depends upon
This method returns the set of types that are directly depended-upon by this type
Implements Typelib::Type.
Definition at line 297 of file typemodel.cc.
bool Compound::do_compare | ( | Type const & | other, |
bool | equality, | ||
RecursionStack & | stack | ||
) | const [private, virtual] |
Definition at line 239 of file typemodel.cc.
Type * Compound::do_merge | ( | Registry & | registry, |
RecursionStack & | stack | ||
) | const [private, virtual] |
Called by Type::merge when the type does not exist in registry
already. This method has to create a new type in registry that matches the type definition of *this.
All types referenced by *this must be moved to their equivalent in registry
.
Implements Typelib::Type.
Definition at line 280 of file typemodel.cc.
bool Compound::do_resize | ( | Registry & | into, |
std::map< std::string, std::pair< size_t, size_t > > & | new_sizes | ||
) | [private, virtual] |
Implementation of the actual resizing. Called by resize()
Reimplemented from Typelib::Type.
Definition at line 305 of file typemodel.cc.
Field const * Compound::getField | ( | const std::string & | name | ) | const |
Definition at line 213 of file typemodel.cc.
Compound::FieldList const & Compound::getFields | ( | ) | const |
The list of all fields
Definition at line 212 of file typemodel.cc.
unsigned int Compound::getTrailingPadding | ( | ) | const [virtual] |
Returns the number of bytes that are unused at the end of the compound
Reimplemented from Typelib::Type.
Definition at line 222 of file typemodel.cc.
FieldList Typelib::Compound::m_fields [private] |
Definition at line 342 of file typemodel.hh.