Namespaces | Classes | Typedefs | Functions | Variables
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  InputStream
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  OutputStream
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 (Value dst, Value src)
bool compare (void *dst, void *src, Type const &type)
void copy (Value dst, Value src)
void copy (void *dst, void *src, Type const &type)
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 (Value v)
void destroy (Value v, MemoryLayout const &ops)
void destroy (uint8_t *data, MemoryLayout const &ops)
void display (std::ostream &io, MemoryLayout::const_iterator const begin, MemoryLayout::const_iterator const end)
std::vector< uint8_t > dump (Value v)
void dump (Value v, std::vector< uint8_t > &buffer)
void dump (Value v, std::vector< uint8_t > &buffer, MemoryLayout const &ops)
void dump (uint8_t const *v, std::vector< uint8_t > &buffer, MemoryLayout const &ops)
void dump (Value v, std::ostream &stream)
void dump (Value v, std::ostream &stream, MemoryLayout const &ops)
void dump (uint8_t const *v, std::ostream &stream, MemoryLayout const &ops)
void dump (Value v, int fd)
void dump (Value v, int fd, MemoryLayout const &ops)
void dump (uint8_t const *v, int fd, MemoryLayout const &ops)
void dump (Value v, FILE *fd)
void dump (Value v, FILE *fd, MemoryLayout const &ops)
void dump (uint8_t const *v, FILE *fd, MemoryLayout const &ops)
int dump (Value v, uint8_t *buffer, unsigned int buffer_size)
int dump (Value v, uint8_t *buffer, unsigned int buffer_size, MemoryLayout const &ops)
int dump (uint8_t const *v, uint8_t *buffer, unsigned int buffer_size, MemoryLayout const &ops)
void dump (Value v, OutputStream &stream)
void dump (Value v, OutputStream &stream, MemoryLayout const &ops)
void dump (uint8_t const *v, OutputStream &stream, MemoryLayout const &ops)
void endian_swap (Value v)
size_t getDumpSize (Value v)
size_t getDumpSize (Value v, MemoryLayout const &ops)
size_t getDumpSize (uint8_t const *v, MemoryLayout const &ops)
std::string getMinimalPathTo (std::string const &full_name, std::string const &ns)
std::string getNamespace (const std::string &name)
std::string getNormalizedNamespace (const std::string &name)
std::string getRelativeName (std::string const &name, std::string const &ns)
std::string getTypename (const std::string &name)
void init (Value v)
void init (Value v, MemoryLayout const &ops)
void init (uint8_t *data, MemoryLayout const &ops)
bool isAbsoluteName (const std::string &name)
bool isAbsoluteName (const string &identifier)
bool isInNamespace (const std::string &type, const std::string &nspace, bool recursive=false)
bool isInNamespace (const string &type, const std::string &nspace, bool recursive)
bool isValidNamespace (const std::string &name, bool absolute)
bool isValidNamespace (const 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 (Value v, InputStream &stream)
void load (Value v, InputStream &stream, MemoryLayout const &ops)
void load (uint8_t *v, Type const &type, InputStream &stream, MemoryLayout const &ops)
void load (Value v, std::vector< uint8_t > const &buffer)
void load (Value v, std::vector< uint8_t > const &buffer, MemoryLayout const &ops)
void load (uint8_t *v, Type const &type, std::vector< uint8_t > const &buffer, MemoryLayout const &ops)
void load (Value v, uint8_t const *buffer, unsigned int buffer_size)
void load (Value v, uint8_t const *buffer, unsigned int buffer_size, MemoryLayout const &ops)
void load (uint8_t *v, Type const &type, uint8_t const *buffer, unsigned int buffer_size, MemoryLayout const &ops)
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 (Value v)
template<typename T >
T & value_cast (void *ptr, Type const &type)
void zero (Value v)
void zero (Value v, MemoryLayout const &ops)
void zero (uint8_t *data, MemoryLayout const &ops)
is not a field of the base type

Get the Value object for a named field in v

Exceptions:
FieldNotFoundif
Value value_get_field (Value v, std::string const &name)
Value value_get_field (void *ptr, Type const &type, 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 memory_layout.hh.

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

Definition at line 10 of file typename.hh.

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

Definition at line 20 of file typename.hh.


Function Documentation

Typelib::BOOST_STATIC_ASSERT ( (sizeof(size_t)==sizeof(void *))  )
bool Typelib::compare ( Value  dst,
Value  src 
)

Definition at line 268 of file value_ops.cc.

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

Definition at line 276 of file value_ops.cc.

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

Definition at line 246 of file value_ops.cc.

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

Definition at line 254 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 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 csvoutput.hh.

void Typelib::destroy ( Value  v)

Definition at line 229 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 ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 241 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.

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

Definition at line 552 of file value_ops.cc.

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

Definition at line 574 of file value_ops.cc.

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

Definition at line 579 of file value_ops.cc.

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

Definition at line 584 of file value_ops.cc.

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

Definition at line 604 of file value_ops.cc.

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

Definition at line 609 of file value_ops.cc.

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

Definition at line 614 of file value_ops.cc.

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

Definition at line 635 of file value_ops.cc.

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

Definition at line 640 of file value_ops.cc.

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

Definition at line 645 of file value_ops.cc.

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

Definition at line 666 of file value_ops.cc.

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

Definition at line 671 of file value_ops.cc.

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

Definition at line 676 of file value_ops.cc.

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

Definition at line 729 of file value_ops.cc.

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

Definition at line 737 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 741 of file value_ops.cc.

void Typelib::dump ( Value  v,
OutputStream stream 
)

Definition at line 686 of file value_ops.cc.

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

Definition at line 693 of file value_ops.cc.

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

Definition at line 697 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 endianness.hh.

size_t Typelib::getDumpSize ( Value  v)

Definition at line 772 of file value_ops.cc.

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

Definition at line 779 of file value_ops.cc.

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

Definition at line 781 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 238 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 287 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

It is guaranteed to end with the NamespaceMark

Definition at line 215 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 230 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 222 of file typename.cc.

void Typelib::init ( Value  v)

Definition at line 195 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 ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 207 of file value_ops.cc.

bool Typelib::isAbsoluteName ( const std::string &  name)
bool Typelib::isAbsoluteName ( const string &  identifier)

Definition at line 45 of file typename.cc.

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

Definition at line 203 of file typename.cc.

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

Definition at line 186 of file typename.cc.

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_pointersif false (the default), will throw a NoLayout exception if the type given contains pointers. If true, they will simply be skipped
accept_opaquesif false (the default), will throw a NoLayout exception if the type given contains opaques. If true, they will simply be skipped
merge_skip_copyin 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_skipsbecause 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 memory_layout.hh.

void Typelib::load ( Value  v,
InputStream stream 
)

Definition at line 796 of file value_ops.cc.

void Typelib::load ( Value  v,
InputStream stream,
MemoryLayout const &  ops 
)

Definition at line 801 of file value_ops.cc.

void Typelib::load ( uint8_t *  v,
Type const &  type,
InputStream stream,
MemoryLayout const &  ops 
)

Definition at line 803 of file value_ops.cc.

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

Definition at line 833 of file value_ops.cc.

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

Definition at line 838 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 840 of file value_ops.cc.

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

Definition at line 879 of file value_ops.cc.

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

Definition at line 884 of file value_ops.cc.

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

Definition at line 886 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 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 typedisplay.hh.

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

Casts a Value object to a given simple type T

Exceptions:
BadValueCast

Definition at line 43 of file value_cast.hh.

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

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

Exceptions:
BadValueCast

Definition at line 52 of file value_cast.hh.

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

Definition at line 134 of file value.hh.

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

Definition at line 142 of file value.hh.

void Typelib::zero ( Value  v)

Definition at line 212 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 ( uint8_t *  data,
MemoryLayout const &  ops 
)

Definition at line 224 of file value_ops.cc.


Variable Documentation

Definition at line 11 of file typename.hh.

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

Definition at line 13 of file typename.hh.

Definition at line 12 of file typename.hh.



typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Oct 6 2014 03:17:12