Home

Welcome to RTI Code Generator 2!

image

Contents

1. TypeSupport java Support serialize deserialize etc class Table 1 2 Files Created by rtiddsgen2 for Java for Example Hello idl Data Type Generated Files Description Typedef of lt Name gt java Wrapper class sequences or lt Name gt Seq java Sequence class arrays lt Name gt TypeSupport java Support serialize deserialize etc class Optional files generated when you use the example lt architecture gt command line option You may modify and use these files as a way to create simple applications that publish or subscribe to the user data Using rtiddsgen2 type Example code for applications that publish or subscribe to lt Name gt Publisherjava the user data type You should modify the code in the a publisher application to set and change the value of the Structures lt Name gt Subscriberjava published data Otherwise both files should be ready to Unions compile and run maketile Helloearchitectures Makefile for non Windows based architectures An example lt architecture gt is linux2 6gcc4 1 1 Structures lt Name gt TypeCode java f Unions M Type code class associated with the IDL type given by Typedefs Note this is not generated if james Enum you use notypecode rtiddsgen2 Command Line Arguments There are several command line options you can pass to rtiddsgen2 rtiddsgen2 autoGenFiles lt architecture gt create lt typerfiles examp
2. an application that subscribes to the user data type This example shows the basic steps to create all of the DDS objects needed to Hello_subscriber c cxx cpp cs receive data using a listener function No modification of this file is required It is ready for you to compile and run Hello dsw or Hello sln Hello_publisher dsp or Hello_publisher veproj Hello_subscriber dsp or Hello_subscriber vcproj Microsoft Visual C or Visual Studio NET Project workspace and project files generated only for i86Win32 architectures To compile the generated source code open the workspace file and build the two projects makefile Hello_ lt architecture gt Makefile for non Windows based architectures An example lt architecture gt is linux2 6gcec4 1 1 Files Created by rtiddsgen2 for Java for Example Hello idl Data Type Generated Files Description Since the Java language requires individual files to be created for each class rtiddsgen2 will generate a source file for every IDL construct that translates into a class in Java Constants lt Name gt java Class associated with the constant Enums lt Name gt java Class associated with enum type lt Name gt java Structure Union class lt Name gt Seq java I truct equence class gt a ures lt Name gt DataReaderjava q Unions DDS DataReader and DataWriter classes lt Name gt DataWriterjava lt Name gt
3. na 6 1 2 2 Using Staridalone Types IN C siinse vaneria aeea edipi koret ai aii Aa niita a aTi 7 1 2 3 Standalone Types 10 Javavivicse snc custo dew an a i i eai aakit 7 2 Comparing rtiddsgen and rtiddsgen2 esseseesseeseseesscoreesessesscoseesessroncoseeseesrossoseeseesrossoseesresrossoseeseessssseseesee 8 Customizing the Generated Code csccssssesssssssssssesssssssssecsssssessssesesssssssssesessessssesesssssestsesesessesssesseeeees 10 4 Boosting Performance with Server Mode cssseccssrsrscecscscrsrscecssssssssesecssssssssesesesesssssesesessensssesesseeees 10 Welcome to RTI Code Generator 2 RTI Connext 5 1 0 includes a separate and new implementation of the code generator this new version significantly improves the performance of the original implementation and makes easier to customize the generated output In Connext 5 1 0 the new implementation of the code generator rtiddsgen2 coexists with the original rtiddsgen To generate code using the new implementation you will use the scripts rtiddsgen2 or rtiddsgen2_server under NDDSHOME scripts To recap there are two versions of RTI Code Generator L Code Generator rtiddsgen the officially supported version that is described in the RTI Core Libraries and Utilities User s Manual see Section 3 6 Using rtiddsgen L Code Generator 2 rtiddsgen2 an Early Access Release EAR version being testing with Connext 5 1 0 This version runs faster that rt
4. support by using notypecode obfuscate Obfuscates the input file to an IDL obfuscated file Note that if the input type is XML this option will generate an obfuscated IDL package Specifies the root package into which generated classes will be placed It applies to Java only If the type definition file contains module declarations those modules will be considered subpackages of the package specified here platform lt architecture gt Required if create lt typefiles examplefiles makefiles gt or update lt typefiles examplefiles makefiles gt is used Valid options for lt architecture gt are listed in the RTI Core Libraries and Utilities Platform Notes ppDisable Disables the preprocessor ppOption lt option gt Specifies a preprocessor option This parameter can be used multiple times to provide the command line options for the specified preprocessor See ppPath lt preprocessor executable gt ppPath lt preprocessor executable gt Specifies the preprocessor If you only specify the name of an executable not a complete path to that executable the executable must be found in your Path The default value is cpp for non Windows architectures and cl exe for Windows architectures If you use ppPath to provide the full path and filename for cl exe or the cpp preprocessor you must also use ppOption lt option gt to set the following preprocessor options If you use a non def
5. that is spawned the first time the executable is run as depicted below creates anil oo I I server I _ cP When the code generator is used in server mode JVM is loaded a single time when the server is started the velocity templates are also compiled a single time Boosting Performance with Server Mode To invoke the code generator in server mode use the script rtiddsgen2_server bat which is in the scripts directory On Windows Systems To use the rtiddsgen2_server script you must have the Visual Studio 2005 Service Pack 1 redistributable libraries You can obtain this package from Microsoft or RTI see the RTI Core Libraries and Utilities Release Notes for details The rtiddsgen2 server will automatically stop if it is not used for a certain amount of time The default value is 20 seconds you can change this by editing the rtiddsgen2_server script and adjusting the value of the parameter n_servertimeout 11
6. RTI Code Generator 2 for RTI Connext DDS Getting Started Guide Version 2 2 0 t I Your systems Working as one 2013Real Time Innovations Inc All rights reserved Printed in U S A First printing December 2013 Trademarks Real Time Innovations and RTI are registered trademarks of Real Time Innovations Inc All other trademarks used in this document are the property of their respective owners Copy and Use Restrictions No part of this publication may be reproduced stored in a retrieval system or transmitted in any form including electronic mechanical photocopy and facsimile without the prior written permission of Real Time Innovations Inc The software described in this document is furnished under and subject to the RTI software license agreement The software may be used or copied only under the terms of the license agreement Technical Support Real Time Innovations Inc 232 East Java Drive Sunnyvale CA 94089 Phone 408 990 7444 Email support rti com Website https support rti com Contents T Using rtiddsgem2 oaen e S E EEEE E A e aE E eE r E E is 1 11 rtiddsgen2 Command Line Arguments ccccccseccsssssssssessscsesesesesesesesesesescsesesesesescsesesesescssensnseecenes 3 1 2 Using Generated Types without RTI Connext DDS Standalone ieeerseeseereserserssessesasseseess 6 1 2 1 Using Standalone Ty pes in Ciara ess innr onesies fetus o E bares e E teuge spuds
7. alone use Using Standalone Types in C The generated files that can be used standalone are lt idl file name gt c Types source file lt idl file name gt h Types header file The type plug in code idl file gt Plugin c h and type support code lt idl file gt Support c h cannot be used standalone To use the rtiddsgen2 generated types in a standalone manner 1 Make sure you use rtiddsgen2 s notypecode option to generate the code 2 Include the directory lt NDDSHOME gt resource rtiddsgen2 standalone include in the list of directories to be searched for header files 3 Add the source files ndds_standalone_type c and lt idl file name gt c to your project 4 Include the file lt idl file name gt h in the source files that will use the generated types in a standalone manner Using rtiddsgen2 5 Compile the project using the following two preprocessor definitions a NDDS_STANDALONE_TYPE b The definition for your platform RTI_WIN32 or RTI_UNIX Using Standalone Types in C The generated files that can be used standalone are LL lt idl file name gt cxx Types source file I lt idl file name gt h Types header file The type plugin code lt idl file gt Plugin cxx h and type support code lt idl file gt Sup port cxx h cannot be used standalone To use the generated types in a standalone manner 1 Make sure you use rtiddsgen2 s notypecode option to generate the code 2 Includ
8. are not modified and a warning is printed There can be multiple create options If both create and update are specified for the same file type only the update will be applied convertToIDL Converts the input type description file into IDL format This option creates a new file with the same name as the input file and a idl extension convertloXML Converts the input type description file into XML format This option creates a new file with the same name as the input file and a xml extension D lt name gt lt value gt Defines preprocessor macros Note On Windows systems enclose the argument in quotation marks D lt name gt lt value gt d Generates the output in the specified directory By default rtiddsgen2 will generate files in the directory where the input type definition file is found enableEscapeChar Enables use of the escape character _ in IDL identifiers example lt architecture gt Generates type files example files and a makefile This is a shortcut for create lt typefiles gt create lt examplefiles gt create lt makefiles gt platform lt architecture gt Valid options for lt arch gt are listed in the RTI Core Libraries and Utilities Platform Notes I lt directory gt Adds to the list of directories to be searched for type definition files IDL or XML files Note A type definition file in one format cannot include a file in another forma
9. ault path for cl exe you also need to set ppOption nologo ppOption C ppOption E ppOption X If you use a non default path for cpp you also need to set ppOption C Deprecated option Use update lt typefiles examplefiles makefiles gt for the proper files typefiles examplefiles makefiles This option is maintained for backwards compatibility It allows rtiddsgen2 to replace overwrite any existing generated files If it is not present and existing files are found rtiddsgen2 will print a warning but will not overwrite them Sets the size assigned to unbounded sequences The default value is 100 sequenceSize elements sharedLib Generates makefiles that compile with the Connext shared libraries by default the makefile will link with the static libraries strineSixse Sets the size assigned to unbounded strings not counting a terminating NULL 8 character The default value is 255 bytes U lt name gt Cancels any previous definition of lt name gt Creates the files indicated if they do not exist Is the files already exist this overwrites the file without printing a warning update lt typefiles examplefiles makefiles gt There can be multiple update options If both create and update are specified for the same file type only the update will be applied Using rtiddsgen2 Table 1 1 1 2 1 2 1 Options for rtiddsgen2 Option Description Makes the generate
10. d code compatible with RTI Data Distribution Service 4 2e use42eAlignment This option should be used when compatibility with 4 2e is required and the topic data types contain double long long unsigned long long or long double members Defines a user variable that can be used in the templates as userVarList name V lt name lt lt value gt or userVarList name equals value The variables defined with this option are case sensitive rtiddsgen2 verbosity bosity 1 3 1 exceptions verbosi A 2 exceptions and warnings 3 exceptions warnings and information Default Displays the version of rtiddsgen2 being used such as 2 x y as well as the D version of the templates used such as ABCD EFGH IJKL NMOP File containing XML descriptions of your data types If inputXml is not used AML InputFilesan the file must have an xml extension Using Generated Types without RTI Connext DDS Standalone You can use the generated type specific source and header files without linking the Connext libraries or even including the Connext header files That is the generated files for your data types can be used standalone The directory lt NDDSHOME gt resource rtiddsgen2 standalone contains the required helper files I include header and templates files for C and C I sre source files for C and C J class Java jar file Note You must use rtiddsgen2 s notypecode option to generate code for stand
11. e the directory lt NDDSHOME gt resource rtiddsgen2 standalone include in the list of directories to be searched for header files 3 Add the source files ndds_standalone_type cxx and lt idl file name gt cxx to your proj ect 4 Include the file lt idl file name gt h in the source files that will use the rtiddsgen2 types ina standalone manner 5 Compile the project using the following two preprocessor definitions a NDDS_STANDALONE_TYPE b The definition for your platform such as RTI_WIN32 or RTI_UNIX Standalone Types in Java The generated files that can be used standalone are Ll lt idl type gt java LI lt idl type gt Seq java The type code lt idl file gt TypeCode java type support code lt idl type gt TypeSupport java DataReader code lt idl file gt DataReader java and DataWriter code idl file gt DataWriter java cannot be used standalone To use the generated types in a standalone manner 1 Make sure you use rtiddsgen2 s notypecode option to generate the code 2 Include the file ndds_standalone_type jar in the classpath of your project 3 Compile the project using the standalone types files lt idl type gt java and lt idl type gt Seq java Comparing rtiddsgen and rtiddsgen2 2 Comparing rtiddsgen and rtiddsgen2 rtiddsgen2 is an early access release provided with RTI Connext 5 1 0 The internal mechanism for generating code has been changed from XSLT templates to Apache s Velocity htt
12. e to the lt NDDSHOME gt resource rtid dsgen templates folder If that template vm file contains macros you can use it within the origi nal template If template vm contains just plain text without macros that text will be included directly in the original file You can customize the behavior of a template by using the predefined set of variables provided with rtiddsgen2 For more information see the tables in the file RTI_rtiddsgen_template_variables xlsx You can add new variables to the templates using the V lt name gt lt value gt command line option when starting rtiddsgen2 Refer to a variable in the template as userVarList name or user VarList name equals value For more information about rtiddsgen2 s architecture see the slides in RTI_rtiddsgen_architecture pptx For more information on velocity templates see http velocity apache org engine releases velocity 1 5 user guide html Boosting Performance with Server Mode Although rtiddsgen2 has much better performance than rtiddsgen the architecture of the com piler is still Java based If you need to invoke the code generator multiple times with different parameters and or type files there will be a performance penalty derived from loading the JVM and compiling the velocity templates To help with the above scenario you can run rtiddsgen2 in server mode Server mode runs a native executable that opens a TCP connection to a server instance of the code generator
13. iddsgen and is easier to modify This document describes how to use rtiddsgen2 To see the limitations of rtiddsgen2 and how it differs with rtiddsgen see Comparing rtiddsgen and rtiddsgen2 Section 2 1 Using rtiddsgen2 The Code Generator creates the code needed to define and register a user data type with Connext Using either version of the Code Generator rtiddsgen or rtiddsgen2 is optional if LI You are using dynamic types see Managing Memory for Built in Types Section 2 2 8 in the RTI Core Libraries and Utilities User s Manual J You are using one of the built in types see Built in Data Types Section 2 2 in the RTI Core Libraries and Utilities User s Manual To use rtiddsgen2 you provide a description of a data type in an IDL or XML file You can define multiple data types in the same type definition file Table 1 1 on page 2 2 for C C and C CLI and C and Table 1 2 on page 2 2 for Java show the files that rtiddsgen2 creates for an example IDL file called Hello idl The file extension will depend on the chosen language c for C cxx for C cpp for C CLI cs for C 1 This document is provided with RTI Connext You can also access it from the RTI Community Portal s Documenta tion page Using rtiddsgen2 Table 1 1 Table 1 2 On Windows systems Before running rtiddsgen2 run VCVARS32 BAT in the same command prompt that you will use to run rtiddsgen2 NOTE Before using an rt
14. iddsgen2 generated makefile to compile an application make sure the NDDSHOME environment variable is set as described in the RTI Core Libraries and Utilities Getting Started Guide Files Created by rtiddsgen2 for C C C CLI C for Example Hello idl Generated Files Description Required files for the user data type The source files should be compiled and linked with the user application The header files are required to use the data type in source You should not modify these files unless you intend to customize the generated code supporting your type Hello c cxx cpp HelloSupport c cxx cpp HelloPlugin c cxx cpp Generated code for the data types These files contain the implementation for your data types Hello h Header files that contain declarations used in the implementation of your HelloSupport h data tvpes HelloPlugin h oe Optional files generated when you use the example lt architecture gt command line option You may modify and use these files as a way to create simple applications that publish or subscribe to the user data type Example code for an application that publishes the user data type This example shows the basic steps to create all of the DDS objects needed to Hello_publisher c cxx cpp cs Send data You will need to modify the code to set and change the values being sent in the data structure Otherwise just compile and run Example code for
15. lefiles makefiles gt convertToIDL convertToXML D lt name gt lt values gt d lt outdir gt enableEscapeChar example lt architecture gt help I lt directory gt language lt C C Java Ada C CLI C gt namespace noCopyable notypecode obfuscate package lt packagePrefix gt platform lt architectures gt ppDisable ppPath lt path to the preprocessor gt ppOption lt option gt replace sequenceSize lt Unbounded sequences size gt sharedLib stringSize lt Unbounded strings size gt U lt name gt update lt typefilese examplefiles makefiles gt use42eAlignment V lt name gt lt values verbosity lt 1 3 gt version Table 1 1 describes the options in alphabetical order inputId1l lt IDLInputFile idl gt inputXml lt XMLInputFile xml gt Using rtiddsgen2 Table 1 1 Options for rtiddsgen2 Option Description Updates the autogenerated files i e the typefiles and makefile project files Valid options for lt architecture gt are listed in the RTI Core Libraries and Utilities autoGenFiles Platform Notes lt architecture gt This is a shortcut for update lt typefiles gt update lt makefiles gt platform lt arch gt create lt typefiles examplefiles makefiles gt Creates the files indicated if they do not exist If the files already exist the files
16. p velocity apache org This change results in increased performance and easier to understand and updated template files The differences with respect to rtiddsgen are summarized in the following tables Table 2 1 Languages Supported Unsupported Ada C C C CLI C Java None Table 2 2 Command Line Options Supported Unsupported convertToldl convertToCcl convertToXml convertToCcs D lt name gt lt value gt convertToWsdl I lt directory gt convertToXsd U lt name gt corba header file orb lt CORBA ORB gt d lt outdir gt dataReaderSuffix lt Suffix gt enableEscapeChar dataWriterSuffix lt Suffix gt example lt arch gt debug help expandCharSeq inputldl lt IDL file gt expandOctetSeq inputXml lt XML file gt inputWsdl lt WSDL file gt language inputXsd lt XSD file gt namespace metp noCopyable optimization lt level of optimization gt notypecode typeSequenceSuffix lt Suffix gt package lt packagePrefix gt ppDisable ppOption lt option gt ppPath lt path to preprocessor gt replace sequenceSize lt unbounded sequences size gt sharedLib stringSize lt unbounded strings size gt Comparing rtiddsgen and rtiddsgen2 Table 2 2 Table 2 3 Table 2 4 Command Line Options Supported Unsupported verbosity 1 3 version u
17. se42eAlignment Additional Options for rtiddsgen2 autoGenFiles lt arch gt create lt typefiles examplefiles makefiles gt obfuscate platform lt arch gt sharedLib update lt typefiles examplefiles makefiles gt V lt name gt lt value gt a For information on these options see Table 1 1 IDL Types Supported Unsupported User s Manual The same IDL types as supported by rtiddsgen except as noted in this table See Chapter 3 in the RTI Core Libraries and Utilities Bitfields Custom Directives copy cppcli declaration copy declaration copy java copy java declaration copy java declaration Extensibility ID resolve name true false Additional Directives for rtiddsgen2 Optional Supported for C C and Java Supported Unsupported key top level true false copy copy c copy c declaration copy cppeli None Customizing the Generated Code Customizing the Generated Code rtiddsgen2 allows you to customize the generated code for different languages by changing the provided templates This version does not allow you to create new output files You can load new templates using the command parse lt pathToTemplate gt template vm in an existing template where lt pathToTemplate gt is relativ
18. t inputldl Indicates that the input file is an IDL file regardless of the file extension IDLInputFile idl File containing IDL descriptions of your data types If inputIdl is not used the file must have a idl extension inputXml Indicates that the input file is a XML file regardless of the file extension help Prints out the command line options for rtiddsgen2 Eommanmn Specifies the language to use for the generated files The default language is guag C you can also choose C C CLI C Java or Ada Specifies the use of C namespace For C only For C CLI and C it is namespace implied namespaces are always used Forces rtiddsgen2 to put copy logic into the corresponding TypeSupport class noCopyable rather than the type itself This option is only used for Java code generation This option is not compatible with the use of ndds_standalone_type jar see Section Using rtiddsgen2 Table 1 1 Options for rtiddsgen2 Option Description notypecode Disables type code support By using this option you can generate code that can be used in a standalone manner see Section Note If you are using a large data type more than 64 K and type code support you will see a warning when type code information is sent Connext has a type code size limit of 64K To avoid the warning when working with data types with type codes larger than 64K turn off type code

Download Pdf Manuals

image

Related Search

Related Contents

STAR 8 GB.book  Handleiding en instructieboekje Honda ECT7000P aggregaat  Emtec CD Cases  ガーデンレクタングルテーブル ー 20cm 品番 二 STL  RS900 1英文版  AOC 919Pwz 19" TFT  

Copyright © All rights reserved.
Failed to retrieve file