$search

genmsg_cpp Namespace Reference

Functions

def compute_full_text_escaped
def cpp_message_declarations
def default_value
def escape_string
def generate
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 genmsg_cpp::compute_full_text_escaped (   gen_deps_dict  ) 
Same as rosidl.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 497 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 219 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::escape_string (   str  ) 

Definition at line 368 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::generate (   args  ) 
Generate a message

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

Definition at line 692 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::is_fixed_length (   spec,
  includepath 
)
Returns whether or not the message is fixed-length

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

Definition at line 429 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::is_hex_string (   str  ) 

Definition at line 518 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 237 of file rosbuild2/genmsg_cpp.py.

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

Definition at line 114 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.Constant

Definition at line 373 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.MsgSpec

Definition at line 389 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.Constant

Definition at line 401 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.MsgSpec

Definition at line 417 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.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 314 of file rosbuild2/genmsg_cpp.py.

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

Definition at line 459 of file rosbuild2/genmsg_cpp.py.

def genmsg_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: rosidl.msgs.MsgSpec

Definition at line 129 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.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 283 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::write_generic_includes (   s  ) 
Writes the includes that all messages need

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

Definition at line 140 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.MsgSpec

Definition at line 158 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.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 249 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 342 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.msgs.MsgSpec

Definition at line 357 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::write_operations (   s,
  spec,
  cpp_name_prefix 
)

Definition at line 622 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::write_ostream_operator (   s,
  spec,
  cpp_name_prefix 
)

Definition at line 687 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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: rosidl.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 657 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::write_struct (   s,
  spec,
  cpp_name_prefix,
  includepath,
  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: rosidl.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 rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 525 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::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 563 of file rosbuild2/genmsg_cpp.py.

def genmsg_cpp::write_traits (   s,
  spec,
  cpp_name_prefix,
  includepath,
  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: rosidl.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 576 of file rosbuild2/genmsg_cpp.py.


Variable Documentation

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

Definition at line 52 of file rosbuild2/genmsg_cpp.py.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


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 Mar 2 13:23:31 2013