Info.cpp
Go to the documentation of this file.
00001 /* Generated from orogen/templates/typekit/type_info/Info.cpp */
00002 
00003 <%= typekit.cxx_gen_includes(*typekit.include_for_type(type)) %>
00004 <%= typekit.cxx_gen_includes(*typekit.type_info_includes_for_type(type)) %>
00005 
00006 <% base_class =
00007     if !TypekitMarshallers::TypeInfo::Plugin.rtt_scripting?
00008         ["RTT::types::PrimitiveTypeInfo< #{type.cxx_name} >", "RTT::types::TemplateConnFactory< #{type.cxx_name} >"]
00009     elsif type.full_name == "/std/string"
00010         ["RTT::types::StdStringTypeInfo"]
00011     else
00012         ["#{type.info_type}< #{type.cxx_name} >"]
00013     end
00014 %>
00015 
00016 namespace orogen_typekits {
00017     struct <%= type.method_name(true) %>TypeInfo :
00018         public <%= base_class.join(", public ") %>
00019     {
00020         <%= type.method_name(true) %>TypeInfo()
00021             : <%= base_class.first %>("<%= type.full_name %>") {}
00022 
00023 <%  if !TypekitMarshallers::TypeInfo::Plugin.rtt_scripting? %>
00024         bool installTypeInfoObject(RTT::types::TypeInfo* ti) {
00025             // This shared pointer MUST be taken HERE, and MUST be pointing to
00026             // the most derived class. Otherwise, you'll get double-free at
00027             // deinitialization time
00028             boost::shared_ptr< <%= type.method_name(true) %>TypeInfo > mthis =
00029                 boost::dynamic_pointer_cast< <%= type.method_name(true) %>TypeInfo >( this->getSharedPtr() );
00030 
00031             // Allow base to install first
00032             RTT::types::PrimitiveTypeInfo< <%= type.cxx_name %> >::installTypeInfoObject(ti);
00033             // Install the factories for primitive types
00034             ti->setPortFactory(mthis);
00035 
00036             return false;
00037         }
00038 <% end %>
00039 
00040     };
00041 
00042     RTT::types::TypeInfoGenerator* <%= type.method_name(true) %>_TypeInfo()
00043     { return new <%= type.method_name(true) %>TypeInfo(); }
00044 
00045 }
00046 
00047 <%= Generation.render_template('typekit', 'TemplateInstanciation.cpp', binding) %>
00048 


orogen
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Sat Jun 8 2019 19:52:17