$search
00001 #ifndef ORO_SEQUENCE_TYPE_INFO_HPP 00002 #define ORO_SEQUENCE_TYPE_INFO_HPP 00003 00004 #include "TemplateTypeInfo.hpp" 00005 #include "SequenceTypeInfoBase.hpp" 00006 #include "MemberFactory.hpp" 00007 00008 namespace RTT 00009 { 00010 namespace types 00011 { 00016 template<class T, bool has_ostream=false> 00017 class SequenceTypeInfo 00018 : public TemplateTypeInfo<T,has_ostream>, public SequenceTypeInfoBase<T>, public MemberFactory 00019 { 00020 public: 00021 SequenceTypeInfo(std::string name) 00022 : TemplateTypeInfo<T,has_ostream>(name), SequenceTypeInfoBase<T>() 00023 {} 00024 00025 bool installTypeInfoObject(TypeInfo* ti) { 00026 // aquire a shared reference to the this object 00027 boost::shared_ptr< SequenceTypeInfo<T,has_ostream> > mthis = boost::dynamic_pointer_cast<SequenceTypeInfo<T,has_ostream> >( this->getSharedPtr() ); 00028 assert(mthis); 00029 // Allow base to install first 00030 TemplateTypeInfo<T,has_ostream>::installTypeInfoObject(ti); 00031 SequenceTypeInfoBase<T>::installTypeInfoObject(ti); 00032 // Install the factories for primitive types 00033 ti->setMemberFactory( mthis ); 00034 // Don't delete us, we're memory-managed. 00035 return false; 00036 } 00037 00038 base::AttributeBase* buildVariable(std::string name,int size) const 00039 { 00040 return SequenceTypeInfoBase<T>::buildVariable(name,size); 00041 } 00042 00043 virtual bool composeType( base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const 00044 { 00045 return SequenceTypeInfoBase<T>::composeType(dssource, dsresult); 00046 } 00047 00048 virtual bool resize(base::DataSourceBase::shared_ptr arg, int size) const 00049 { 00050 return SequenceTypeInfoBase<T>::resize(arg,size); 00051 } 00052 virtual base::DataSourceBase::shared_ptr decomposeType(base::DataSourceBase::shared_ptr source) const 00053 { 00054 return SequenceTypeInfoBase<T>::decomposeType(source); 00055 } 00056 virtual std::vector<std::string> getMemberNames() const { 00057 return SequenceTypeInfoBase<T>::getMemberNames(); 00058 } 00059 00060 virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item, const std::string& name) const { 00061 return SequenceTypeInfoBase<T>::getMember(item,name); 00062 } 00063 00064 virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item, 00065 base::DataSourceBase::shared_ptr id) const { 00066 return SequenceTypeInfoBase<T>::getMember(item, id); 00067 } 00068 }; 00069 } 00070 } 00071 00072 #endif