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)
135 ret[i].name = CORBA::string_dup( names[i].c_str() );
136 ret[i].type_name = CORBA::string_dup( ds->getTypeName().c_str() );
137 ret[i].assignable = ds->isAssignable();
145 ::RTT::corba::CConfigurationInterface::CPropertyNames_var ret = new ::RTT::corba::CConfigurationInterface::CPropertyNames();
152 ret->length( allprops.size() );
153 vector<string>::iterator it = allprops.begin();
154 vector<string>::iterator dit = alldescs.begin();
156 for( ; it != allprops.end(); ++it, ++index, ++dit) {
158 prop.
name = CORBA::string_dup( it->c_str() );
159 prop.
description = CORBA::string_dup( dit->c_str() );
170 return new CORBA::Any();
172 const TypeInfo* ti = ds->getTypeInfo();
177 }
catch(std::exception
const& e) {
184 const ::CORBA::Any & value)
189 const TypeInfo* ti = ds->getTypeInfo();
201 return new CORBA::Any();
204 log(
Error) <<
"CConfigurationInterface: no such property: " << name <<
". Returning empty CORBA::Any."<<endlog();
205 return new CORBA::Any();
207 const TypeInfo* ti = ds->getTypeInfo();
212 }
catch(std::exception
const& e) {
219 const ::CORBA::Any & value)
226 const TypeInfo* ti = ds->getTypeInfo();
250 return CORBA::string_dup( ds->getType().c_str() );
251 return CORBA::string_dup(
"na" );
259 return CORBA::string_dup( ds->getTypeName().c_str() );
260 return CORBA::string_dup(
"na" );
268 std::string result = ds->toString();
269 return CORBA::string_dup( result.c_str() );
271 return CORBA::string_dup(
"na" );
275 const char* name,
const char* value
281 if ( ds->getTypeInfo()->fromString( value, ds ) ) {
282 RTT::log(
RTT::Error) <<
"corba::CConfigurationInterface: Could not assign string to "<< ds->getType() <<
"." <<RTT::endlog();
299 return CORBA::string_dup( ds->getType().c_str() );
300 return CORBA::string_dup(
"na" );
308 return CORBA::string_dup( ds->getTypeName().c_str() );
309 return CORBA::string_dup(
"na" );
317 std::string result = ds->toString();
318 return CORBA::string_dup( result.c_str() );
320 return CORBA::string_dup(
"na" );
324 const char* name,
const char* value
330 if ( ds->getTypeInfo()->fromString( value, ds ) ) {
331 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)
sequence< CAttribute > CAttributeNames
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)
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)