#include <typebuilder.hh>
Classes | |
struct | Modifier |
Public Member Functions | |
void | addArrayMajor (int size) |
void | addArrayMinor (int size) |
void | addPointer (int level) |
const Type & | getType () const |
TypeBuilder (Registry ®istry, const std::list< std::string > &base) | |
TypeBuilder (Registry ®istry, const Type *base_type) | |
Static Public Member Functions | |
static const Type * | build (Registry ®istry, const std::string &full_name) |
static const Type * | getBaseType (const Registry ®istry, const std::string &full_name) |
static std::string | getBaseTypename (const std::string &full_name) |
Private Types | |
typedef std::list< Modifier > | ModifierList |
typedef std::pair< const Type *, ModifierList > | TypeSpec |
Static Private Member Functions | |
static const Type & | build (Registry ®istry, const TypeSpec &spec) |
static TypeSpec | parse (const Registry ®istry, const std::string &full_name) |
Private Attributes | |
std::string | m_basename |
Registry & | m_registry |
Type const * | m_type |
Helper class to easily build a derived type (pointer, array)
Definition at line 14 of file typebuilder.hh.
typedef std::list<Modifier> Typelib::TypeBuilder::ModifierList [private] |
Definition at line 24 of file typebuilder.hh.
typedef std::pair<const Type*, ModifierList> Typelib::TypeBuilder::TypeSpec [private] |
Definition at line 25 of file typebuilder.hh.
Typelib::TypeBuilder::TypeBuilder | ( | Registry & | registry, |
const std::list< std::string > & | base | ||
) |
Initializes the type builder This constructor builds the canonical name based on base
an gets its initial type from registry
. It throws Undefined(typename) if base
is not defined
Definition at line 22 of file typebuilder.cc.
Typelib::TypeBuilder::TypeBuilder | ( | Registry & | registry, |
const Type * | base_type | ||
) |
Initializes the type builder
Definition at line 31 of file typebuilder.cc.
void Typelib::TypeBuilder::addArrayMajor | ( | int | size | ) |
Add an outermost dimension to the current type (if it is not an array, builds an array
Definition at line 72 of file typebuilder.cc.
void Typelib::TypeBuilder::addArrayMinor | ( | int | size | ) |
Add an innermost dimension to the current type (if it is not an array, builds an array
Definition at line 54 of file typebuilder.cc.
void Typelib::TypeBuilder::addPointer | ( | int | level | ) |
Builds a level-deferenced pointer of the current type
Definition at line 37 of file typebuilder.cc.
const Type & Typelib::TypeBuilder::build | ( | Registry & | registry, |
const TypeSpec & | spec | ||
) | [static, private] |
Definition at line 85 of file typebuilder.cc.
const Type * Typelib::TypeBuilder::build | ( | Registry & | registry, |
const std::string & | full_name | ||
) | [static] |
Build a type from its full name
Definition at line 147 of file typebuilder.cc.
const Type * Typelib::TypeBuilder::getBaseType | ( | const Registry & | registry, |
const std::string & | full_name | ||
) | [static] |
Get base type, that is the type full_name
is derived from
Definition at line 156 of file typebuilder.cc.
std::string Typelib::TypeBuilder::getBaseTypename | ( | const std::string & | full_name | ) | [static] |
Get base name, that is the type full_name
is derived from
Definition at line 164 of file typebuilder.cc.
const Type & Typelib::TypeBuilder::getType | ( | ) | const |
Get the current type
Definition at line 36 of file typebuilder.cc.
TypeBuilder::TypeSpec Typelib::TypeBuilder::parse | ( | const Registry & | registry, |
const std::string & | full_name | ||
) | [static, private] |
Definition at line 111 of file typebuilder.cc.
std::string Typelib::TypeBuilder::m_basename [private] |
Definition at line 16 of file typebuilder.hh.
Registry& Typelib::TypeBuilder::m_registry [private] |
Definition at line 30 of file typebuilder.hh.
Type const* Typelib::TypeBuilder::m_type [private] |
Definition at line 17 of file typebuilder.hh.