Predefined keyword variables

The following table lists the predefined keyword variables used in IBM® Rational® Rhapsody®.

Table 1. Predefined keyword variables
Keywords Where Used Description
$archive
ConfigurationManagement
The file name (including the full path) of the archive that you selected in the Connect to Archive window. This name can be either a file or a directory.
$archiveddirectory
ConfigurationManagement
The directory part of $archive. If $archive is a directory, $archive and $archiveddirectory are the same.
$arguments
ATL
The arguments of the operation.
$Arguments
<lang>_CG
The description of the event or operation argument , used by the DescriptionTemplate property.
$attribute
CG
The object of an operation on attributes.

The qualifier :c capitalizes the name of the attribute.

$base
<lang>_CG
The name of the reactive object.
$CheckOut
ConfigurationManagement
The command executed to check configuration items out of the archive using the main Configuration Items window.
$class
ATL
The name of the ATL class.
$ClassClean
Makefiles
The list of class files used in a build.
$cname
CG, <Container Types>, 
<lang>_CG
The name of the container used to hold relations. Typical containers are arrays, lists, stacks, heaps, and maps.
$coclass
ATL
The name of the coclass that exposes the COM interface.
$CodeGeneratedDate
CG, <lang>_CG
The date of code generation. This information is printed in the headers and footers of generated files.
$component
ATL
The name of the component,
$ComponentName
CG
The name of the component that caused the code to be generated. This information is printed in the headers and footers of generated files.
$ConfigurationName
CG, <lang>_CG
The name of the configuration that caused the generation of the model element found in a file. This information is printed in headers and footers of generated files.
$datamem
ATL
The data member.
$DeclarationModifier
ATL
The declaration modifier.
$Description
<lang>_CG
The element description, used by the DescriptionTemplate property.
$Direction
<lang>_CG
The argument direction (in, out, and so on), used by the DescriptionTemplate property.
$dupinterface
ATL
The name of the duplicate interface.
$executable
<lang>_CG
The path to the executable binary file generated by the Rational Rhapsody code generator.
$FILENAME
CPP_CG
The name of the file used:
  • To generate source code for individual classes to user-specified directories
  • To specify that a statement is not imported during reverse engineering (the #ifndef that protects h files from multiple includes)
$Fork
Framework: start method Used to specify whether the OMMainThread singleton event loop runs on the application main thread or in a separate thread.
$FullCodeGeneratedFileName
CG, <lang>_CG
The full path name of the file. This information is printed in headers and footers of generated files.
$FULLFILENAME
CG
The full name of the file used:
  • To generate source code for individual classes to user-specified directories
  • To specify that a statement is not imported during reverse engineering (the #ifndef that protects h files from multiple includes)
$FullModelElementName
CG, <lang>_CG
The full name of a model element in <package>::<class> format. is printed in headers and footers of generated files. For example, Radar::Engine, for a class named Engine found in a package named Radar.
$FullName
<lang>_CG
The full path of the element (P1::P2::C.a) used by the DescriptionTemplate property.
$id
ATL
The identifier.
$IDInterface
ATL
The interface ID of a COM interface.
$index
<Container Types>
An index used to randomly access items in a container.
$instance
Property: CORBA::TAO::InitialInstance Refers to the default initial instance of the TAO ORB.
$interface
ATL
The name of the interface.
$interfaceSeq
Property: CORBA::Class::IDLSequence Represents the name of the CORBA interface with the string Seq added to the end of the term.
$item
CG, <Container Types>
A class or instance whose behaviors are implemented by a container. Rational Rhapsody generates various add, remove, find, and get operations to manipulate items in containers.
$iterator
<Container Types>
The name of the iterator used to traverse a container.
$keyname
<Container Types>
The name of a key used to access items in maps. A key is typically a string that maps to a dictionary that is used to locate items.
$label
ConfigurationManagement
An optional revision label of a configuration item, provided in the Check In/Check Out window.
$log
ConfigurationManagement
An optional comment provided in the Check In window.
$LogPart
ConfigurationManagement
The user-specified comment for the CM operation.
$Login
CG, <lang>_CG
The login name of the user who generated the file. This information is printed in headers and footers of generated files.
$makefile
<lang>_CG
The name of the makefile generated by the Rational Rhapsody code generator.
$maketarget
<lang>_CG
Depending on the option selected in the Code menu, this selection expands to one of the following operations:
  • Build
  • Clean
  • Rebuild
$member
<lang>_CG
The name of the reactive member (equivalent to the base class) of the object.
$mePtr
<lang>_CG
The name of the user object (the value of the Me property). The member and mePtr objects are not equivalent if the user object is active.
$mode
ConfigurationManagement
A flag indicating the locking mode provided in the Check In/Check Out window. If the item is locked, $mode is replaced with the contents of the CM property ReadWrite. If unlocked, $mode is replaced with the contents of the ReadOnly property.
$ModePart
ConfigurationManagement
The locking mode of the CM operation.

For example, you can check out a file from an archive as either locked or unlocked.

$Name
<lang>_CG
The element name, used by the DescriptionTemplate property.
$noOfArgs
ATL
The number of arguments for the operation.
$OMAdditionalObjs
Makefiles
The list of files to be included in the executable.
$OMAllDependencyRule
Makefiles
The dependency rule of a specific source file (A.cpp: A.h B.h C.idl).
$OMBuildSet
Makefiles The compiler switches for Debug versus Release mode, as specified in the Settings window for the active configuration.
$OMCleanOBJS
Makefiles The list of delete commands for each object file in the makefile. Each entry in the list is created from the value of the ObjCleanCommand property.
$OMCOM
Makefiles
Specifies that the COM application to be linked is a windows application rather than a console application. This keyword is resolved based on the value of the <lang>_CG::
<Environment>::COM
property.
$OMConfigurationCPPCompile
Switches
Makefiles
The compiler switches specified by the CompileSwitches property for a configuration.
$OMConfigurationLink
Switches
Makefiles
The link switches of the configuration, set in the Settings tab for the configuration.
$OMContextDependencies
Makefiles
The list of dependencies and the compilation command for each model file that is built as part of the component. Each entry is made up of the value of the DependencyRule property followed by the value of the CPPCompileCommand property.
$OMContextMacros
Makefiles
The set of generated macros, including:
  • OMROOT
  • CPP_EXT/C_EXT
  • H_EXT
  • OBJ_EXT
  • LIB_EXT
  • INSTRUMENTATION
  • TIME_MODEL
  • TARGET_TYPE
  • TARGET_NAME
  • The "all" rule
  • TARGET_MAIN
  • LIBS
  • INCLUDE_PATH
  • ADDITIONAL_OBJS
  • OBJS

For more information, see MakeFileContent.

$OMCPPCompileCommandSet
Makefiles
The compilation switches related to the CPPCompileDebug/CPPCompileRelease properties. The property to be used is based on the value of the BuildCommandSet property. Set the value of BuildCommandSet using the configuration Settings tab in the browser.
$OMCPPCompileDebug
Makefiles
The compile switches needed to create a Debug version of a component in a given environment, as specified by the CPPCompileDebug property.
$OMCPPCompileRelease
Makefiles The compile switches needed to create a Release version of a component in a given environment, as specified by the CPPCompileRelease property.
$OMFileCPPCompileSwitches
Makefiles This is used in the CPPCompileCommand property to bring in additional GUI-defined settings. The content is generated by Rational Rhapsody (either based on content of fields or based on internal rules).

It is one of the predefined keywords including, but not limited to:

  • $OMCPPCompileDebug
  • $OMCPPCompileRelease
  • $OMLinkDebug
  • $OMLinkRelease
  • $OMBuildSet
  • $OMContextMacros
$OMDefaultSpecification
Directory
Makefiles Supports the default specification/implementation source directory feature.

To set a default directory for a configuration, set the <lang>_CG::
Configuration::
DefaultSpecification-Directory and <lang>_CG::
Configuration::
DefaultImplementation-Directory
properties

$OMDEFExtension
Makefiles The extension of the definition file (.def). This keyword applies to the MicrosoftDLL/COM environments.
$OMDllExtension
Makefiles The extension of the dynamic linked library file (.dll). This keyword applies to the MicrosoftDLL/COM environments.
$OMExeExt
Makefiles
The extension of the compiled executable.
$OMFileDependencies
Makefiles
Used as part of a source file dependency line. It is a calculated list of files on which the source file depends.
$OMFileImpPath
Makefiles
The relative name and path of the implementation file. It is used in a source file dependency and compilation commands.
$OMFileObjPath
Makefiles
The relative path and name of an object file that is related to a given implementation and specification files. It is used as part of a file compilation command.
$OMFileSpecPath
Makefiles
The relative path and name of a specification file. It is used in a source file dependency line.
$OMFlagsFile
Makefiles Maintained for backwards compatibility.
$OMImpIncludeInElements
Makefiles
The list of all #includes done in the related implementation file. It is used as part of a source file dependency line.
$OMImplExt
Makefiles
The extension of an implementation file generated for a model element.
$OMIncludePath
Makefiles
The include path. The path is calculated from dependencies between components and from the Include Path setting in the active component/configuration feature window.
$OMInstrumentation
Makefiles
The active configuration instrumentation mode (None, Tracing, or Animation).
$OMInstrumentationFlags
Makefiles
Represents the preprocessor directives required for the selected type of instrumentation: animation, tracing, or none.
$OMInstrumentationLibs
Makefiles
Represents the libraries required for the selected type of instrumentation: animation, tracing, or none.
$OMLibExt
Makefiles
The extension of library files.
$OMLibs
Makefiles
The names of additional libraries (besides the framework library) to link when building a component. It is calculated from dependencies between components and the Libraries list in the active component/configuration feature windows.
$OMLibSuffix
Code Generation
Represents the suffix to use for library names. The keyword is replaced by the value of the DebugLibSuffix property or the ReleaseLibSuffix property depending upon the build.
$OMLinkCommandSet
Makefiles
The link switches related to the LinkDebug/LinkRelease properties. The property to be used is based on the value of the BuildCommandSet property. Set the value of BuildCommandSet using the configuration Settings tab in the browser.
$OMLinkDebug
Makefiles
The environment-specific link switches used to build a Debug version of a component. This switch is the value of the LinkDebug property.
$OMLinkRelease
Makefiles
The value of the LinkRelease property.
$OMMainImplementationFile
Makefiles
The main file name and path:

[<imp dir>/]$TARGET_
MAIN)$(CPP_EXT)

$OMMakefileName
Makefiles
The name of the makefile.
$OMModelLibs
Makefiles
The library component the model depends on.

For example, if executable component A depends on the library component L, this keyword is replaced with the string <filepath>\L.lib.

$OMObjExt
Makefiles
The extension of object files (temporary compiler files) for a given environment. This is the value of the ObjExtension property.
$OMObjs
Makefiles
The list of object files to link into the build by the makefile.
$OMObjectsDir
Makefiles
A calculated keyword based on the <lang>_CG::
<Environment>::
ObjectsDirectory
property).
$OMRoot
ConfigurationManagement, 
General, <lang>_CG, 
<lang>_Roundtrip, makefiles
The location of the \Share subdirectory in the Rational Rhapsody installation. This is set in your rhapsody.ini file.
$OMRPFrameWorkDll
Makefiles
Links the COM application with the DLL version of the framework instead of the default static libraries. This keyword is resolved based on the value of the <lang>_CG::
<Environment>::
RPFrameWorkDll
property.
$OMRulesFile
  Maintained for backwards compatibility.
