Functions | Variables
msg_gen Namespace Reference

Functions

def compute_full_text_escaped
def cpp_message_declarations
def default_value
def escape_string
def generate
def generate_messages
def is_fixed_length
def is_hex_string
def msg_type_to_cpp
def takes_allocator
def write_begin
def write_constant_declaration
def write_constant_declarations
def write_constant_definition
def write_constant_definitions
def write_constructors
def write_deprecated_member_functions
def write_end
def write_fixed_length_assigns
def write_generic_includes
def write_includes
def write_initializer_list
def write_member
def write_members
def write_operations
def write_ostream_operator
def write_serialization
def write_struct
def write_trait_char_class
def write_trait_true_class
def write_traits

Variables

dictionary MSG_TYPE_TO_CPP

Function Documentation

def msg_gen.compute_full_text_escaped (   gen_deps_dict)
Same as roslib.gentools.compute_full_text, except that the
resulting text is escaped to be safe for C++ double quotes

@param get_deps_dict: dictionary returned by get_dependencies call
@type  get_deps_dict: dict
@return: concatenated text for msg/srv file and embedded msg/srv types. Text will be escaped for double quotes
@rtype: str

Definition at line 493 of file msg_gen.py.

def msg_gen.cpp_message_declarations (   name_prefix,
  msg 
)
Returns the different possible C++ declarations for a message given the message itself.

@param name_prefix: The C++ prefix to be prepended to the name, e.g. "std_msgs::"
@type name_prefix: str
@param msg: The message type
@type msg: str
@return: A tuple of 3 different names.  cpp_message_decelarations("std_msgs::", "String") returns the tuple
    ("std_msgs::String_", "std_msgs::String_<ContainerAllocator>", "std_msgs::String")
@rtype: str 

Definition at line 96 of file msg_gen.py.

def msg_gen.default_value (   type)
Returns the value to initialize a message member with.  0 for integer types, 0.0 for floating point, false for bool,
empty string for everything else

@param type: The type
@type type: str

Definition at line 216 of file msg_gen.py.

def msg_gen.escape_string (   str)

Definition at line 365 of file msg_gen.py.

def msg_gen.generate (   msg_path)
Generate a message

@param msg_path: The path to the .msg file
@type msg_path: str

Definition at line 684 of file msg_gen.py.

def msg_gen.generate_messages (   argv)

Definition at line 735 of file msg_gen.py.

def msg_gen.is_fixed_length (   spec)
Returns whether or not the message is fixed-length

@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param package: The package of the
@type package: str

Definition at line 426 of file msg_gen.py.

def msg_gen.is_hex_string (   str)

Definition at line 514 of file msg_gen.py.

def msg_gen.msg_type_to_cpp (   type)
Converts a message type (e.g. uint32, std_msgs/String, etc.) into the C++ declaration
for that type (e.g. uint32_t, std_msgs::String_<ContainerAllocator>)

@param type: The message type
@type type: str
@return: The C++ declaration
@rtype: str

Definition at line 64 of file msg_gen.py.

def msg_gen.takes_allocator (   type)
Returns whether or not a type can take an allocator in its constructor.  False for all builtin types except string.
True for all others.

@param type: The type
@type: str

Definition at line 234 of file msg_gen.py.

def msg_gen.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.msgs.MsgSpec
@param file: The file this message is being generated for
@type file: str

Definition at line 114 of file msg_gen.py.

def msg_gen.write_constant_declaration (   s,
  constant 
)
Write a constant value as a static member

@param s: The stream to write to
@type s: stream
@param constant: The constant
@type constant: roslib.msgs.Constant

Definition at line 370 of file msg_gen.py.

def msg_gen.write_constant_declarations (   s,
  spec 
)
Write all the constants from a spec as static members

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec

Definition at line 386 of file msg_gen.py.

def msg_gen.write_constant_definition (   s,
  spec,
  constant 
)
Write a constant value as a static member

@param s: The stream to write to
@type s: stream
@param constant: The constant
@type constant: roslib.msgs.Constant

Definition at line 398 of file msg_gen.py.

def msg_gen.write_constant_definitions (   s,
  spec 
)
Write all the constants from a spec as static members

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec

Definition at line 414 of file msg_gen.py.

def msg_gen.write_constructors (   s,
  spec,
  cpp_name_prefix 
)
Writes any necessary constructors for the message

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param cpp_name_prefix: The C++ prefix to use when referring to the message, e.g. "std_msgs::"
@type cpp_name_prefix: str

Definition at line 311 of file msg_gen.py.

def msg_gen.write_deprecated_member_functions (   s,
  spec,
  traits 
)
Writes the deprecated member functions for backwards compatibility

Definition at line 455 of file msg_gen.py.

def msg_gen.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.msgs.MsgSpec

Definition at line 129 of file msg_gen.py.

