Generated Component Files

The REDHAWK IDE provides a tool for auto-generating component code for C++, Python, or Java languages. This process takes care of REDHAWK compliance and allows the developer to insert their own custom processing algorithm for working with the data sent/received by the component. The following section provides a brief description of the generated files. Note that some files may be freely modified, while other files should not be modified.

Modifying particular files is discouraged for two reasons:

  1. If a user regenerates the component using the IDE (for example, to add a port), particular files are overwritten by the code generators.

NOTE

  1. Files whose modification is not discouraged (e.g., componentName.cpp) are not affected by such an action.
  2. The REDHAWK IDE provides the option of not rewriting particular files.
  1. Modification of files implementing REDHAWK interfaces may impact compatibility with other REDHAWK modules.

The word componentName is replaced with the component name provided during component creation.

Files Generated for All Components

This section lists the files that are generated for all components regardless of the programming language in which they are written.

The code generators create the following files for building and installing the component using Autotools:

NOTE
If you use this script, you must install the dependency rpm-build by entering the following command: sudo yum install rpm-build.

Component XML Descriptors

The REDHAWK IDE creates the following files for describing the properties, ports, interfaces, and descriptions for components:

Unit Tests File

The code generators create the following unit tests file for exercising components:

Files Generated for C++ Components

The following files contain implementation-specific code for C++ components:

WARNING
If main.cpp, struct_props.h, componentName_base.h, or componentName_base.cpp are modified, then your ability to regenerate the component is affected.

Files Generated for Python Components

The following files contain implementation-specific code for Python components:

WARNING
If componentName_base.py is modified, then your ability to regenerate the component is affected.

Files Generated for Java Components

The following files contain implementation-specific code for Java components:

WARNING
If startJava.sh or componentName_base.java are modified, then your ability to regenerate the component is affected.

Transitioning Java Components from REDHAWK Version 1.8 to Later Versions

If componentName.java is not regenerated when migrating from REDHAWK 1.8 to later versions, the component does not inherit from the base class, so it does not take advantage of the new code pattern. In addition, in order for the component to build, the method configureOrb must be added to componentName.java because the base class makes a call on that method.

If you want to inherit from the base class and take advantage of the new pattern, save off the custom main class Java file, regenerate the main Java class to get the new code pattern, and for example, move source from the run() method to the serviceFunction() method to integrate the custom code in the 1.8 main class into the new main class.

WARNING
If componentName.java is regenerated, any custom code added to it is removed.

Add this class to the componentName.java right before the last line which is "}"

/**
 * Set additional options for ORB startup.
 *
 * @param orbProps
 */
public static void configureOrb(final Properties orbProps) {
}