$OMSourceFileList
Makefiles
(Rational Rhapsody in J) Lists the source (*.java) files used in a build.
$OMSpecExt
Makefiles
The extension of the specification file generated for a model element.
$OMSpecIncludeInElements
Makefiles
Lists all the #includes done in the related specification file.
$OMSubSystem
Makefiles
The type of program for the Microsoft linker (for example, windows).
$OMTargetMain
Makefiles
The name of the file that contains the main() function for an executable component.
$OMTargetName
Makefiles
The name of the compiled version of a component.
$OMTargetType
Makefiles
The type of component to be built (library or executable),
$OMTimeModel
Makefiles
The time model setting for a configuration (simulated or real time).
$OMUserIncludePath
INTEGRITY build files (.gpj) Represents the content of the Include Path field found on the Settings tab of the Features window for configurations. This content is included in generated .gpj files for environments that use such files, for example, INTEGRITY5.
$operations
ATL
The list of operations.
$opname
ATL The name of the operation.
$opRetType
ATL The return type of the operation.
$package
ATL The name of the package.
$PackageLib
ATL The package library.
$ProgID
ATL The value of the ProgID property (Default = $component.$class.1).
$projectname
ConfigurationManagement
The project name.
$<Property>
<lang>_CG
The value of the element property with the specified name (under C or CPP_CG::CG::
<metatype>
). This keyword is used by the DescriptionTemplate property.
$RegTlb
ATL
Specifies whether the COM server needs to register its type library. Automatically expands to TRUE/FALSE depending upon COM ATL server includes type library.
$RhapsodyVersion
CG, <lang>_CG
The current version of Rational Rhapsody, not including the build number. This information is printed in headers and footers of generated files.
$rhpdirectory
ConfigurationManagement
The path to the _rpy directory, which consists of the project repository. The repository contains all the configuration items for a project.
$Signature
<lang>_CG
The operation signature, used by the DescriptionTemplate property.
$state
Properties 
CPP_CG::Framework::IsInCall
CPP_CG::Framework::IsComple
tedCall
In the code generated by Rational Rhapsody for checking whether an application is in a given state, this keyword is replaced by the state name.
$target
<Container Types>, <lang>_CG
The target of an operation on relations. This is generally the role name.

