Typelib Namespace Reference

Namespaces

namespace  CXX
namespace  details
namespace  MemLayout
namespace  Packing
namespace  ValueOps

Classes

class  AlreadyDefined
class  Array
struct  BadCategory
class  BadName
class  BadValueCast
class  CastingVisitor
class  CompileEndianSwapVisitor
class  Compound
class  Container
class  CSVOutput
class  DefinitionMismatch
class  EndianSwapVisitor
class  Enum
class  Exporter
struct  ExportError
class  ExportPlugin
class  Field
class  FieldGetter
class  FieldNotFound
class  GenericIOPlugin
class  Importer
class  ImportError
class  ImportPlugin
class  Indirect
struct  InvalidIndirectName
class  Manip
struct  NameSeparator
struct  NoLayout
struct  normalized_numeric_type
struct  normalized_numeric_type< double >
struct  normalized_numeric_type< float >
class  NullType
struct  NullTypeFound
class  Numeric
class  OpaqueType
struct  plugin_traits
class  PluginManager
struct  PluginNotFound
class  Pointer
class  Registry
class  RegistryException
class  RegistryIterator
class  Type
class  TypeBuilder
class  TypeDefinitionPlugin
class  TypeDisplayVisitor
struct  TypeException
class  TypeVisitor
class  Undefined
struct  UnknownContainer
struct  UnknownLayoutBytecode
struct  UnsupportedEndianSwap
class  UnsupportedType
class  Value
class  ValueVisitor

Typedefs

typedef std::vector< size_t > MemoryLayout
typedef std::string::value_type NamespaceMarkType
typedef boost::tokenizer
< NameSeparator
NameTokenizer

Functions

 BOOST_STATIC_ASSERT ((sizeof(size_t)==sizeof(void *)))
bool compare (void *dst, void *src, Type const &type)
bool compare (Value dst, Value src)
void copy (void *dst, void *src, Type const &type)
void copy (Value dst, Value src)
details::csvline csv (Type const &type, void *value, std::string const &sep=" ", bool char_as_numeric=true)
details::csvheader csv_header (Type const &type, std::string const &basename, std::string const &sep=" ")
void destroy (uint8_t *data, MemoryLayout const &ops)
void destroy (Value v, MemoryLayout const &ops)
void destroy (Value v)
void display (std::ostream &io, MemoryLayout::const_iterator const begin, MemoryLayout::const_iterator const end)
int dump (uint8_t const *v, uint8_t *buffer, unsigned int buffer_size, MemoryLayout const &ops)
int dump (Value v, uint8_t *buffer, unsigned int buffer_size, MemoryLayout const &ops)
int dump (Value v, uint8_t *buffer, unsigned int buffer_size)
void dump (uint8_t const *v, FILE *fd, MemoryLayout const &ops)
void dump (Value v, FILE *fd, MemoryLayout const &ops)
void dump (Value v, FILE *fd)
void dump (uint8_t const *v, int fd, MemoryLayout const &ops)
void dump (Value v, int fd, MemoryLayout const &ops)
void dump (Value v, int fd)
void dump (uint8_t const *v, std::ostream &stream, MemoryLayout const &ops)
void dump (Value v, std::ostream &stream, MemoryLayout const &ops)
void dump (Value v, std::ostream &stream)
void dump (uint8_t const *v, std::vector< uint8_t > &buffer, MemoryLayout const &ops)
void dump (Value v, std::vector< uint8_t > &buffer, MemoryLayout const &ops)
void dump (Value v, std::vector< uint8_t > &buffer)
std::vector< uint8_t > dump (Value v)
void endian_swap (Value v)
size_t getDumpSize (uint8_t const *v, MemoryLayout const &ops)
size_t getDumpSize (Value v, MemoryLayout const &ops)
size_t getDumpSize (Value v)
std::string getMinimalPathTo (std::string const &full_name, std::string const &ns)
std::string getNamespace (const std::string &full_name)
std::string getNormalizedNamespace (const std::string &name)
std::string getRelativeName (std::string const &full_name, std::string const &ns)
std::string getTypename (const std::string &full_name)
void init (uint8_t *data, MemoryLayout const &ops)
void init (Value v, MemoryLayout const &ops)
void init (Value v)
bool isAbsoluteName (const string &identifier)
bool isAbsoluteName (const std::string &name)
bool isInNamespace (const string &type, const std::string &nspace, bool recursive)
bool isInNamespace (const std::string &type, const std::string &nspace, bool recursive=false)
bool isValidNamespace (const string &name, bool absolute)
bool isValidNamespace (const std::string &name, bool absolute)
static bool isValidTypeBasename (std::string s, bool absolute, bool accept_integers)
static pair< bool, int > isValidTypename (std::string const &s, int pos, bool absolute, bool accept_integers)
bool isValidTypename (const std::string &name, bool absolute)
MemoryLayout layout_of (Type const &t, bool accept_pointers=false, bool accept_opaques=false, bool merge_skip_copy=true, bool remove_trailing_skips=true)
void load (uint8_t *v, Type const &type, uint8_t const *buffer, unsigned int buffer_size, MemoryLayout const &ops)
void load (Value v, uint8_t const *buffer, unsigned int buffer_size, MemoryLayout const &ops)
void load (Value v, uint8_t const *buffer, unsigned int buffer_size)
void load (uint8_t *v, Type const &type, std::vector< uint8_t > const &buffer, MemoryLayout const &ops)
void load (Value v, std::vector< uint8_t > const &buffer, MemoryLayout const &ops)
void load (Value v, std::vector< uint8_t > const &buffer)
bool nameSort (std::string const &name1, std::string const &name2)
std::ostream & operator<< (std::ostream &stream, Type const &type)
std::list< std::string > splitTypename (std::string const &name)
details::do_type_display type_display (Type const &type, std::string const &indent="")
template<typename T >
T & value_cast (void *ptr, Type const &type)
template<typename T >
T & value_cast (Value v)
void zero (uint8_t *data, MemoryLayout const &ops)
void zero (Value v, MemoryLayout const &ops)
void zero (Value v)
is not a field of the base type

