SequenceTypeInfo.hpp
Go to the documentation of this file.
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             using TemplateValueFactory<T>::buildVariable;
00039             base::AttributeBase* buildVariable(std::string name,int size) const
00040             {
00041                 return SequenceTypeInfoBase<T>::buildVariable(name,size);
00042             }
00043 
00044             virtual bool composeType( base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const
00045             {
00046                 return SequenceTypeInfoBase<T>::composeType(dssource, dsresult);
00047             }
00048 
00049             virtual bool resize(base::DataSourceBase::shared_ptr arg, int size) const
00050             {
00051                 return SequenceTypeInfoBase<T>::resize(arg,size);
00052             }
00053             virtual base::DataSourceBase::shared_ptr decomposeType(base::DataSourceBase::shared_ptr source) const
00054             {
00055                 return SequenceTypeInfoBase<T>::decomposeType(source);
00056             }
00057             virtual std::vector<std::string> getMemberNames() const {
00058                 return SequenceTypeInfoBase<T>::getMemberNames();
00059             }
00060 
00061             virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item, const std::string& name) const {
00062                 return SequenceTypeInfoBase<T>::getMember(item,name);
00063             }
00064 
00065             virtual base::DataSourceBase::shared_ptr getMember(base::DataSourceBase::shared_ptr item,
00066                                                              base::DataSourceBase::shared_ptr id) const {
00067                 return SequenceTypeInfoBase<T>::getMember(item, id);
00068             }
00069         };
00070     }
00071 }
00072 
00073 #endif


rtt
Author(s): RTT Developers
autogenerated on Fri Sep 9 2016 04:01:58