41 #include "../Logger.hpp" 42 #include "../Property.hpp" 50 if ( !target.
empty() ) {
51 log(
Error) <<
"composePropertyBag: target bag must be empty."<<
endlog();
54 bool has_error =
false;
56 for( ; sit != sourcebag.
end(); ++sit) {
60 if ( isbag.
ready() && isbag.
value().getType() !=
"PropertyBag") {
64 log(
Error) <<
"Could not compose unknown type '" << isbag.
value().getType() <<
"'." <<
endlog();
73 log(
Error) <<
"The type '" << isbag.
value().getType() <<
"' did not provide a type composition function, but I need one to compose it from a PropertyBag." <<
endlog();
79 if ( isbag.
ready() ) {
100 if ( !target.
empty() ) {
101 log(
Error) <<
"decomposePropertyBag: target bag must be empty."<<
endlog();
105 while( sit != sourcebag.
end()) {
109 if ( isbag.
ready() ) {
112 newtarget->
value().setType( isbag.
rvalue().getType() );
115 assert(
false &&
"internal error in decomposePropertyBag.");
119 log(
Debug) <<
"Checking for decompose "<< (*sit)->getName() <<
endlog();
125 if ( dsb == (*sit)->getDataSource() ) {
134 newtarget->
value().setType( bagds->
rvalue().getType() );
137 assert(
false &&
"internal error in decomposePropertyBag.");
143 log(
Error) <<
"Failed to create a property of decomposed data of type "<<(*sit)->getType() <<
endlog();
virtual base::DataSourceBase::shared_ptr getDataSource() const
bool composeType(base::DataSourceBase::shared_ptr source, base::DataSourceBase::shared_ptr target) const
bool propertyDecomposition(base::PropertyBase *source, PropertyBag &targetbag, bool recurse)
bool RTT_API composePropertyBag(PropertyBag const &sourcebag, PropertyBag &target)
const_reference_t rvalue() const
A container for holding references to properties.
bool ownProperty(base::PropertyBase *p)
bool RTT_API decomposePropertyBag(PropertyBag const &sourcebag, PropertyBag &target)
virtual const_reference_t rvalue() const =0
virtual std::string getType() const =0
const std::string & getDescription() const
base::PropertyBase * buildProperty(const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
TypeInfoRepository::shared_ptr Types()
Properties::const_iterator const_iterator
boost::intrusive_ptr< DataSource< T > > shared_ptr
static DataSource< T > * narrow(base::DataSourceBase *db)
const std::string & getName() const
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
static Logger::LogFunction endlog()
virtual DataSourceBase::shared_ptr getDataSource() const =0
virtual const types::TypeInfo * getTypeInfo() const =0