genmsg_java Namespace Reference

Functions

def base_type_deserialization_code
def base_type_serialization_code
def base_type_to_java
def builtin_type_size
def compute_full_text_escaped
def escape_string
def generate
def generate_messages
def msg_decl_to_java
def ros_version
def type_initializer
def write_begin
def write_class
def write_clone_methods
def write_compare_methods
def write_constant_declaration
def write_constant_declarations
def write_constructor
def write_deserialization_method
def write_end
def write_equals_method
def write_hash_code_method
def write_imports
def write_member
def write_member_functions
def write_members
def write_msg_metadata_method
def write_serialization_length
def write_serialization_method
def write_serialization_methods

Variables

dictionary BUILTIN_TYPE_SIZES
dictionary JAVA_HASH_CODES
list JAVA_PRIMITIVE_TYPES = ['char', 'byte', 'short', 'int', 'long', 'boolean', 'float', 'double']
dictionary MSG_TYPE_TO_DESERIALIZATION_CODE
dictionary MSG_TYPE_TO_JAVA
dictionary MSG_TYPE_TO_SERIALIZATION_CODE

Function Documentation

def genmsg_java::base_type_deserialization_code (   type  ) 

Definition at line 137 of file genmsg_java.py.

def genmsg_java::base_type_serialization_code (   type  ) 

Definition at line 134 of file genmsg_java.py.

def genmsg_java::base_type_to_java (   base_type  ) 

Definition at line 115 of file genmsg_java.py.

def genmsg_java::builtin_type_size (   type  ) 

Definition at line 112 of file genmsg_java.py.

def genmsg_java::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 557 of file genmsg_java.py.

def genmsg_java::escape_string (   str  ) 

Definition at line 292 of file genmsg_java.py.

def genmsg_java::generate (   msg_path,
  output_base_path = None 
)
Generate a message

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

Definition at line 585 of file genmsg_java.py.

def genmsg_java::generate_messages (   argv  ) 

Definition at line 621 of file genmsg_java.py.

def genmsg_java::msg_decl_to_java (   field,
  default_val = None 
)
Converts a message type (e.g. uint32, std_msgs/String, etc.) into the Java declaration
for that type.

@param type: The message type
@type type: str
@return: The Java declaration
@rtype: str

Definition at line 151 of file genmsg_java.py.

def genmsg_java::ros_version (  ) 

Definition at line 579 of file genmsg_java.py.

def genmsg_java::type_initializer (   type,
  default_val = None 
)

Definition at line 140 of file genmsg_java.py.

def genmsg_java::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 179 of file genmsg_java.py.

def genmsg_java::write_class (   s,
  spec,
  extra_metadata_methods = {},
  static = False 
)
Writes the entire message struct: declaration, constructors, members, constants and member functions
@param s: The stream to write to
@type s: stream
@param spec: The message spec
@type spec: roslib.msgs.MsgSpec

Definition at line 217 of file genmsg_java.py.

def genmsg_java::write_clone_methods (   s,
  spec 
)

Definition at line 324 of file genmsg_java.py.

def genmsg_java::write_compare_methods (   s,
  spec 
)

Definition at line 542 of file genmsg_java.py.

def genmsg_java::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 297 of file genmsg_java.py.

def genmsg_java::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 311 of file genmsg_java.py.

def genmsg_java::write_constructor (   s,
  spec 
)

Definition at line 249 of file genmsg_java.py.

def genmsg_java::write_deserialization_method (   s,
  spec 
)

Definition at line 423 of file genmsg_java.py.

def genmsg_java::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 194 of file genmsg_java.py.

def genmsg_java::write_equals_method (   s,
  spec 
)

Definition at line 499 of file genmsg_java.py.

def genmsg_java::write_hash_code_method (   s,
  spec 
)

Definition at line 522 of file genmsg_java.py.

def genmsg_java::write_imports (   s,
  spec 
)
Writes the message-specific imports

@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 205 of file genmsg_java.py.

def genmsg_java::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 267 of file genmsg_java.py.

def genmsg_java::write_member_functions (   s,
  spec,
  msg_metadata_methods 
)
The the default member functions

Definition at line 546 of file genmsg_java.py.

def genmsg_java::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 281 of file genmsg_java.py.

def genmsg_java::write_msg_metadata_method (   s,
  name,
  return_value 
)

Definition at line 494 of file genmsg_java.py.

def genmsg_java::write_serialization_length (   s,
  spec 
)

