39 #ifndef ORO_STRUCT_TYPE_INFO_HPP 40 #define ORO_STRUCT_TYPE_INFO_HPP 61 template<
typename T,
bool has_ostream = false>
62 class StructTypeInfo:
public TemplateTypeInfo<T, has_ostream>,
public MemberFactory
97 assert(
false &&
"You're doing something new and exotic. Contact the Orocos-dev mailing list.");
116 log(
Error) <<
"Wrong call to type info function " + this->
getTypeName() <<
"'s getMember() can not process "<< item->getTypeName() <<endlog();
135 log(
Error) <<
"Wrong call to type info function " + this->
getTypeName() <<
"'s getMember() can not process "<< item->getTypeName() <<endlog();
DataSource is a base class representing a generic way to read data of type T.
virtual result_t get() const =0
Return the data as type T.
This template class allows user types to be used in all Orocos primitives.
boost::call_traits< value_t >::reference reference_t
const std::string & getType() const
virtual void set(param_t t)=0
Set this DataSource with a value.
bool installTypeInfoObject(TypeInfo *ti)
Installs the type info object in the global data source type info handler and adds any additional fea...
virtual bool resize(base::DataSourceBase::shared_ptr arg, int size) const
Tries to resize a data source in case it's a resizable sequence.
A DataSource which is used to manipulate a reference to an external value.
A container for holding references to properties.
base::DataSourceBase::shared_ptr discoverMember(T &t, const std::string name)
This function discovers a single part of a serializable struct and returns an assignable datasource t...
PartNames mnames
The names of the parts of the parent struct.
StructTypeInfo(std::string name)
virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item, const std::string &name) const
Returns a member of a given data source struct identified by its name.
This file implements a 'level 2' type archiver of serializable objects and uses the standard BOOST se...
virtual const std::string & getTypeName() const
Return the type name for which this generator generates type info features.
virtual std::vector< std::string > getMemberNames() const
Returns the list of struct member names of this type.
A class for representing a user type, and which can build instances of that type. ...
void setMemberFactory(MemberFactoryPtr mf)
virtual bool composeTypeImpl(const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const
Implementation that updates result with the matching parts in source Relies on the fact that getMembe...
TypeInfoRepository::shared_ptr Types()
Obtain a pointer to the global type system.
Type Information for data types that are structs, ie all user data types fall in this category...
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
A DataSource which has set() methods.
bool installTypeInfoObject(TypeInfo *ti)
Installs the type info object in the global data source type info handler and adds any additional fea...
virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item, base::DataSourceBase::shared_ptr id) const
Returns a member of a given data source identified by a data source id.
This archive is capable of decomposing objects of serialization level 1 and 2 into part data sources...
bool typeDecomposition(base::DataSourceBase::shared_ptr dsb, PropertyBag &targetbag, bool recurse)
Identical to RTT::types::propertyDecomposition(), but takes a DataSourceBase as source.
Object that may receive a reference to some data by means of a pointer or data source.
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
void ref() const
Increase the reference count by one.
bool refreshProperties(const PropertyBag &target, const PropertyBag &source, bool allprops)
This function refreshes the values of the properties in one PropertyBag with the values of the proper...
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
boost::shared_ptr< TypeInfoRepository > shared_ptr
bool referenceMember(internal::Reference *ref, T &t, const std::string name)
This function discovers a single part of a serializable struct and sets a reference to that member of...
virtual bool getMember(internal::Reference *ref, base::DataSourceBase::shared_ptr item, const std::string &name) const
Stores a reference to a member of a struct identified by its name.
void discover(T &t)
This function discovers all parts of a serializable struct and creates a DataSource object for each m...
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > getSharedPtr()