Typelib::TypeBuilder Class Reference

#include <typelib/typebuilder.hh>

Collaboration diagram for Typelib::TypeBuilder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TypeBuilder (Registry &registry, const std::list< std::string > &base)
 TypeBuilder (Registry &registry, const Type *base_type)
void addPointer (int level)
void addArrayMajor (int size)
void addArrayMinor (int size)
const TypegetType () const

Static Public Member Functions

static const Typebuild (Registry &registry, const std::string &full_name)
static std::string getBaseTypename (const std::string &full_name)
static const TypegetBaseType (const Registry &registry, const std::string &full_name)

Classes

struct  Modifier


Detailed Description

Helper class to easily build a derived type (pointer, array)

Constructor & Destructor Documentation

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

  • registry the registry to act on
  • base the base type

References Typelib::Registry::build(), and join().

Typelib::TypeBuilder::TypeBuilder ( Registry registry,
const Type base_type 
)

Initializes the type builder

  • registry the registry to act on
  • base_type the base type


Member Function Documentation

void Typelib::TypeBuilder::addPointer ( int  level  ) 

Builds a level-deferenced pointer of the current type

References Typelib::Registry::add(), Typelib::Registry::get(), Typelib::Type::getName(), and Typelib::Pointer::getPointerName().

void Typelib::TypeBuilder::addArrayMajor ( int  size  ) 

Add an outermost dimension to the current type (if it is not an array, builds an array

References Typelib::Registry::add(), Typelib::Registry::get(), Typelib::Array::getArrayName(), and Typelib::Type::getName().

Referenced by addArrayMinor().

void Typelib::TypeBuilder::addArrayMinor ( int  size  ) 

Add an innermost dimension to the current type (if it is not an array, builds an array

References addArrayMajor(), Typelib::Type::Array, Typelib::Type::getCategory(), Typelib::Array::getDimension(), and Typelib::Indirect::getIndirection().

const Type & Typelib::TypeBuilder::getType (  )  const

Get the current type

const Type * Typelib::TypeBuilder::build ( Registry registry,
const std::string &  full_name 
) [static]

Build a type from its full name

Returns:
the new type or 0 if it can't be built

std::string Typelib::TypeBuilder::getBaseTypename ( const std::string &  full_name  )  [static]

Get base name, that is the type full_name is derived from

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

Returns:
the new type or 0 if it can't be built

Referenced by Typelib::Registry::has().


The documentation for this class was generated from the following files:

Generated on Thu Jan 22 16:37:58 2009 for typeLib by doxygen 1.5.6
SourceForge.net Project Page