RTT::types Namespace Reference

Classes

class  BinaryOp
class  BinaryOperator
struct  BoolTypeInfo
class  BoostArrayTypeInfo
class  carray
class  CArrayTypeInfo
struct  EmptySendHandle
class  EmptyTypeInfo
struct  EnumTypeInfo
class  GlobalsRepository
class  MatrixTypeInfo
class  OperatorRepository
class  RealTimeTypekitPlugin
struct  RTStringTypeInfo
struct  sequence_constructor_datasource
struct  sequence_ctor
struct  sequence_ctor2
struct  sequence_varargs_ctor
struct  SequenceBuilder
class  SequenceTypeInfo
struct  StdStringTypeInfo
struct  StdTypeInfo
struct  stdvector_ctor
struct  stdvector_ctor2
struct  stdvector_varargs_ctor
struct  StdVectorBuilder
struct  StdVectorTemplateTypeInfo
struct  StdVectorTypeInfo
class  StructTypeInfo
struct  TemplateConstructor
class  TemplateTypeInfo
class  TransportPlugin
class  type_discovery
struct  TypeBuilder
class  TypeInfo
struct  TypeInfoName
class  TypeInfoRepository
class  TypekitPlugin
class  TypekitRepository
class  TypeMarshaller
struct  TypeStreamSelector< T, false >
struct  TypeStreamSelector< T, true >
class  TypeTransporter
class  UnaryOp
class  UnaryOperator

Functions

int _EatSpace (std::istream &is, int *countp=NULL)
RTT_API bool composeProperty (const PropertyBag &bag, std::vector< double > &result)
bool RTT_API composePropertyBag (PropertyBag const &sourcebag, PropertyBag &target)
bool RTT_API decomposePropertyBag (PropertyBag const &sourcebag, PropertyBag &target)
bool Eat (std::istream &is, int delim)
bool EatEnd (std::istream &is, int delim)
template<class T >
int get_capacity (T const &cont)
template<class T >
int get_columns (T const &cont)
template<class T >
T::reference get_container_item (T &cont, int index_row, int index_column)
bool get_container_item (std::vector< bool > &cont, int index)
template<class T >
T::reference get_container_item (T &cont, int index)
bool get_container_item_copy (const std::vector< bool > &cont, int index)
template<class T >
T::value_type get_container_item_copy (const T &cont, int index)
template<class T >
int get_rows (T const &cont)
template<class T >
int get_size (T const &cont)
void loadOrocosTypes (TypeInfoRepository::shared_ptr ti)
void loadStdTypes (TypeInfoRepository::shared_ptr ti)
template<typename function >
BinaryOperator< function > * newBinaryOperator (const char *op, function f)
template<class Object >
TypeBuildernewConstructor (Object obj, bool automatic=false)
template<class Function >
TypeBuildernewConstructor (Function *foo, bool automatic=false)
template<typename function >
UnaryOperator< function > * newUnaryOperator (const char *op, function f)
template<typename T >
std::ostream & operator<< (std::ostream &os, const std::vector< T > &vec)
RTT_API std::ostream & operator<< (std::ostream &os, const std::vector< double > &v)
template<typename T >
std::istream & operator>> (std::istream &is, std::vector< T > &vec)
RTT_API std::istream & operator>> (std::istream &os, std::vector< double > &v)
RTT_API
OperatorRepository::shared_ptr 
operators ()
bool RTT_API propertyDecomposition (base::PropertyBase *source, PropertyBag &targetbag, bool recurse=true)
bool RTT_API typeDecomposition (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag, bool recurse=true)
RTT_API
TypeInfoRepository::shared_ptr 
Types ()

Detailed Description

Classes for typekits for describing and handling user data types.


Function Documentation

int RTT::types::_EatSpace ( std::istream &  is,
int *  countp = NULL 
)

Definition at line 45 of file TypeStream-io.cpp.

RTT_API bool RTT::types::composeProperty ( const PropertyBag &  bag,
std::vector< double > &  result 
)

A composeProperty method for composing a property of a vector<double> The dimension of the vector must be less than 100.

Definition at line 50 of file VectorComposition.cpp.

bool RTT_API RTT::types::composePropertyBag ( PropertyBag const &  sourcebag,
PropertyBag target 
)

Uses the type composition to compose all typed properties from a property bag.