For example, in a class with a relation called myServer, the role name myServer would replace the variable $target when expanding properties that involve that relation. The value add$target:c would become:

addMyServer()

The qualifier :c capitalizes the role name.

$Target
<lang>_CG
The other end of the association, used by the DescriptionTemplate property.
$targetDir
ConfigurationManagement
The target directory.
$ThreadModel
ATL
The value of the ThreadingModel property (Default = Apartment).
$tlbPath
ATL
The full path of the COM type library file.
$type
CG, <lang>_CG
The name of the type.

For example, if you create a type named MyType and set its in property to "const $type&", the generation of an in argument is as follows:

"const MyType& <argname>"

$Type
<lang>_CG
The argument type, used by the DescriptionTemplate property.
$TypeName
ATL
The value of the TypeName property, which specifies the declaration of the class type being registered (Default = $class).
$unit
ConfigurationManagement
Unit of collaboration. This is the name of the file that corresponds to the configuration item (package, configuration, or diagram) on which a CM command operates. If more than one unit is provided, the command is performed repeatedly in a for each loop.
$VersionIndepProgID
ATL
Replaced with the value of the VersionIndepProgID property (Default = $component.$class).
$VtblName
<lang>_CG
The name of the virtual function table for the object, specified by the ReactiveVtblName property.

