38 #ifndef ORO_PROPERTY_HPP 39 #define ORO_PROPERTY_HPP 41 #include "rtt-config.h" 45 #include <boost/type_traits/remove_const.hpp> 46 #include <boost/call_traits.hpp> 52 #ifdef ORO_PRAGMA_INTERFACE 85 typedef typename boost::remove_const<typename boost::remove_reference<T>::type>::type
value_t;
86 typedef typename boost::call_traits<value_t>::param_type
param_t;
87 typedef typename boost::call_traits<value_t>::reference
reference_t;
148 log(
Error) <<
"Cannot initialize Property from " << source->
getName() <<
": ";
150 log() <<
"incompatible type ( destination type: " <<
getType() <<
", source type: " << dsb->getTypeName() <<
")." <<
endlog();
152 log() <<
"source Property was not ready." <<
endlog();
167 Property(
const std::string& name,
const std::string& description,
193 if (
this == source )
246 DataSourceType
get()
const 309 return this->
update( *origin );
317 if ( origin != 0 &&
_value ) {
318 return this->
refresh( *origin );
326 if ( origin != 0 &&
_value ) {
327 return this->
copy( *origin );
386 if ( datasource && !prop->ready() ) {
387 log(
Error) <<
"Cannot initialize Property: " 388 <<
"incompatible type ( destination type: " <<
getType() <<
", source type: " << datasource->getTypeName() <<
")." <<
endlog();
442 std::ostream& operator<<(std::ostream &os, Property<T> &p)
444 #ifdef OS_HAVE_STREAMS 445 os << p.getDataSource();
virtual base::DataSourceBase::shared_ptr getDataSource() const
boost::call_traits< value_t >::reference reference_t
Property(const std::string &name)
virtual result_t get() const =0
virtual bool refresh(const base::PropertyBase *other)
virtual bool copy(const base::PropertyBase *other)
Property(base::PropertyBase *source)
virtual Property< T > * clone() const
internal::AssignableDataSource< DataSourceType >::shared_ptr getAssignableDataSource() const
virtual void set(param_t t)=0
virtual void introspect(PropertyBase *p)
virtual void identify(base::PropertyIntrospection *pi)
bool update(const Property< T > &orig)
const_reference_t rvalue() const
internal::AssignableDataSource< DataSourceType >::shared_ptr _value
Property(const Property< T > &orig)
Property(const std::string &name, const std::string &description, param_t value=value_t())
bool copy(const Property< T > &orig)
Property(const std::string &name, const std::string &description, const typename internal::AssignableDataSource< DataSourceType >::shared_ptr &datasource)
virtual Property< T > * create(const base::DataSourceBase::shared_ptr &datasource) const
Property< T > & doc(const std::string &descr)
boost::call_traits< value_t >::const_reference const_reference_t
bool refresh(const Property< T > &orig)
static std::string GetType()
virtual const_reference_t rvalue() const =0
A property represents a named value of any type with a description.
virtual bool setDataSource(const base::DataSourceBase::shared_ptr &dsb)
const std::string & getDescription() const
virtual const types::TypeInfo * getTypeInfo() const
static AssignableDataSource< T > * narrow(base::DataSourceBase *db)
Property< T > & operator=(param_t value)
boost::remove_const< typename boost::remove_reference< T >::type >::type value_t
void setName(const std::string &name)
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
static const types::TypeInfo * GetTypeInfo()
virtual std::string getType() const
virtual bool update(const base::PropertyBase *other)
virtual void identify(PropertyIntrospection *pi)=0
const std::string & getName() const
static Property< T > * narrow(base::PropertyBase *prop)
Property< T > & operator=(base::PropertyBase *source)
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual Property< T > * create() const
static Logger::LogFunction endlog()
virtual DataSourceBase::shared_ptr getDataSource() const =0
virtual bool evaluate() const
boost::call_traits< value_t >::param_type param_t
void setDescription(const std::string &desc)