Orocos Real-Time Toolkit
2.9.0
|
Classes for typekits for describing and handling user data types. More...
Classes | |
class | BinaryOp |
class | BinaryOperator |
An operator which reads a two DataSources and returns a modified result. More... | |
struct | BoolTypeInfo |
Write boolean as 'true' or 'false'. More... | |
class | BoostArrayTypeInfo |
Template for data types that are of type boost::array<U,int>. More... | |
class | carray |
Wraps a C array such that we can return a C array from a DataSource. More... | |
class | CArrayTypeInfo |
Template for data types that are C-style arrays. More... | |
class | CompositionFactory |
A factory for composing/decomposing and converting types to a form suitable for persistent storage, such as an XML file. More... | |
struct | EmptySendHandle |
This is a placeholder for scripting purposes. More... | |
class | EmptyTypeInfo |
Empty implementation of TypeInfo interface. More... | |
struct | EnumTypeInfo |
Type information for Enum types for which they are convertible to int. More... | |
class | GlobalsRepository |
An RTT::ConfigurationInterface for holding global variables. More... | |
class | MemberFactory |
class | OperatorRepository |
This class builds on upon construction all expression operators known to Orocos. More... | |
class | PrimitiveSequenceTypeInfo |
New-style SequenceTypeInfo which offers type info for sequences which can NOT be sent over flow ports. More... | |
class | PrimitiveTypeInfo |
This template class allows primitive types, which are not sent over ports, to be added to Orocos. More... | |
class | RealTimeTypekitPlugin |
This interface defines the types of the realTime package. More... | |
struct | RTStringTypeInfo |
Standard string specialisation that removes decomposition. More... | |
struct | sequence_constructor_datasource |
Helper DataSource for constructing sequences with a variable number of parameters. More... | |
struct | sequence_ctor |
Sequence constructor which takes the number of elements in the sequence. More... | |
struct | sequence_ctor2 |
Constructs a sequence from the number of elements and a prototype element for these elements. More... | |
struct | sequence_varargs_ctor |
See NArityDataSource which requires a function object like this one. More... | |
struct | SequenceBuilder |
Constructs an sequence with n elements, which are given upon construction time. More... | |
class | SequenceTypeInfo |
Old-style SequenceTypeInfo which offers type info for sequences which can be sent over flow ports. More... | |
class | SequenceTypeInfoBase |
Template for data types that are C++ STL Sequences with operator[], size() and capacity() methods. More... | |
struct | StdStringTypeInfo |
Standard string specialisation that removes decomposition. More... | |
struct | StdTypeInfo |
Type information for standard C types or structs of which no introspection is required. More... | |
struct | StdVectorBuilder |
struct | StdVectorTemplateTypeInfo |
Template class for std::vector<T> typekits, providing a alternative demarshalling function for properties and optionally ostream printing. More... | |
struct | StdVectorTypeInfo |
This class tells Orocos how to handle std::vector<double>. More... | |
class | StreamFactory |
class | StructTypeInfo |
Type Information for data types that are structs, ie all user data types fall in this category. More... | |
class | TemplateCompositionFactory |
class | TemplateConnFactory |
struct | TemplateConstructor |
The constructor classes allow to define type constructors or type conversions (convert type B from type A). More... | |
class | TemplateTypeInfo |
This template class allows user types to be used in all Orocos primitives. More... | |
class | TemplateValueFactory |
class | TransportPlugin |
A class which registers TypeTransporter instances to types. More... | |
class | type_discovery |
This archive is capable of decomposing objects of serialization level 1 and 2 into part data sources. More... | |
struct | TypeConstructor |
This interface describes how constructors work. More... | |
class | TypeInfo |
A class for representing a user type, and which can build instances of that type. More... | |
class | TypeInfoGenerator |
All generator classes inherit from this object in order to allow them to be added to the TypeInfoRepository. More... | |
struct | TypeInfoName |
This helper class allows only type names to be added to Orocos. More... | |
class | TypeInfoRepository |
This class contains all known types to Orocos. More... | |
class | TypekitPlugin |
This interface defines how additional typekits are loaded into Orocos. More... | |
class | TypekitRepository |
This class allows the RTT to be extended with additional typekits (TypekitPlugin), such as for kinematics or any library foreign to Orocos. More... | |
class | TypeMarshaller |
Objects implementing this interface have the capability to convert data sources to and from a binary representation. More... | |
struct | TypeStreamSelector |
struct | TypeStreamSelector< T, false > |
struct | TypeStreamSelector< T, true > |
class | TypeTransporter |
This interface defines the function a transport protocol must support in order to allow Orocos components to remotely communicate one data type. More... | |
class | UnaryOp |
UnaryOperator contains information on some unary operator that operates on one arg of a certain type. More... | |
class | UnaryOperator |
An operator which reads a single internal::DataSource and returns a modified result. More... | |
class | ValueFactory |
Creates all value objects of a certain type. More... | |
Typedefs | |
typedef boost::shared_ptr< CompositionFactory > | CompositionFactoryPtr |
typedef boost::shared_ptr< MemberFactory > | MemberFactoryPtr |
typedef boost::shared_ptr< StreamFactory > | StreamFactoryPtr |
typedef boost::shared_ptr< internal::ConnFactory > | ConnFactoryPtr |
typedef boost::shared_ptr< ValueFactory > | ValueFactoryPtr |
Functions | |
void | loadStdTypes (TypeInfoRepository::shared_ptr ti) |
void | loadOrocosTypes (TypeInfoRepository::shared_ptr ti) |
RTT_API OperatorRepository::shared_ptr | operators () |
This global function provides the short notation for OperatorRepository::Instance() More... | |
template<typename function > | |
UnaryOperator< function > * | newUnaryOperator (const char *op, function f) |
helper function to create a new UnaryOperator More... | |
template<typename function > | |
BinaryOperator< function > * | newBinaryOperator (const char *op, function f) |
helper function to create a new BinaryOperator More... | |
bool RTT_API | composePropertyBag (PropertyBag const &sourcebag, PropertyBag &target) |
Uses the type composition to compose all typed properties from a property bag. More... | |
bool RTT_API | decomposePropertyBag (PropertyBag const &sourcebag, PropertyBag &target) |
Inverse of RTT::types::composePropertyBag(). More... | |
bool | 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. More... | |
bool | typeDecomposition (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag, bool recurse=true) |
Identical to RTT::types::propertyDecomposition(), but takes a DataSourceBase as source. More... | |
bool | get_container_item (std::vector< bool > &cont, int index) |
Specialisation for vector<bool>, we don't return references to bits aka std::_Bit_reference. More... | |
bool | get_container_item_copy (const std::vector< bool > &cont, int index) |
template<class T > | |
int | get_capacity (T const &cont) |
Returns the capacity of an STL container which has the capacity() member function. More... | |
template<class T > | |
int | get_size (T const &cont) |
Returns the size of an STL container which has the size() member function. More... | |
template<class T > | |
T::reference | get_container_item (T &cont, int index) |
Returns a reference to one item in an STL container. More... | |
template<class T > | |
T::value_type | get_container_item_copy (const T &cont, int index) |
Returns a copy to one item in an STL container. More... | |
template<class Function > | |
TypeConstructor * | newConstructor (Function *foo, bool automatic=false) |
Create a new Constructor. More... | |
template<class Object > | |
TypeConstructor * | newConstructor (Object obj, bool automatic=false) |
Create a new Constructor. More... | |
TypeInfoRepository::shared_ptr | Types () |
Obtain a pointer to the global type system. More... | |
int | _EatSpace (std::istream &is, int *countp) |
bool | Eat (std::istream &is, int delim) |
bool | EatEnd (std::istream &is, int delim) |
std::ostream & | operator<< (std::ostream &os, const std::vector< double > &v) |
std::istream & | operator>> (std::istream &os, std::vector< double > &v) |
template<class T > | |
bool | composeTemplateProperty (const PropertyBag &bag, T &result) |
Classes for typekits for describing and handling user data types.
typedef boost::shared_ptr<CompositionFactory> RTT::types::CompositionFactoryPtr |
Definition at line 65 of file CompositionFactory.hpp.
typedef boost::shared_ptr<internal::ConnFactory> RTT::types::ConnFactoryPtr |
Definition at line 59 of file TypeInfo.hpp.
typedef boost::shared_ptr<MemberFactory> RTT::types::MemberFactoryPtr |
Definition at line 75 of file MemberFactory.hpp.
typedef boost::shared_ptr<StreamFactory> RTT::types::StreamFactoryPtr |
Definition at line 55 of file StreamFactory.hpp.
typedef boost::shared_ptr<ValueFactory> RTT::types::ValueFactoryPtr |
Definition at line 78 of file ValueFactory.hpp.
int RTT::types::_EatSpace | ( | std::istream & | is, |
int * | countp | ||
) |
Definition at line 47 of file TypeStream-io.cpp.
bool 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 use the type's TypeInfo::composeType function and return that in target if it generates a Property.
sourcebag | Contains a PropertyBag to be composed into a known type. |
target | The target type to compose the source bag into. |
Definition at line 10 of file PropertyComposition.cpp.
References RTT::PropertyBag::begin(), RTT::types::TypeInfo::buildProperty(), RTT::types::TypeInfo::composeType(), RTT::Debug, RTT::PropertyBag::empty(), RTT::PropertyBag::end(), RTT::Error, RTT::base::PropertyBase::getDataSource(), RTT::Property< T >::getDataSource(), RTT::base::PropertyBase::getDescription(), RTT::base::PropertyBase::getName(), RTT::base::PropertyBase::getType(), RTT::PropertyBag::ownProperty(), RTT::base::PropertyBase::ready(), Types(), and RTT::Property< T >::value().
Referenced by RTT::types::BoostArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::SequenceTypeInfoBase< std::vector< double > >::composeType(), RTT::types::CArrayTypeInfo< T, has_ostream >::composeType(), RTT::marsh::PropertyLoader::load(), and RTT::marsh::PropertyLoader::store().
bool RTT::types::composeTemplateProperty | ( | const PropertyBag & | bag, |
T & | result | ||
) |
Definition at line 49 of file VectorTemplateComposition.hpp.
References RTT::Logger::endl(), RTT::Logger::Error, RTT::Property< T >::get(), RTT::PropertyBag::getItem(), RTT::base::PropertyBase::getName(), RTT::base::PropertyBase::getType(), RTT::PropertyBag::getType(), RTT::internal::DataSourceTypeInfo< T >::getTypeName(), RTT::Logger::log(), RTT::PropertyBag::size(), and Types().
Referenced by RTT::types::StdVectorTemplateTypeInfo< T, has_ostream >::composeType(), and RTT::types::SequenceTypeInfoBase< std::vector< double > >::composeType().
bool RTT::types::decomposePropertyBag | ( | PropertyBag const & | sourcebag, |
PropertyBag & | target | ||
) |
Inverse of RTT::types::composePropertyBag().
This function effectively replaces the property introspection mechanism for decomposition.
sourcebag | The bag from which to compose the type. |
target | Contains a C++ type to be composed into a hierarchy of properties. |
Definition at line 60 of file PropertyComposition.cpp.
References RTT::PropertyBag::begin(), RTT::types::TypeInfo::buildProperty(), RTT::Debug, RTT::PropertyBag::empty(), RTT::PropertyBag::end(), RTT::Error, RTT::base::PropertyBase::getDescription(), RTT::base::PropertyBase::getName(), RTT::base::PropertyBase::getType(), RTT::base::PropertyBase::getTypeInfo(), RTT::internal::DataSource< T >::narrow(), RTT::PropertyBag::ownProperty(), propertyDecomposition(), RTT::base::PropertyBase::ready(), RTT::internal::DataSource< T >::rvalue(), RTT::Property< T >::rvalue(), and RTT::Property< T >::value().
bool RTT::types::Eat | ( | std::istream & | is, |
int | delim | ||
) |
Definition at line 64 of file TypeStream-io.cpp.
References _EatSpace().
Referenced by operator>>().
bool RTT::types::EatEnd | ( | std::istream & | is, |
int | delim | ||
) |
Definition at line 81 of file TypeStream-io.cpp.
References _EatSpace().
Referenced by operator>>().
int RTT::types::get_capacity | ( | T const & | cont | ) |
Returns the capacity of an STL container which has the capacity() member function.
cont | A const ref to an STL container. |
Definition at line 61 of file SequenceTypeInfoBase.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.
cont | Is a vector<bool> |
index | The item to read. |
Definition at line 45 of file SequenceTypeInfoBase.cpp.
Referenced by get_container_item_copy().
T::reference RTT::types::get_container_item | ( | T & | cont, |
int | index | ||
) |
Returns a reference to one item in an STL container.
cont | The container to access |
index | The item to reference |
Definition at line 85 of file SequenceTypeInfoBase.hpp.
References RTT::internal::NA< T >::na().
bool RTT::types::get_container_item_copy | ( | const std::vector< bool > & | cont, |
int | index | ||
) |
Definition at line 52 of file SequenceTypeInfoBase.cpp.
Referenced by get_container_item_copy().
T::value_type RTT::types::get_container_item_copy | ( | const T & | cont, |
int | index | ||
) |
Returns a copy to one item in an STL container.
cont | The container to access |
index | The item to extract from the sequence |
Definition at line 100 of file SequenceTypeInfoBase.hpp.
References get_container_item(), get_container_item_copy(), and RTT::internal::NA< T >::na().
int RTT::types::get_size | ( | T const & | cont | ) |
Returns the size of an STL container which has the size() member function.
cont | A const ref to an STL container. |
Definition at line 72 of file SequenceTypeInfoBase.hpp.
void RTT::types::loadOrocosTypes | ( | TypeInfoRepository::shared_ptr | ti | ) |
Definition at line 69 of file RealTimeTypekitTypes2.cpp.
Referenced by RTT::types::RealTimeTypekitPlugin::loadTypes().
void RTT::types::loadStdTypes | ( | TypeInfoRepository::shared_ptr | ti | ) |
Definition at line 53 of file RealTimeTypekitStdTypes.cpp.
Referenced by RTT::types::RealTimeTypekitPlugin::loadTypes().
BinaryOperator<function>* RTT::types::newBinaryOperator | ( | const char * | op, |
function | f | ||
) |
helper function to create a new BinaryOperator
Definition at line 138 of file OperatorTypes.hpp.
Referenced by RTT::types::RealTimeTypekitPlugin::loadOperators().
TypeConstructor* RTT::types::newConstructor | ( | Function * | foo, |
bool | automatic = false |
||
) |
Create a new Constructor.
foo | A pointer to the 'C' function which creates an object. |
automatic | Set to true to allow automatic conversion (without warning) to this type. |
Definition at line 122 of file TemplateConstructor.hpp.
References RTT::types::TemplateConstructor< S >::automatic.
Referenced by RTT::types::EnumTypeInfo< T >::installTypeInfoObject(), RTT::types::SequenceTypeInfoBase< std::vector< double > >::installTypeInfoObject(), and RTT::types::RealTimeTypekitPlugin::loadConstructors().
TypeConstructor* RTT::types::newConstructor | ( | Object | obj, |
bool | automatic = false |
||
) |
Create a new Constructor.
obj | A function object which has operator(). |
automatic | Set to true to allow automatic conversion (without warning) to this type. |
Definition at line 135 of file TemplateConstructor.hpp.
References RTT::types::TemplateConstructor< S >::automatic.
UnaryOperator<function>* RTT::types::newUnaryOperator | ( | const char * | op, |
function | f | ||
) |
helper function to create a new UnaryOperator
Definition at line 128 of file OperatorTypes.hpp.
Referenced by RTT::types::RealTimeTypekitPlugin::loadOperators().
RTT_API std::ostream & RTT::types::operator<< | ( | std::ostream & | os, |
const std::vector< double > & | v | ||
) |
Definition at line 46 of file TypeStream.cpp.
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.
References RTT::types::OperatorRepository::Instance().
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.
source | Contains a C++ type to be decomposed into a hierarchy of properties. |
targetbag | The bag in which to place the result. |
Definition at line 63 of file PropertyDecomposition.cpp.
References RTT::base::PropertyBase::getDataSource(), and typeDecomposition().
Referenced by decomposePropertyBag(), RTT::base::PropertyBagVisitor::introspectAndDecompose(), and typeDecomposition().
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.
source | Contains a C++ type to be decomposed into a hierarchy of properties. |
targetbag | The bag in which to place the result. |
Definition at line 73 of file PropertyDecomposition.cpp.
References RTT::PropertyBag::add(), RTT::types::TypeInfo::buildProperty(), RTT::Debug, RTT::PropertyBag::empty(), RTT::Error, RTT::internal::DataSource< T >::get(), RTT::base::PropertyBase::getDataSource(), RTT::base::PropertyBase::getTypeInfo(), RTT::PropertyBag::ownProperty(), propertyDecomposition(), RTT::internal::DataSource< T >::rvalue(), RTT::PropertyBag::setType(), and RTT::Warning.
Referenced by RTT::types::BoostArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::CArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::StructTypeInfo< T, has_ostream >::composeTypeImpl(), and propertyDecomposition().
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.
References RTT::types::TypeInfoRepository::Instance().
Referenced by RTT::extras::composeProperty(), composePropertyBag(), composeTemplateProperty(), RTT::types::BoostArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::CArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::StructTypeInfo< T, has_ostream >::composeTypeImpl(), RTT::corba::CorbaOperationCallerFactory::getArgumentType(), RTT::corba::CorbaOperationCallerFactory::getCollectType(), RTT::types::EnumTypeInfo< T >::installTypeInfoObject(), RTT::corba::CorbaOperationCallerFactory::produce(), RTT::refreshProperties(), RTT::scripting::ConstructorParser::seen_type_name(), and RTT::updateProperties().