For each PropertyBag found with a type not equal to 'PropertyBag', it will first try to use the user's TypeInfo::composeType function and return that in target if it generates a Property. If composeType did not return anything (because it's not implemented), it will try to create an empty target, decompose it and then updated the decomposition with the sourcebag.

Parameters:
sourcebag Contains a PropertyBag to be composed into a known type.
target The target type to compose the source bag into.
Returns:
true if all typed PropertyBags in sourcebag could be composed to a user type, false if one or more compositions failed.

Definition at line 10 of file PropertyComposition.cpp.

bool RTT_API RTT::types::decomposePropertyBag ( PropertyBag const &  sourcebag,
PropertyBag target 
)

Inverse of RTT::types::composePropertyBag(). This function effectively replaces the property introspection mechanism for decomposition.

Parameters:
sourcebag The bag from which to compose the type.
target Contains a C++ type to be composed into a hierarchy of properties.
Returns:
True on success, false otherwise.
See also:
RTT::types::propertyComposition

Definition at line 57 of file PropertyComposition.cpp.

bool RTT::types::Eat ( std::istream &  is,
int  delim 
)

Definition at line 62 of file TypeStream-io.cpp.

bool RTT::types::EatEnd ( std::istream &  is,
int  delim 
)

Definition at line 79 of file TypeStream-io.cpp.

template<class T >
int RTT::types::get_capacity ( T const &  cont  )  [inline]

Returns the capacity of an STL container which has the capacity() member function.

Parameters:
cont A const ref to an STL container.
Returns:
its capacity.

Definition at line 53 of file rtt/types/SequenceTypeInfo.hpp.

template<class T >
int RTT::types::get_columns ( T const &  cont  )  [inline]

Returns the number of columns of a matrix container which has the columns() member function.

Parameters:
cont A const ref to a matrix container.
Returns:
its number of columns.

Definition at line 68 of file MatrixTypeInfo.hpp.

template<class T >
T::reference RTT::types::get_container_item ( T &  cont,
int  index_row,
int  index_column 
) [inline]

Returns a reference to one item in a matrix container.

Parameters:
cont The container to access
index_row The row index of the item to reference
index_column The column index of the item to reference
Returns:
A reference to item index

Definition at line 81 of file MatrixTypeInfo.hpp.

bool RTT::types::get_container_item ( std::vector< bool > &  cont,
int  index 
)

Specialisation for vector<bool>, we don't return references to bits aka std::_Bit_reference. vector<bool> is an outlier and should not be used. Use vector<int> or vector<char> instead.

Parameters:
cont Is a vector<bool>
index The item to read.
Returns:
A copy of the value at position index. not a reference !

Definition at line 45 of file SequenceTypeInfo.cpp.

template<class T >
T::reference RTT::types::get_container_item ( T &  cont,
int  index 
) [inline]

Returns a reference to one item in an STL container.

Note:
vector<bool> is not supported, since it's not an STL container.
Parameters:
cont The container to access
index The item to reference
Returns:
A reference to item index

Definition at line 77 of file rtt/types/SequenceTypeInfo.hpp.

bool RTT::types::get_container_item_copy ( const std::vector< bool > &  cont,
int  index 
)
template<class T >
T::value_type RTT::types::get_container_item_copy ( const T &  cont,
int  index 
) [inline]

Returns a copy to one item in an STL container.

Note:
vector<bool> is not supported, since it's not an STL container.
Parameters:
cont The container to access
index The item to extract from the sequence
Returns:
A copy of item index

Definition at line 92 of file rtt/types/SequenceTypeInfo.hpp.

template<class T >
int RTT::types::get_rows ( T const &  cont  )  [inline]

Returns the number of rows of a matrix container which has the rows() member function.

Parameters:
cont A const ref to a matrix container.
Returns:
its number of rows.

Definition at line 57 of file MatrixTypeInfo.hpp.

template<class T >
int RTT::types::get_size ( T const &  cont  )  [inline]

Returns the size of an STL container which has the size() member function.

Parameters:
cont A const ref to an STL container.
Returns:
its size.

Definition at line 64 of file rtt/types/SequenceTypeInfo.hpp.

void RTT::types::loadOrocosTypes ( TypeInfoRepository::shared_ptr  ti  ) 

Definition at line 66 of file RealTimeTypekitTypes2.cpp.