Get the Value object for a named field in v

Exceptions:
FieldNotFound if
Value value_get_field (void *ptr, Type const &type, std::string const &name)
Value value_get_field (Value v, std::string const &name)

Variables

static const NamespaceMarkType NamespaceMark = '/'
static const char * NamespaceMarkString = "/"
static const NamespaceMarkType TemplateMark = '<'

Typedef Documentation

typedef std::vector< size_t > Typelib::MemoryLayout

Definition at line 31 of file install/include/typelib/memory_layout.hh.

typedef std::string::value_type Typelib::NamespaceMarkType

Definition at line 10 of file install/include/typelib/typename.hh.

typedef boost::tokenizer< NameSeparator > Typelib::NameTokenizer

Definition at line 20 of file install/include/typelib/typename.hh.


Function Documentation

Typelib::BOOST_STATIC_ASSERT ( (sizeof(size_t)==sizeof(void *))   ) 
bool Typelib::compare ( void *  dst,
void *  src,
Type const &  type 
)

Definition at line 276 of file value_ops.cc.

bool Typelib::compare ( Value  dst,
Value  src 
)

Definition at line 268 of file value_ops.cc.

void Typelib::copy ( void *  dst,
void *  src,
Type const &  type 
)

Definition at line 254 of file value_ops.cc.

void Typelib::copy ( Value  dst,
Value  src 
)

Definition at line 246 of file value_ops.cc.

details::csvline Typelib::csv ( Type const &  type,
void *  value,
std::string const &  sep = " ",
bool  char_as_numeric = true 
) [inline]

Display a CSV line for a Type object and some raw data

  • type the data type
  • value the data as a void* pointer
  • sep the separator to use

Definition at line 68 of file typelib/csvoutput.hh.

details::csvheader Typelib::csv_header ( Type const &  type,
std::string const &  basename,
std::string const &  sep = " " 
) [inline]

Display a CSV header matching a Type object

  • type the type to display
  • basename the basename to use. For simple type, it is the variable name. For compound types, names in the header are <basename>.<fieldname>
  • sep the separator to use

Definition at line 60 of file typelib/csvoutput.hh.

void Typelib::destroy ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 241 of file value_ops.cc.

void Typelib::destroy ( Value  v,
MemoryLayout const &  ops 
)

Definition at line 236 of file value_ops.cc.

void Typelib::destroy ( Value  v  ) 

Definition at line 229 of file value_ops.cc.

void Typelib::display ( std::ostream &  io,
MemoryLayout::const_iterator const   begin,
MemoryLayout::const_iterator const   end 
)

Definition at line 12 of file value_ops.cc.

int Typelib::dump ( uint8_t const *  v,
uint8_t *  buffer,
unsigned int  buffer_size,
MemoryLayout const &  ops 
)

Definition at line 590 of file value_ops.cc.

int Typelib::dump ( Value  v,
uint8_t *  buffer,
unsigned int  buffer_size,
MemoryLayout const &  ops 
)

Definition at line 615 of file value_ops.cc.

int Typelib::dump ( Value  v,
uint8_t *  buffer,
unsigned int  buffer_size 
)

Definition at line 607 of file value_ops.cc.

void Typelib::dump ( uint8_t const *  v,
FILE *  fd,
MemoryLayout const &  ops 
)

Definition at line 736 of file value_ops.cc.

void Typelib::dump ( Value  v,
FILE *  fd,
MemoryLayout const &  ops 
)

Definition at line 719 of file value_ops.cc.

void Typelib::dump ( Value  v,
FILE *  fd 
)

