40 #ifndef MULTIVECTOR_COMPOSITION_HPP 41 #define MULTIVECTOR_COMPOSITION_HPP 44 #include "../Property.hpp" 45 #include "../PropertyBag.hpp" 46 #include "../Logger.hpp" 55 template<
class T,
int S>
63 result.
value().add( dimension );
65 std::stringstream data_name;
67 for (
int i=0; i < dimension->
get() ; i++)
70 result.value().add(
new Property<T>(data_name.str(),
"",vec[i]) );
79 template<
class T,
int S>
87 result.
value().add( dimension );
89 std::stringstream data_name;
91 for (
int i=0; i < dimension->
get() ; i++)
94 result.value().add(
new Property<T>(data_name.str(),
"",vec[i]) );
106 template<
class T,
int S>
121 v_base = v_bag->
get().find(
"Size");
124 << result.getName() <<
" : could not find property \"Size\"."<<
Logger::endl;
130 << result.getName() <<
" : Expected \"Size\" to be of type short."<<
Logger::endl;
133 int dimension = dim->
get();
135 std::stringstream data_name;
138 for (
int i = 0; i < dimension ; i++)
142 if ( element == 0 ) {
144 <<
": Data element "<< data_name.str() <<
" not found !" 153 <<
" got type " << element->
getType()
157 result.value()[i] = comp->
get();
166 << result.getName() <<
" : type mismatch, got type '"<< v_bag->
get().getType() <<
"'"<<
Logger::endl;
169 << result.getName() <<
" : not a PropertyBag."<<
Logger::endl;
DataSourceType get() const
Get a copy of the value of the property.
Base class for all properties.
virtual void introspect(PropertyBase *p)
Fall-back function of the last resort when the type is not decomposable and not known to the introspe...
This class contains all known types to Orocos.
A container for holding references to properties.
reference_t value()
Access to the value of the Property.
base::PropertyBase * find(const std::string &name) const
Find the base::PropertyBase with name name.
A property represents a named value of any type with a description.
static std::ostream & endl(std::ostream &__os)
virtual std::string getType() const =0
Returns the type of this PropertyBase.
virtual const types::TypeInfo * getTypeInfo() const
Returns the types::TypeInfo object of this Property.
TypeInfoRepository::shared_ptr Types()
Obtain a pointer to the global type system.
An interface which all classes which wish to visit a Property should implement.
void deleteProperties(PropertyBag &target)
This function iterates over a PropertyBag and deletes all Property objects in it without recursion...
static Logger & log()
As Instance(), but more userfriendly.
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.
static std::string GetType()
Return usefull type info in a human readable format.
virtual DataSourceBase::shared_ptr getDataSource() const =0
Get an assignable base::DataSource through which this PropertyBase can be manipulated.