70 #include "ConfigurationInterfaceC.h" 74 #include "../../PropertyBag.hpp" 75 #include "../../Property.hpp" 76 #include "../../rtt-detail-fwd.hpp" 84 :mar (ar), mbag(0), mpoa( PortableServer::POA::_duplicate(the_poa))
89 :mar (0), mbag(bag), mpoa( PortableServer::POA::_duplicate(the_poa))
95 return PortableServer::POA::_duplicate(mpoa);
127 ::RTT::corba::CConfigurationInterface::CAttributeNames_var ret = new ::RTT::corba::CConfigurationInterface::CAttributeNames();
131 ret->length( names.size() );
132 for(
size_t i=0; i != names.size(); ++i)
133 ret[i] = CORBA::string_dup( names[i].c_str() );
140 ::RTT::corba::CConfigurationInterface::CPropertyNames_var ret = new ::RTT::corba::CConfigurationInterface::CPropertyNames();
147 ret->length( allprops.size() );
148 vector<string>::iterator it = allprops.begin();
149 vector<string>::iterator dit = alldescs.begin();
151 for( ; it != allprops.end(); ++it, ++index, ++dit) {
153 prop.
name = CORBA::string_dup( it->c_str() );
154 prop.
description = CORBA::string_dup( dit->c_str() );
164 return new CORBA::Any();
166 const TypeInfo* ti = ds->getTypeInfo();
171 }
catch(std::exception
const& e) {
178 const ::CORBA::Any & value)
183 const TypeInfo* ti = ds->getTypeInfo();
195 return new CORBA::Any();
198 log(
Error) <<
"CConfigurationInterface: no such property: " << name <<
". Returning empty CORBA::Any."<<endlog();
199 return new CORBA::Any();
201 const TypeInfo* ti = ds->getTypeInfo();
206 }
catch(std::exception
const& e) {
213 const ::CORBA::Any & value)
220 const TypeInfo* ti = ds->getTypeInfo();
244 return CORBA::string_dup( ds->getType().c_str() );
245 return CORBA::string_dup(
"na" );
253 return CORBA::string_dup( ds->getTypeName().c_str() );
254 return CORBA::string_dup(
"na" );
262 std::string result = ds->toString();
263 return CORBA::string_dup( result.c_str() );
265 return CORBA::string_dup(
"na" );
269 const char* name,
const char* value
275 if ( ds->getTypeInfo()->fromString( value, ds ) ) {
276 RTT::log(
RTT::Error) <<
"corba::CConfigurationInterface: Could not assign string to "<< ds->getType() <<
"." <<RTT::endlog();
293 return CORBA::string_dup( ds->getType().c_str() );
294 return CORBA::string_dup(
"na" );
302 return CORBA::string_dup( ds->getTypeName().c_str() );
303 return CORBA::string_dup(
"na" );
311 std::string result = ds->toString();
312 return CORBA::string_dup( result.c_str() );
314 return CORBA::string_dup(
"na" );
318 const char* name,
const char* value
324 if ( ds->getTypeInfo()->fromString( value, ds ) ) {
325 RTT::log(
RTT::Error) <<
"corba::CConfigurationInterface: Could not assign string to "<< ds->getType() <<
"." <<RTT::endlog();
bool hasAttribute(const std::string &name) const
Check if an attribute is present in this interface.
virtual ::CORBA::Boolean setAttribute(const char *name, const ::CORBA::Any &value)
virtual ::CORBA::Any * getAttribute(const char *name)
vector< string > listProperties(const PropertyBag &source, const std::string &separator)
List all properties in a PropertyBag in a single list.
virtual ::RTT::corba::CConfigurationInterface::CPropertyNames * getPropertyList(void)
PropertyBag * properties()
Return a bag of all properties.
virtual CORBA::Any_ptr createAny(base::DataSourceBase::shared_ptr source) const =0
Evaluate source and create an any which contains the value of source.
virtual ::RTT::corba::CConfigurationInterface::CAttributeNames * getAttributeList(void)
virtual char * getPropertyTypeName(const char *name)
sequence< string > CAttributeNames
A container for holding references to properties.
virtual DataSourceBase::shared_ptr getDataSource() const =0
Return a internal::DataSource which contains the same contents.
virtual ::CORBA::Any * getProperty(const char *name)
PropertyBase * findProperty(const PropertyBag &bag, const std::string &nameSequence, const std::string &separator)
This function locates a Property in nested PropertyBags.
PortableServer::POA_ptr _default_POA()
sequence< CProperty > CPropertyNames
Convenient short notation for every sub-namespace of RTT.
CORBA::Boolean hasProperty(const char *name)
base::AttributeBase * getValue(const std::string &name) const
vector< string > listPropertyDescriptions(const PropertyBag &source, const std::string &separator)
List all descriptions of properties in a PropertyBag in a single list.
virtual char * attributeToString(const char *name)
::RTT::base::DataSourceBase::shared_ptr getAttributeDataSource(const std::string &value_name)
virtual ~RTT_corba_CConfigurationInterface_i(void)
CORBA::Boolean hasAttribute(const char *name)
A class for representing a user type, and which can build instances of that type. ...
RTT_corba_CConfigurationInterface_i(RTT::ConfigurationInterface *ar, PortableServer::POA_ptr the_poa)
base::AttributeBase * getAttribute(const std::string &name) const
A class for keeping track of Attribute, Constant and Property objects of a TaskContext.
virtual char * propertyToString(const char *name)
virtual CORBA::Boolean propertyFromString(const char *name, const char *value)
virtual CORBA::Boolean attributeFromString(const char *name, const char *value)
TypeTransporter * getProtocol(int protocol_id) const
Returns this type's transport for a given protocol.
virtual char * getAttributeTypeName(const char *name)
#define ORO_CORBA_PROTOCOL_ID
virtual ::CORBA::Boolean setProperty(const char *name, const ::CORBA::Any &value)
AttributeNames getAttributeNames() const
Return the names of all attributes in this repository.
CORBA::Boolean isAttributeAssignable(const char *name)
virtual bool updateFromAny(const CORBA::Any *blob, base::DataSourceBase::shared_ptr target) const =0
Update an assignable datasource target with the contents of blob.
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.
virtual char * getPropertyType(const char *name)
Extends the TypeTransporter in order to allow the creation of channel elements or output halves for a...
::RTT::base::DataSourceBase::shared_ptr getPropertyDataSource(const std::string &value_name)
virtual char * getAttributeType(const char *name)