Definition at line 711 of file value_ops.cc.

void Typelib::dump ( uint8_t const *  v,
int  fd,
MemoryLayout const &  ops 
)

Definition at line 702 of file value_ops.cc.

void Typelib::dump ( Value  v,
int  fd,
MemoryLayout const &  ops 
)

Definition at line 685 of file value_ops.cc.

void Typelib::dump ( Value  v,
int  fd 
)

Definition at line 677 of file value_ops.cc.

void Typelib::dump ( uint8_t const *  v,
std::ostream &  stream,
MemoryLayout const &  ops 
)

Definition at line 668 of file value_ops.cc.

void Typelib::dump ( Value  v,
std::ostream &  stream,
MemoryLayout const &  ops 
)

Definition at line 651 of file value_ops.cc.

void Typelib::dump ( Value  v,
std::ostream &  stream 
)

Definition at line 643 of file value_ops.cc.

void Typelib::dump ( uint8_t const *  v,
std::vector< uint8_t > &  buffer,
MemoryLayout const &  ops 
)

Definition at line 633 of file value_ops.cc.

void Typelib::dump ( Value  v,
std::vector< uint8_t > &  buffer,
MemoryLayout const &  ops 
)

Definition at line 567 of file value_ops.cc.

void Typelib::dump ( Value  v,
std::vector< uint8_t > &  buffer 
)

Definition at line 559 of file value_ops.cc.

std::vector< uint8_t > Typelib::dump ( Value  v  ) 

Definition at line 552 of file value_ops.cc.

void Typelib::endian_swap ( Value  v  ) 

Swaps the endianness of +v+ by using a EndianSwapVisitor

Definition at line 34 of file typelib/endianness.hh.

size_t Typelib::getDumpSize ( uint8_t const *  v,
MemoryLayout const &  ops 
)

Definition at line 765 of file value_ops.cc.

size_t Typelib::getDumpSize ( Value  v,
MemoryLayout const &  ops 
)

Definition at line 763 of file value_ops.cc.

size_t Typelib::getDumpSize ( Value  v  ) 

Definition at line 756 of file value_ops.cc.

std::string Typelib::getMinimalPathTo ( std::string const &  full_name,
std::string const &  ns 
)

Computes the minimal namespace specification needed to reach a type from a namespace. The specification takes into account possible ambiguities, i.e.

getMinimalPathTo("/A/A/Type", "/A/B/A")

will return "/A/A/Type" as "A/Type" would be ambiguous.

Definition at line 237 of file typename.cc.

std::string Typelib::getNamespace ( const std::string &  full_name  ) 

Returns the normalized namespace part of full_name. The returned namespace name starts and ends with the namespace separator '/'.

Definition at line 282 of file typename.cc.

std::string Typelib::getNormalizedNamespace ( const std::string &  name  ) 

Returns +name+ as a namespace name, valid to build an absolute type name by simple concatenation

Definition at line 214 of file typename.cc.

std::string Typelib::getRelativeName ( std::string const &  full_name,
std::string const &  ns 
)

Returns the relative part of +name+, relative to the given namespace. The type name must be included in the namespace. Use getMinimalPathTo to generate the minimal namespace specification reaching a type from a namespace.

The returned name does not have any leading namespace separator.

Definition at line 229 of file typename.cc.

std::string Typelib::getTypename ( const std::string &  full_name  ) 

Removes the namespace part of full_name and returns it

Definition at line 221 of file typename.cc.

void Typelib::init ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 207 of file value_ops.cc.

void Typelib::init ( Value  v,
MemoryLayout const &  ops 
)

Definition at line 201 of file value_ops.cc.

void Typelib::init ( Value  v  ) 

Definition at line 195 of file value_ops.cc.

bool Typelib::isAbsoluteName ( const string &  identifier  ) 

Definition at line 45 of file typename.cc.

bool Typelib::isAbsoluteName ( const std::string &  name  ) 
bool Typelib::isInNamespace ( const string &  type,
const std::string &  nspace,
bool  recursive 
)

Definition at line 203 of file typename.cc.

bool Typelib::isInNamespace ( const std::string &  type,
const std::string &  nspace,
bool  recursive = false 
)
bool Typelib::isValidNamespace ( const string &  name,
bool  absolute 
)

Definition at line 186 of file typename.cc.

bool Typelib::isValidNamespace ( const std::string &  name,
bool  absolute 
)
static bool Typelib::isValidTypeBasename ( std::string  s,
bool  absolute,
bool  accept_integers 
) [static]

Definition at line 51 of file typename.cc.

static pair<bool, int> Typelib::isValidTypename ( std::string const &  s,
int  pos,
bool  absolute,
bool  accept_integers 
) [static]

Definition at line 100 of file typename.cc.

bool Typelib::isValidTypename ( const std::string &  name,
bool  absolute 
)