void RTT::types::loadStdTypes ( TypeInfoRepository::shared_ptr  ti  ) 
template<typename function >
BinaryOperator< function > * RTT::types::newBinaryOperator ( const char *  op,
function  f 
) [inline]

helper function to create a new BinaryOperator

Definition at line 138 of file rtt/types/OperatorTypes.hpp.

template<class Object >
TypeBuilder * RTT::types::newConstructor ( Object  obj,
bool  automatic = false 
) [inline]

Create a new Constructor.

Parameters:
obj A function object which has operator().
automatic Set to true to allow automatic conversion (without warning) to this type.
Returns:
a Constructor object suitable for the type system.

Definition at line 135 of file rtt/types/TemplateConstructor.hpp.

template<class Function >
TypeBuilder * RTT::types::newConstructor ( Function *  foo,
bool  automatic = false 
) [inline]

Create a new Constructor.

Parameters:
foo A pointer to the 'C' function which creates an object.
automatic Set to true to allow automatic conversion (without warning) to this type.
Returns:
a Constructor object suitable for the type system.

Definition at line 122 of file rtt/types/TemplateConstructor.hpp.

template<typename function >
UnaryOperator< function > * RTT::types::newUnaryOperator ( const char *  op,
function  f 
) [inline]

helper function to create a new UnaryOperator

Definition at line 128 of file rtt/types/OperatorTypes.hpp.

template<typename T >
std::ostream & RTT::types::operator<< ( std::ostream &  os,
const std::vector< T > &  vec 
) [inline]

Definition at line 61 of file rtt/types/VectorTemplateComposition.hpp.

RTT_API std::ostream & RTT::types::operator<< ( std::ostream &  os,
const std::vector< double > &  v 
)

Definition at line 46 of file TypeStream.cpp.

template<typename T >
std::istream & RTT::types::operator>> ( std::istream &  is,
std::vector< T > &  vec 
) [inline]

Definition at line 74 of file rtt/types/VectorTemplateComposition.hpp.

RTT_API std::istream & RTT::types::operator>> ( std::istream &  os,
std::vector< double > &  v 
)

Definition at line 61 of file TypeStream.cpp.

RTT_API OperatorRepository::shared_ptr RTT::types::operators (  ) 

This global function provides the short notation for OperatorRepository::Instance()

Definition at line 132 of file Operators.cpp.

bool RTT_API RTT::types::propertyDecomposition ( base::PropertyBase source,
PropertyBag targetbag,
bool  recurse = true 
)

Uses the type decomposition to decompose a property into a property bag that refers to all its parts.

It will first try to use the user's TypeInfo::decomposeType function and return that in targetbag if it generates a PropertyBag. If it generated something else than a PropertyBag, this function returns false. If decomposeType did not return anything, it will try the TypeInfo::getMember() approach to decompose source into the targetbag. If no members are returned, this function fails.

In case the source type info supports it, each modification of a part in the targetbag will modify source too. This is so for typekits using the boost::serialization functions in combination with TypeInfo::getMember(). In case the type decompositions were written manually using TypeInfo::decomposeType(), this relation can no longer be guaranteed, and a composition step using TypeInfo::composeType() of the same type must be tried to update source with the modifications in targetbag.

For the TypeInfo::getMember() method: This function can only work if every part of the source is known by the RTT type system. Only the parts of source that are assignable will be decomposed. The read-only parts will be silently omitted.

Parameters:
source Contains a C++ type to be decomposed into a hierarchy of properties.
targetbag The bag in which to place the result.
Returns:
True on success, false otherwise.

Definition at line 63 of file PropertyDecomposition.cpp.

bool RTT_API RTT::types::typeDecomposition ( base::DataSourceBase::shared_ptr  source,
PropertyBag targetbag,
bool  recurse = true 
)

Identical to RTT::types::propertyDecomposition(), but takes a DataSourceBase as source.

Parameters:
source Contains a C++ type to be decomposed into a hierarchy of properties.
targetbag The bag in which to place the result.
Returns:
True on success, false otherwise.
See also:
RTT::types::propertyDecomposition

Definition at line 73 of file PropertyDecomposition.cpp.

RTT_API TypeInfoRepository::shared_ptr RTT::types::Types (  ) 

Obtain a pointer to the global type system. This is a short notation for TypeInfoRepository::Instance().

Definition at line 48 of file Types.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:50:17 2013