Task.cpp
Go to the documentation of this file.
00001 /* Generated from orogen/lib/orogen/templates/tasks/Task.cpp */
00002 
00003 #include "<%= task.basename %>.hpp"
00004 
00005 using namespace <%= task.project.name %>;
00006 
00007 <%= task.basename %>::<%= task.basename %>(std::string const& name<%= ", TaskCore::TaskState initial_state" unless task.fixed_initial_state? %>)
00008     : <%= task.basename %>Base(name<%= ", initial_state" unless task.fixed_initial_state? %>)
00009 {
00010 }
00011 
00012 <%= task.basename %>::<%= task.basename %>(std::string const& name, RTT::ExecutionEngine* engine<%= ", TaskCore::TaskState initial_state" unless task.fixed_initial_state? %>)
00013     : <%= task.basename %>Base(name, engine<%= ", initial_state" unless task.fixed_initial_state? %>)
00014 {
00015 }
00016 
00017 <%= task.basename %>::~<%= task.basename %>()
00018 {
00019 }
00020 
00021 <%= task.self_user_methods.sort_by(&:name).
00022     map { |m| m.with_indent(0, :definition) }.
00023     compact.join("\n\n") %>
00024 
00026 // hooks defined by Orocos::RTT. See <%= task.basename %>.hpp for more detailed
00027 // documentation about them.
00028 
00029 <% %w{configure start update error stop cleanup}.each do |hook_name| %>
00030 <%    snippets = task.user_hook_code[hook_name] %>
00031 <%    is_boolean = (hook_name == "start" || hook_name == "configure") %>
00032 <%= (is_boolean ? 'bool' : 'void') %> <%= task.basename %>::<%= hook_name %>Hook()
00033 {
00034 <% if is_boolean %>
00035     if (! <%= task.basename %>Base::<%= hook_name %>Hook())
00036         return false;
00037 <% else %>
00038     <%= task.basename %>Base::<%= hook_name %>Hook();
00039 <% end %>
00040 <% snippets.each do |code| %>
00041 <%     if code.respond_to?(:to_str) %>
00042 <%= code %>
00043 <%     else %>
00044 <%= code.call %>
00045 <%     end %>
00046 <% end %>
00047 <% if is_boolean %>
00048     return true;
00049 <% end %>
00050 }
00051 <% end %>


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