Definition at line 179 of file typename.cc.

MemoryLayout Typelib::layout_of ( Type const &  t,
bool  accept_pointers = false,
bool  accept_opaques = false,
bool  merge_skip_copy = true,
bool  remove_trailing_skips = true 
) [inline]

Returns the memory layout of the given type

Parameters:
accept_pointers if false (the default), will throw a NoLayout exception if the type given contains pointers. If true, they will simply be skipped
accept_opaques if false (the default), will throw a NoLayout exception if the type given contains opaques. If true, they will simply be skipped
merge_skip_copy in a layout, zones that contain data are copied, while zones that are there because of C++ padding rules are skipped. If this is true (the default), consecutive copy/skips are merged into one bigger copy, as doine one big memcpy() is probably more efficient than skipping the few padding bytes. Set to false to turn that off.
remove_trailing_skips because of C/C++ padding rules, structures might contain trailing bytes that don't contain information. If this option is true (the default), these bytes are removed from the layout.

Definition at line 122 of file typelib/memory_layout.hh.

void Typelib::load ( uint8_t *  v,
Type const &  type,
uint8_t const *  buffer,
unsigned int  buffer_size,
MemoryLayout const &  ops 
)

Definition at line 843 of file value_ops.cc.

void Typelib::load ( Value  v,
uint8_t const *  buffer,
unsigned int  buffer_size,
MemoryLayout const &  ops 
)

Definition at line 840 of file value_ops.cc.

void Typelib::load ( Value  v,
uint8_t const *  buffer,
unsigned int  buffer_size 
)

Definition at line 834 of file value_ops.cc.

void Typelib::load ( uint8_t *  v,
Type const &  type,
std::vector< uint8_t > const &  buffer,
MemoryLayout const &  ops 
)

Definition at line 800 of file value_ops.cc.

void Typelib::load ( Value  v,
std::vector< uint8_t > const &  buffer,
MemoryLayout const &  ops 
)

Definition at line 797 of file value_ops.cc.

void Typelib::load ( Value  v,
std::vector< uint8_t > const &  buffer 
)

Definition at line 791 of file value_ops.cc.

bool Typelib::nameSort ( std::string const &  name1,
std::string const &  name2 
)

Returns true if name1 is either in a more in-depth namespace than name2 (i.e. name2 == /A/B/class and name1 == /A/B/C/class2 or if name2 < name1 (lexicographic sort). Otherwise, returns false

Definition at line 25 of file typelib/registry.cc.

std::ostream & Typelib::operator<< ( std::ostream &  stream,
Type const &  type 
) [inline]

Pretty prints a type on a given output stream

  • stream the stream to output to
  • indent the type to display

Definition at line 69 of file typelib/typedisplay.hh.

std::list< std::string > Typelib::splitTypename ( std::string const &  name  ) 

Splits a type name into its components. It is non-validating, i.e. is guaranteed to return a valid value only for names for which isValidTypename returns true

Definition at line 71 of file typename.cc.

details::do_type_display Typelib::type_display ( Type const &  type,
std::string const &  indent = "" 
) [inline]

stream operator to pretty-print a type on a stream, with indenting std::cout << Typelib::type_display(type, 2) << std::endl;

  • type the type
  • indent base indentation

Definition at line 62 of file typelib/typedisplay.hh.

template<typename T >
T& Typelib::value_cast ( void *  ptr,
Type const &  type 
) [inline]

Casts a pointer to a given simple type T using type as the type for *ptr

Exceptions:
BadValueCast 

Definition at line 50 of file value_cast.hh.

template<typename T >
T& Typelib::value_cast ( Value  v  )  [inline]

Casts a Value object to a given simple type T

Exceptions:
BadValueCast 

Definition at line 41 of file value_cast.hh.

Value Typelib::value_get_field ( void *  ptr,
Type const &  type,
std::string const &  name 
) [inline]

Definition at line 141 of file typelib/value.hh.

Value Typelib::value_get_field ( Value  v,
std::string const &  name 
) [inline]

Definition at line 133 of file typelib/value.hh.

void Typelib::zero ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 224 of file value_ops.cc.

void Typelib::zero ( Value  v,
MemoryLayout const &  ops 
)

Definition at line 218 of file value_ops.cc.

void Typelib::zero ( Value  v  ) 

Definition at line 212 of file value_ops.cc.


Variable Documentation

static const NamespaceMarkType Typelib::NamespaceMark = '/' [static]

Definition at line 11 of file install/include/typelib/typename.hh.

static const char * Typelib::NamespaceMarkString = "/" [static]

Definition at line 13 of file install/include/typelib/typename.hh.

static const NamespaceMarkType Typelib::TemplateMark = '<' [static]

Definition at line 12 of file install/include/typelib/typename.hh.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 09:37:00 2013