Definition at line 338 of file genmsg_java.py.

def genmsg_java::write_serialization_method (   s,
  spec 
)

Definition at line 381 of file genmsg_java.py.

def genmsg_java::write_serialization_methods (   s,
  spec 
)

Definition at line 488 of file genmsg_java.py.


Variable Documentation

Initial value:
{'bool': 1, 'int8': 1, 'byte': 1, 'int16': 2, 'int32': 4, 'int64': 8,
                      'char': 1, 'uint8': 1, 'uint16': 2, 'uint32': 4, 'uint64': 8,
                      'float32': 4, 'float64': 8, 'time': 8, 'duration': 8}

Definition at line 96 of file genmsg_java.py.

Initial value:
{
    'char': '%(value)s',
    'byte': '%(value)s',
    'short': '%(value)s',
    'int': '%(value)s',
    'long': '(int)(%(value)s ^ (%(value)s >>> 32))',
    'boolean': '(%(value)s ? 1231 : 1237)',     # stolen from eclipse autogenerated code
    'float': 'Float.floatToIntBits(%(value)s)',
    'double': '(int)((tmp = Double.doubleToLongBits(%(value)s)) ^ (tmp >>> 32))'}

Definition at line 102 of file genmsg_java.py.

list genmsg_java::JAVA_PRIMITIVE_TYPES = ['char', 'byte', 'short', 'int', 'long', 'boolean', 'float', 'double']

Definition at line 100 of file genmsg_java.py.

Initial value:
{
    'bool': '%s.get() != 0 ? true : false',
    'char': '(char)(%s.get() & 0xff)',
    'byte': '(short)(%s.get() & 0xff)',
    'uint8': '(short)(%s.get() & 0xff)',
    'int8': '%s.get()',
    'uint16': '(int)(%s.getShort() & 0xffff)',
    'int16': '%s.getShort()',
    'uint32': '(long)(%s.getInt() & 0xffffffff)',
    'int32': '%s.getInt()',
    'uint64': '%s.getLong()',
    'int64': '%s.getLong()',
    'float32': '%s.getFloat()',
    'float64': '%s.getDouble()',
    'string': 'Serialization.readString(%s)',
    'time': 'Serialization.readTime(%s)',
    'duration': 'Serialization.readDuration(%s)'}

Definition at line 78 of file genmsg_java.py.

Initial value:
{'bool': 'boolean',
                    'char': 'char',
                    'byte': 'short',
                    'uint8': 'short', 'int8': 'byte', 
                    'uint16': 'int', 'int16': 'short', 
                    'uint32': 'long', 'int32': 'int',
                    'uint64': 'long', 'int64': 'long',
                    'float32': 'float',
                    'float64': 'double',
                    'string': 'java.lang.String',
                    'time': 'ros.communication.Time',
                    'duration': 'ros.communication.Duration'}

Definition at line 47 of file genmsg_java.py.

Initial value:
{
    'bool': '%(buffer)s.put((byte)(%(name)s ? 1 : 0))',
    'char': '%(buffer)s.put((byte)%(name)s)',
    'byte': '%(buffer)s.put((byte)%(name)s)',
    'uint8': '%(buffer)s.put((byte)%(name)s)',
    'int8': '%(buffer)s.put(%(name)s)',
    'uint16': '%(buffer)s.putShort((short)%(name)s)',
    'int16': '%(buffer)s.putShort(%(name)s)',
    'uint32': '%(buffer)s.putInt((int)%(name)s)',
    'int32': '%(buffer)s.putInt(%(name)s)',
    'uint64': '%(buffer)s.putLong(%(name)s)',
    'int64': '%(buffer)s.putLong(%(name)s)',
    'float32': '%(buffer)s.putFloat(%(name)s)',
    'float64': '%(buffer)s.putDouble(%(name)s)',
    'string': 'Serialization.writeString(%(buffer)s, %(name)s)',
    'time': 'Serialization.writeTime(%(buffer)s, %(name)s)',
    'duration': 'Serialization.writeDuration(%(buffer)s, %(name)s)'}

Definition at line 60 of file genmsg_java.py.

 All Classes Namespaces Files Functions Variables Defines


rosjava_jni
Author(s): Jason Wolfe (jawolfe@willowgarage.com), Nicholas Butko (nbutko@cogsci.ucsd.edu), Lorenz Moesenlechner (moesenle@in.tum.de)
autogenerated on Fri Jan 11 09:41:22 2013