39 #ifndef ORO_TEMPLATE_BOOSTARRAY_INFO_HPP 40 #define ORO_TEMPLATE_BOOSTARRAY_INFO_HPP 43 #include "../internal/ArrayPartDataSource.hpp" 45 #include <boost/lexical_cast.hpp> 46 #include <boost/array.hpp> 67 template<
typename T,
bool has_ostream = false>
93 std::vector<std::string> result;
94 result.push_back(
"size");
95 result.push_back(
"capacity");
107 if (name ==
"size" || name ==
"capacity") {
113 unsigned int indx = boost::lexical_cast<
unsigned int>(name);
117 log(
Error) <<
"BoostArrayTypeInfo: No such part (or invalid index): " << name << endlog();
134 if (id_name->
get() ==
"size" || id_name->
get() ==
"capacity") {
142 log(
Error) <<
"BoostArrayTypeInfo: No such part (or invalid index): " << id_name->
get() << id_indx->
get() << endlog();
166 if(result.size() != source.
size()) {
167 log(
Error) <<
"Refusing to compose Boost Arrays from a property list of different size. Use the same number of properties as the C++ boost array size." << endlog();
180 assert(result.size() == source.
size());
181 assert(source.
size() == target.size());
182 assert(source.
size() == decomp.size());
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.
virtual base::DataSourceBase::shared_ptr decomposeType(base::DataSourceBase::shared_ptr source) const
Use getMember() for decomposition...
boost::call_traits< value_t >::reference reference_t
const std::string & getType() const
Template for data types that are of type boost::array<U,int>.
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.
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.
virtual void set(param_t t)=0
Set this DataSource with a value.
bool RTT_API composePropertyBag(PropertyBag const &sourcebag, PropertyBag &target)
Uses the type composition to compose all typed properties from a property bag.
void setCompositionFactory(CompositionFactoryPtr cf)
A DataSource which is used to manipulate a reference to an external value.
A container for holding references to properties.
A factory for composing/decomposing and converting types to a form suitable for persistent storage...
A DataSource which is used to manipulate a reference to a part of a data source holding a C-style arr...
bool installTypeInfoObject(TypeInfo *ti)
Installs the type info object in the global data source type info handler and adds any additional fea...
This file implements a 'level 2' type archiver of serializable objects and uses the standard BOOST se...
virtual const_reference_t rvalue() const =0
Get a const reference to the value of this DataSource.
A class for representing a user type, and which can build instances of that type. ...
void setMemberFactory(MemberFactoryPtr mf)
bool installTypeInfoObject(TypeInfo *ti)
Installs the type info object in the global data source type info handler and adds any additional fea...
TypeInfoRepository::shared_ptr Types()
Obtain a pointer to the global type system.
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
BoostArrayTypeInfo(std::string name)
A DataSource which holds a constant value and returns it in its get() method.
virtual bool composeType(base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const
Compose a type (target) from a DataSourceBase (source) containing its members.
A DataSource which has set() methods.
static DataSource< T > * narrow(base::DataSourceBase *db)
This method narrows a base::DataSourceBase to a typeded DataSource, possibly returning a new object...
virtual std::vector< std::string > getMemberNames() const
Returns the list of struct member names of this type.
bool typeDecomposition(base::DataSourceBase::shared_ptr dsb, PropertyBag &targetbag, bool recurse)
Identical to RTT::types::propertyDecomposition(), but takes a DataSourceBase as 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.
size_t size() const
Get the number of Properties in this bag.
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...
boost::shared_ptr< TypeInfoRepository > shared_ptr
This template class allows primitive types, which are not sent over ports, to be added to Orocos...
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > getSharedPtr()