def msg_gen.write_fixed_length_assigns (   s,
  spec,
  container_gets_allocator,
  cpp_name_prefix 
)
Initialize any fixed-length arrays

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param container_gets_allocator: Whether or not a container type (whether it's another message, a vector, array or string)
    should have the allocator passed to its constructor.  Assumes the allocator is named _alloc.
@type container_gets_allocator: bool
@param cpp_name_prefix: The C++ prefix to use when referring to the message, e.g. "std_msgs::"
@type cpp_name_prefix: str

Definition at line 280 of file msg_gen.py.

Writes the includes that all messages need

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

Definition at line 140 of file msg_gen.py.

def msg_gen.write_includes (   s,
  spec 
)
Writes the message-specific includes

@param s: The stream to write to
@type s: stream
@param spec: The message spec to iterate over
@type spec: roslib.msgs.MsgSpec

Definition at line 158 of file msg_gen.py.

def msg_gen.write_initializer_list (   s,
  spec,
  container_gets_allocator 
)
Writes the initializer list for a constructor

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param container_gets_allocator: Whether or not a container type (whether it's another message, a vector, array or string)
    should have the allocator passed to its constructor.  Assumes the allocator is named _alloc.
@type container_gets_allocator: bool

Definition at line 246 of file msg_gen.py.

def msg_gen.write_member (   s,
  field 
)
Writes a single member's declaration and type typedef

@param s: The stream to write to
@type s: stream
@param type: The member type
@type type: str
@param name: The name of the member
@type name: str

Definition at line 339 of file msg_gen.py.

def msg_gen.write_members (   s,
  spec 
)
Write all the member declarations

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec

Definition at line 354 of file msg_gen.py.

def msg_gen.write_operations (   s,
  spec,
  cpp_name_prefix 
)

Definition at line 614 of file msg_gen.py.

def msg_gen.write_ostream_operator (   s,
  spec,
  cpp_name_prefix 
)

Definition at line 679 of file msg_gen.py.

def msg_gen.write_serialization (   s,
  spec,
  cpp_name_prefix 
)
Writes the Serializer class for a message

@param s: Stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param cpp_name_prefix: The C++ prefix to prepend to a message to refer to it (e.g. "std_msgs::")
@type cpp_name_prefix: str

Definition at line 649 of file msg_gen.py.

def msg_gen.write_struct (   s,
  spec,
  cpp_name_prefix,
  extra_deprecated_traits = {} 
)
Writes the entire message struct: declaration, constructors, members, constants and (deprecated) member functions
@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param cpp_name_prefix: The C++ prefix to use when referring to the message, e.g. "std_msgs::"
@type cpp_name_prefix: str

Definition at line 179 of file msg_gen.py.

def msg_gen.write_trait_char_class (   s,
  class_name,
  cpp_msg_with_alloc,
  value,
  write_static_hex_value = False 
)
Writes a class trait for traits which have static value() members that return const char*

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

@param s: The stream to write to
@type s: stream
@param class_name: The name of the trait class to write
@type class_name: str
@param cpp_msg_with_alloc: The C++ declaration of the message, including the allocator template
@type cpp_msg_with_alloc: str
@param value: The value to return in the string
@type value: str
@param write_static_hex_value: Whether or not to write a set of compile-time-checkable static values.  Useful for,
    for example, MD5Sum.  Writes static const uint64_t static_value1... static_valueN
@type write_static_hex_value: bool
@raise ValueError if write_static_hex_value is True but value contains characters invalid in a hex value

Definition at line 521 of file msg_gen.py.

def msg_gen.write_trait_true_class (   s,
  class_name,
  cpp_msg_with_alloc 
)
Writes a true/false trait class

@param s: stream to write to
@type s: stream
@param class_name: Name of the trait class
@type class_name: str
@param cpp_msg_with_alloc: The C++ declaration of the message, including the allocator template
@type cpp_msg_with_alloc: str

Definition at line 559 of file msg_gen.py.

def msg_gen.write_traits (   s,
  spec,
  cpp_name_prefix,
  datatype = None 
)
Writes all the traits classes for a message

@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec
@param cpp_name_prefix: The C++ prefix to prepend to a message to refer to it (e.g. "std_msgs::")
@type cpp_name_prefix: str
@param datatype: The string to write as the datatype of the message.  If None (default), pkg/msg is used.
@type datatype: str

Definition at line 572 of file msg_gen.py.


Variable Documentation

Initial value:
00001 {'byte': 'int8_t', 'char': 'uint8_t',
00002                    'bool': 'uint8_t',
00003                    'uint8': 'uint8_t', 'int8': 'int8_t', 
00004                    'uint16': 'uint16_t', 'int16': 'int16_t', 
00005                    'uint32': 'uint32_t', 'int32': 'int32_t',
00006                    'uint64': 'uint64_t', 'int64': 'int64_t',
00007                    'float32': 'float',
00008                    'float64': 'double',
00009                    'string': 'std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > ',
00010                    'time': 'ros::Time',
00011                    'duration': 'ros::Duration'}

Definition at line 52 of file msg_gen.py.



roscpp
Author(s): Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com, Troy Straszheim straszheim@willowgarage.com
autogenerated on Sat Dec 28 2013 17:35:53