The following table lists the predefined Rational Rhapsody macros used in the framework files and makefiles.

Macro Description
AR
The command to build a library.
ARFLAGS
The flags used to build a library.
CP
Environment-specific copy command.
CPP_EXT
Environment-specific extension for C++ implementation files (for example, .cpp).
DLL_CMD
Expands to the DLL link command that initiates the DLL link phase of a build
DLL_FLAGS
Expands to the switches applied to the DLL link command
H_EXT
Environment-specific extension for C++ implementation files (for example, .h).
INCLUDE_QUALIFIER
The qualifier used in a given environment to designate an include file in the compiler or link switches.
LIB_CMD
The command to build a library.
LIB_EXT
Environment-specific extension for library files (for example, .lib).
LIB_FLAGS
The flags used to build a library.
LIB_NAME
The name of a library.
LIB_POSTFIX
The postfix added between the main file name and the extension. The possible values are as follows:
  • sim for simulated time (for example, oxfsim.lib)
  • inst for instrumentation (for example, oxfinst.lib)
  • siminst for simulated time and instrumentation (for example, oxfsiminst.lib)

This macro is not used for DLLs.

LIB_PREFIX
The prefix added to the beginning of a file name. For example, the prefix "Vx" is added to VxWorks libraries.

This macro is not used for DLLs.

LINK_CMD
Expands to the link command that initiates the link phase of a build
LINK_FLAGS
Expands to the link switches applied to the link command
OBJ_EXT
The environment-specific extension for object files (for example, .o or .obj).
OBJS
The intermediate object files to be built (for example, aombrk.obj).
PDB_EXT
The environment-specific extension for PDB debug files (for example, .pdb).
RM
The environment-specific remove command for deleting files.
RMDIR
The environment-specific remove command for deleting directories. This is used in the clean rules when you set the <lang>_CG::<Environment>::ObjectsDirectory property.

Feedback