Functions
gensrv_cpp Namespace Reference

Functions

def generate (srv_path)
 
def generate_services (argv)
 
def write_begin (s, spec, file)
 
def write_end (s, spec)
 
def write_generic_includes (s)
 
def write_trait_char_class (s, class_name, cpp_msg, value)
 
def write_traits (s, spec, cpp_name_prefix, rospack=None)
 

Function Documentation

◆ generate()

def gensrv_cpp.generate (   srv_path)
Generate a service

@param srv_path: the path to the .srv file
@type srv_path: str

Definition at line 146 of file gensrv_cpp.py.

◆ generate_services()

def gensrv_cpp.generate_services (   argv)

Definition at line 213 of file gensrv_cpp.py.

◆ write_begin()

def gensrv_cpp.write_begin (   s,
  spec,
  file 
)
Writes the beginning of the header file: a comment saying it's auto-generated and the include guards

@param s: The stream to write to
@type s: stream
@param spec: The spec
@type spec: roslib.srvs.SrvSpec
@param file: The file this service is being generated for
@type file: str 

Definition at line 56 of file gensrv_cpp.py.

◆ write_end()

def gensrv_cpp.write_end (   s,
  spec 
)
Writes the end of the header file: the ending of the include guards

@param s: The stream to write to
@type s: stream
@param spec: The spec
@type spec: roslib.srvs.SrvSpec

Definition at line 71 of file gensrv_cpp.py.

◆ write_generic_includes()

def gensrv_cpp.write_generic_includes (   s)
Writes the includes that all service need

@param s: The stream to write to
@type s: stream

Definition at line 82 of file gensrv_cpp.py.

◆ write_trait_char_class()

def gensrv_cpp.write_trait_char_class (   s,
  class_name,
  cpp_msg,
  value 
)
Writes a class trait for traits which have static value() members that return const char*

e.g. write_trait_char_class(s, "MD5Sum", "std_srvs::Empty", "hello") yields:
template<>
struct MD5Sum<std_srvs::Empty> 
{
    static const char* value() { return "hello"; }
    static const char* value(const std_srvs::Empty&) { return value(); }
};

@param s: The stream to write to
@type s: stream
@param class_name: The name of the trait class
@type class_name: str
@param cpp_msg: The C++ message declaration, e.g. "std_srvs::Empty"
@type cpp_msg: str
@param value: The string value to return from the value() function
@type value: str

Definition at line 91 of file gensrv_cpp.py.

◆ write_traits()

def gensrv_cpp.write_traits (   s,
  spec,
  cpp_name_prefix,
  rospack = None 
)
Write all the service traits for a message

@param s: The stream to write to
@type s: stream
@param spec: The service spec
@type spec: roslib.srvs.SrvSpec
@param cpp_name_prefix: The C++ prefix to prepend when referencing the service, e.g. "std_srvs::"
@type cpp_name_prefix: str

Definition at line 117 of file gensrv_cpp.py.



roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:27