Functions | Variables
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

Definition at line 137 of file genmsg_java.py.

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.

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

Definition at line 295 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 592 of file genmsg_java.py.

Definition at line 628 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.) to the Java declaration
for that type.

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

Definition at line 154 of file genmsg_java.py.

Definition at line 582 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 182 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 220 of file genmsg_java.py.

def genmsg_java.write_clone_methods (   s,
  spec 
)

Definition at line 327 of file genmsg_java.py.

def genmsg_java.write_compare_methods (   s,
  spec 
)

Definition at line 545 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 300 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 314 of file genmsg_java.py.

def genmsg_java.write_constructor (   s,
  spec 
)

Definition at line 252 of file genmsg_java.py.

Definition at line 426 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 197 of file genmsg_java.py.

def genmsg_java.write_equals_method (   s,
  spec 
)

Definition at line 502 of file genmsg_java.py.

def genmsg_java.write_hash_code_method (   s,
  spec 
)

Definition at line 525 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 208 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 270 of file genmsg_java.py.

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

Definition at line 549 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 284 of file genmsg_java.py.

def genmsg_java.write_msg_metadata_method (   s,
  name,
  return_value 
)

Definition at line 497 of file genmsg_java.py.

def genmsg_java.write_serialization_length (   s,
  spec 
)

Definition at line 341 of file genmsg_java.py.

def genmsg_java.write_serialization_method (   s,
  spec 
)

Definition at line 384 of file genmsg_java.py.

def genmsg_java.write_serialization_methods (   s,
  spec 
)

Definition at line 491 of file genmsg_java.py.


Variable Documentation

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

Definition at line 96 of file genmsg_java.py.

Initial value:
00001 {
00002     'char': '%(value)s',
00003     'byte': '%(value)s',
00004     'short': '%(value)s',
00005     'int': '%(value)s',
00006     'long': '(int)(%(value)s ^ (%(value)s >>> 32))',
00007     'boolean': '(%(value)s ? 1231 : 1237)',     # stolen from eclipse autogenerated code
00008     'float': 'Float.floatToIntBits(%(value)s)',
00009     '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:
00001 {
00002     'bool': '%s.get() != 0 ? true : false',
00003     'char': '(char)(%s.get() & 0xff)',
00004     'byte': '(short)(%s.get() & 0xff)',
00005     'uint8': '(short)(%s.get() & 0xff)',
00006     'int8': '%s.get()',
00007     'uint16': '(int)(%s.getShort() & 0xffff)',
00008     'int16': '%s.getShort()',
00009     'uint32': '(long)(%s.getInt() & 0xffffffff)',
00010     'int32': '%s.getInt()',
00011     'uint64': '%s.getLong()',
00012     'int64': '%s.getLong()',
00013     'float32': '%s.getFloat()',
00014     'float64': '%s.getDouble()',
00015     'string': 'Serialization.readString(%s)',
00016     'time': 'Serialization.readTime(%s)',
00017     'duration': 'Serialization.readDuration(%s)'}

Definition at line 78 of file genmsg_java.py.

Initial value:
00001 {'bool': 'boolean',
00002                     'char': 'char',
00003                     'byte': 'short',
00004                     'uint8': 'short', 'int8': 'byte', 
00005                     'uint16': 'int', 'int16': 'short', 
00006                     'uint32': 'long', 'int32': 'int',
00007                     'uint64': 'long', 'int64': 'long',
00008                     'float32': 'float',
00009                     'float64': 'double',
00010                     'string': 'java.lang.String',
00011                     'time': 'ros.communication.Time',
00012                     'duration': 'ros.communication.Duration'}

Definition at line 47 of file genmsg_java.py.

Initial value:
00001 {
00002     'bool': '%(buffer)s.put((byte)(%(name)s ? 1 : 0))',
00003     'char': '%(buffer)s.put((byte)%(name)s)',
00004     'byte': '%(buffer)s.put((byte)%(name)s)',
00005     'uint8': '%(buffer)s.put((byte)%(name)s)',
00006     'int8': '%(buffer)s.put(%(name)s)',
00007     'uint16': '%(buffer)s.putShort((short)%(name)s)',
00008     'int16': '%(buffer)s.putShort(%(name)s)',
00009     'uint32': '%(buffer)s.putInt((int)%(name)s)',
00010     'int32': '%(buffer)s.putInt(%(name)s)',
00011     'uint64': '%(buffer)s.putLong(%(name)s)',
00012     'int64': '%(buffer)s.putLong(%(name)s)',
00013     'float32': '%(buffer)s.putFloat(%(name)s)',
00014     'float64': '%(buffer)s.putDouble(%(name)s)',
00015     'string': 'Serialization.writeString(%(buffer)s, %(name)s)',
00016     'time': 'Serialization.writeTime(%(buffer)s, %(name)s)',
00017     'duration': 'Serialization.writeDuration(%(buffer)s, %(name)s)'}

Definition at line 60 of file genmsg_java.py.



rosjava_jni
Author(s): Jason Wolfe (jawolfe@willowgarage.com), Nicholas Butko (nbutko@cogsci.ucsd.edu), Lorenz Moesenlechner (moesenle@in.tum.de)
autogenerated on Thu Jan 2 2014 11:07:00