Overview
The profile is centered on
<<CFamilyCodeDeployment>>, which
defines how generated C and C++ files are named, organized, and
complemented with additional resources such as build files and text
templates.
Profile Package
-
Profile Name:
SoftwareProducerCodeDeployment
-
Description: UML profile for
code deployment configuration
-
Applies To: Projects
requiring customizable code generation output structure
Stereotypes
<<CodeDeployment>>
|
Attribute
|
Value
|
|
Name
|
CodeDeployment
|
|
Applies To
|
Class (only)
|
|
Description
|
Abstract base stereotype for code deployment
configurations. Contains language-independent deployment
properties such as additional resources. Concrete
deployment stereotypes (for example,
<<CFamilyCodeDeployment>>)
extend this stereotype.
|
|
Abstract
|
Yes — not directly instantiable from the palette
|
Tagged Values (Properties)
Additional Resources
|
Property
|
Type
|
Multiplicity
|
Default
|
Description
|
FR Reference
|
additionalResources
|
<<Resource>>
|
0..*
|
(empty)
|
Collection of class elements with
<<Resource>> stereotype
that defines additional files to generate. Each
resource’s filePath property specifies the output
filename (for example, CMakeLists.txt, Makefile).
|
REQ_DEPLOY_CC_911, REQ_DEPLOY_CC_923
|
Note:
Note: The
codeDeployment property on the generation
configuration is optional
(multiplicity 0..1). When no deployment is explicitly
selected, the system uses an internal default flat
deployment. This let’s you generate code without creating or
selecting a deployment configuration.
<<CFamilyCodeDeployment>>
|
Attribute
|
Value
|
|
Name
|
CFamilyCodeDeployment
|
|
Extends
|
<<CodeDeployment>>
|
|
Applies To
|
Class (only)
|
|
Description
|
Defines a C or C++ code deployment configuration
containing directory structure patterns, file naming
templates, extension mappings, file header templates, and
additional resources.
|
|
Palette Entry
|
C and C++ Code Deployment in Code
Deployment category
|
|
Diagram
|
Software Producer Configuration Diagram
|
|
Shape
|
Rectangle (displays key properties)
|
|
Icon
|
CFamilyCodeDeployment|32
|
Tagged Values (Properties)
Note:
Inherits additionalResources from
<<CodeDeployment>>.
Directory Configuration
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
publicArea
|
String
|
include
|
Directory for public headers within each
<<ModelLibrary>>.
Available as <area.public> in
path patterns and ${area_public} in
templates.
|
REQ_DEPLOY_CC_201
|
internalArea
|
String
|
internal
|
Directory for internal (nonpublic) headers within each
<<ModelLibrary>>.
Available as <area.internal>
in path patterns and
${area_internal} in templates.
|
REQ_DEPLOY_CC_201
|
sourceArea
|
String
|
src
|
Directory for all source files within each
<<ModelLibrary>>.
Available as <area.source> in
path patterns and ${area_source} in
templates.
|
REQ_DEPLOY_CC_201
|
File Extension Configuration
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
cppHeaderExt
|
String
|
.hpp
|
File extension for C++ header files
|
REQ_DEPLOY_CC_1102
|
cppSourceExt
|
String
|
.cpp
|
File extension for C++ source files
|
REQ_DEPLOY_CC_1102
|
cHeaderExt
|
String
|
.h
|
File extension for C header files
|
REQ_DEPLOY_CC_1102
|
cSourceExt
|
String
|
.c
|
File extension for C source files
|
REQ_DEPLOY_CC_1102
|
File Path Patterns
Path patterns use the <variable>
syntax (CATIA Magic convention). See
Path
Variable Reference for available variables.
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
publicHeaderPath
|
String
|
<area.public>/<lib.dir><package.lib.path>/<file.name>
|
Full path pattern for public headers
|
REQ_DEPLOY_CC_311
|
internalHeaderPath
|
String
|
<area.internal>/<lib.dir><package.lib.path>/<file.name>
|
Full path pattern for internal (nonpublic) headers
|
REQ_DEPLOY_CC_311
|
sourcePath
|
String
|
<area.source>/<lib.dir><package.lib.path>/<file.name>
|
Full path pattern for all source files
|
REQ_DEPLOY_CC_311
|
UML Element File Name Patterns
File name patterns use the <variable>
syntax. See
File
Name Variable Reference for available variables.
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
classFileName
|
String
|
<element.name><file.ext>
|
File name pattern for Class files
|
REQ_DEPLOY_CC_302
|
stateMachineFileName
|
String
|
<parent.name><element.name>StateMachine<file.ext>
|
File name pattern for StateMachine files
|
REQ_DEPLOY_CC_302
|
activityFileName
|
String
|
<parent.name><element.name>Activity<file.ext>
|
File name pattern for Activity files
|
REQ_DEPLOY_CC_302
|
opaqueBehaviorFileName
|
String
|
<parent.name><element.name>Behavior<file.ext>
|
File name pattern for OpaqueBehavior files
|
REQ_DEPLOY_CC_302
|
publicTypesFileName
|
String
|
<package.name>Types<file.ext>
|
File name pattern for package types header (public
types)
|
REQ_DEPLOY_CC_302, REQ_DEPLOY_CC_501
|
internalTypesFileName
|
String
|
<package.name>InternalTypes<file.ext>
|
File name pattern for internal types header
(package/protected/private visibility types)
|
REQ_DEPLOY_CC_302, REQ_DEPLOY_CC_5021
|
constraintFileName
|
String
|
<parent.name><element.name>Constraint<file.ext>
|
File name pattern for Constraint files
|
REQ_DEPLOY_CC_302
|
C Element Naming Configuration
Naming patterns use the <variable>
syntax. See
C
Element Naming Variable Reference for available
variables.
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
cPublicElementNamingPattern
|
String
|
<lib.prefix><element.lib.qname>
|
Pattern for public C element (struct/class) names.
Controls how C symbols are qualified to avoid naming
collisions; by default the library-relative name
prefixed with the library name, like the internal
pattern.
|
REQ_DEPLOY_CC_601
|
cInternalElementNamingPattern
|
String
|
<lib.prefix><element.lib.qname>
|
Pattern for internal (nonpublic) C element
(struct/class) names. By default the library-relative
name prefixed with the library name
(<lib.prefix> is empty
outside a
<<ModelLibrary>>),
which avoids cross-library naming conflicts.
|
REQ_DEPLOY_CC_602
|
Default
fileHeaderTemplate:
@@/* Generated on ${generation_date} */
##COMMENT {
${comment_banner}
@file ${file_name}
Automatically generated by Software Producer Engineer
UML Classes Code Generator @version v${generator_version}
##ORIGINS {
@generated_from ${element_id}
##}
${comment_banner}
##}
Note:
Deferred property (not
yet implemented — see the Specification for a full
definition):
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
|---|
doxygenCommandStyle
|
DoxygenCommandStyle
|
at
|
Command prefix style for Doxygen
(@ or \)
|
REQ_DEPLOY_CC_403
|
This property is specified but not yet exposed in the
profile. It will be added in a future release.
<<Resource>>
|
Attribute
|
Value
|
|
Name
|
Resource
|
|
Applies To
|
Class (only)
|
|
Description
|
Defines an additional resource file to generate. The
filePath property specifies the output
filename, and the content property
references a <<Content>>
element (for example, a
<<TextTemplate>>)
containing the resource content. Referenced by
<<CodeDeployment>> elements
via the additionalResources property.
|
|
Usage
|
Create Class with
<<Resource>> stereotype and
reference from
<<CodeDeployment>>.additionalResources
|
|
Icon
|
Resource
|
Tagged Values (Properties)
|
Property
|
Type
|
Default
|
Description
|
FR Reference
|
name
|
String
|
(element name)
|
Display name for the resource
|
—
|
filePath
|
String
|
<element.name>
|
Output file path pattern (for example,
CMakeLists.txt,
Makefile). Supports
<variable> substitution.
Available variables:
<element.name>,
<lib.name>,
<lib.dir>,
<lib.prefix>,
<configuration.name>,
<project.name>, and for a
Package scope
<package.name>,
<package.path>,
<package.lib.path>.
|
REQ_DEPLOY_CC_913
|
scope
|
ResourceScope
|
Project
|
Determines the generation scope of this resource: once
per project, once per library, or once per package.
|
—
|
content
|
<<Content>>
|
(empty)
|
Reference to a
<<Content>> element (for
example,
<<TextTemplate>>)
containing the resource body.
|
REQ_DEPLOY_CC_912
|
<<Content>> (Abstract)
|
Attribute
|
Value
|
|
Name
|
Content
|
|
Applies To
|
Class (only)
|
|
Description
|
Abstract base stereotype for content definitions. Concrete
subtypes (for example,
<<TextTemplate>>) define
specific content formats.
|
|
Abstract
|
Yes — not directly instantiable
|
<<TextTemplate>>
|
Attribute
|
Value
|
|
Name
|
TextTemplate
|
|
Extends
|
<<Content>>
|
|
Applies To
|
Class (only)
|
|
Description
|
Defines a text-based template with variable substitution
and collection macros. Used as content for
<<Resource>> elements and
can also be referenced by
fileHeaderTemplate on
<<CFamilyCodeDeployment>>,
enabling reuse of the same template across multiple
deployments.
|
|
Usage
|
Create Class with
<<TextTemplate>>
stereotype, set the body property, and
reference from
<<Resource>>.content or
<<CFamilyCodeDeployment>>.fileHeaderTemplate.
|
|
Icon
|
TextTemplate
|
Tagged Values (Properties)
body — String
Default: "" FR Reference: REQ_DEPLOY_CC_912
Template content with ${variable}
substitution and collection macros. Use $$
to produce a literal $ character in the
output. See Body
Syntax Quick Reference for all available variables and
macros.
Body Syntax Quick Reference
Note:
The text below can be pasted into the
<<TextTemplate>> stereotype’s
Documentation/Comments
field in CATIA Magic to provide an inline reference for
template authors.
Template content with ${variable} substitution and macros.
Use $$ to produce a literal $ in output (e.g., $${CMAKE_VAR} renders as ${CMAKE_VAR}).
VARIABLES (${variable_name} syntax)
===================================
Available in all templates (file headers and resources):
${lib_name} Name of the <<ModelLibrary>>
${lib_dir} "<lib_name>/" inside a <<ModelLibrary>>, empty otherwise
${lib_prefix} "<lib_name>_" inside a <<ModelLibrary>>, empty otherwise
${area_public} Public include directory (from publicArea)
${area_internal} Internal include directory (from internalArea)
${area_source} Source files directory (from sourceArea)
${year} Current year
${generation_date} Date of code generation
${generator_version} Software Producer version
${comment_banner} String of * characters (length from bannerLength)
${configuration_name} Name of the generation configuration
${project_name} Name of the current project
Available in file headers only (fileHeaderTemplate):
${file_name} Generated file name
${element_id} UUID of the source UML element
${element_qname} Fully qualified element name, _-joined
${element_relname} Chain of non-package owners including the element, _-joined
${parent_relname} Chain of non-package owners excluding the element, _-joined
${package_name} Package owning the element
${package_path} Full package path with / separator
${package_lib_path} Package path relative to the <<ModelLibrary>> (library excluded)
Available inside file collection macros (##ALL_SOURCES, ##PUBLIC_HEADERS, ...):
${file_path} Full path relative to library root
${file_name} Filename with extension
${file_basename} Filename without extension
${rel_path} Path relative to area directory
Available inside ##LIBRARIES blocks:
${lib_name}, ${lib_dir}, ${lib_prefix} Reassigned per iterated library
Available everywhere in a resource template, where they designate the package of the
resource scope (the root model, the library or the package), and inside ##PACKAGES blocks,
where they designate the iterated package:
${package_name} Package leaf name
${package_path} Full package path with / separator
${package_lib_path} Package path relative to the <<ModelLibrary>> (library excluded)
Available inside ##USED_PACKAGES blocks (LIBRARY and PACKAGE scope):
${used_package_name} Leaf name of a package the current scope uses
${used_package_path} Its full package path with / separator
${used_package_lib_path} Its package path relative to the <<ModelLibrary>>
MACROS
======
File header macros:
##COMMENT { ... ##} Wraps content in comment delimiters per doxygenCommentStyle
##ORIGINS { ... ##} Iterates over source UML elements
@@ (line prefix) Content excluded from file comparison
Resource collection macros (file iteration):
##PUBLIC_HEADERS { ... ##} Public header files
##INTERNAL_HEADERS { ... ##} Internal header files
##ALL_SOURCES { ... ##} All source files
##ALL_SOURCE_DIRS { ... ##} Distinct directories containing source files
##ALL_HEADERS { ... ##} All header files
Resource scope macros:
##LIBRARIES { ... ##} Iterates over <<ModelLibrary>> packages (PROJECT scope; the root
model is not one of them)
##PACKAGES { ... ##} Iterates over the packages inside the current scope that own
generated code, at any depth
##USED_PACKAGES { ... ##} Iterates over the packages the current scope uses outside itself,
from the model's UML Usage relationships (a Usage between
elements counts for their packages; a Usage from a package to a
package is inherited by the packages below it)
-- LIBRARY and PACKAGE scope templates
Enumerations
ResourceScope
|
Attribute
|
Value
|
|
Name
|
ResourceScope
|
|
Description
|
Defines the generation scope for a
<<Resource>> element
|
Enumeration Literals
|
Literal
|
Display Name
|
Description
|
Project
|
Project
|
Resource is generated once per project (default)
|
Library
|
Library
|
Resource is generated once per
<<ModelLibrary>>
|
Package
|
Package
|
Resource is generated once per package
|
Default:
Project — the value the profile itself
declares on the scope property.
A Library or Package
resource is rendered once per library/package, so its
filePath MUST carry a discriminating variable
(for instance <lib.name>); otherwise
every render resolves to the same file and only the last one
survives. The generator reports that case as
ESP_RES_001.
Diagram Palette Configuration
Palette Category: Code Deployment
|
Element Name
|
Creates
|
Stereotype Applied
|
Shape
|
|
C and C++ Code Deployment
|
Class
|
<<CFamilyCodeDeployment>>
|
Rectangle
|
Diagram Type: CATIA Software
Producer configuration diagram
Variable Syntax Conventions
This profile uses two distinct variable syntaxes depending on
context:
|
Context
|
Syntax
|
Notation
|
Example
|
|
Path patterns (filePath,
publicHeaderPath, etc.)
|
<variable.name>
|
Dot notation
|
<area.public>/<package.path>/<file.name>
|
|
Template bodies
(TextTemplate body, fileHeaderTemplate)
|
${variable_name}
|
Underscore notation
|
${lib_name},
${area_public}
|
The <variable> syntax follows the CATIA
Magic convention for path patterns. The
${variable} syntax is used in template bodies
where content is rendered as text.
Escape Character
In template bodies (${...} syntax), use
$$ to produce a literal $
character in the output. For example, the rendering of
$${MY_VAR} in a template is
${MY_VAR} in the generated file (useful for
CMake/Makefile variables that must not be substituted).
Template Variables Reference
Variables for File Name Patterns
(*FileName Properties)
Syntax:
<variable.name> (Path Syntax)
|
Variable
|
Description
|
Example
|
<element.name>
|
Simple name of the UML element
|
MyClass
|
<element.qname>
|
Fully qualified name with _ separator
(from root)
|
Root_Sub_MyClass
|
<element.lib.qname>
|
Qualified name relative to the
<<ModelLibrary>>, the
library name excluded
(<lib.prefix><element.lib.qname>
includes it)
|
Continue_Nesting_MyClass
|
<parent.name>
|
Name of owning element (empty for standalone)
|
Button
|
<element.relname>
|
Chain of non-package owners including the element,
_-joined. Equals
<element.name> for standalone
elements.
|
Button_Toggle
|
<parent.relname>
|
Chain of non-package owners excluding the element,
_-joined. Empty when the element is
directly owned by a package.
|
Button
|
<file.ext>
|
Current file extension
(.hpp for headers,
.cpp for sources in C++ mode)
|
.hpp or .cpp
|
<package.name>
|
Name of containing package
|
Nesting
|
<package.qname>
|
Fully qualified package name with _
separator
|
Root_Sub_Pkg_SubPkg
|
<package.lib.qname>
|
Package qualified name relative to the
<<ModelLibrary>> with
_ separator, the library name excluded
|
Continue_Nesting
|
<lib.qname>
|
Fully qualified name of the
<<ModelLibrary>> with
_ separator
|
Root_Sub_ALibrary
|
<lib.prefix>
|
<lib.name>_ when the element is
inside a <<ModelLibrary>>,
empty otherwise: composes with
<element.lib.qname> without an
orphan separator
|
ALibrary_
|
Variables for C Element Naming Patterns
(cElementNaming Properties)
Syntax:
<variable.name> (Path Syntax)
|
Variable
|
Description
|
Example
|
<element.name>
|
Simple name of the UML element
|
MyClass
|
<element.qname>
|
Fully qualified name with _ separator
(from root)
|
Root_Sub_MyClass
|
<element.lib.qname>
|
Qualified name relative to the
<<ModelLibrary>>, the
library name excluded
(<lib.prefix><element.lib.qname>
includes it)
|
Continue_Nesting_MyClass
|
<parent.name>
|
Name of owning element (empty for standalone)
|
Button
|
<element.relname>
|
Chain of non-package owners including the element,
_-joined. Equals
<element.name> for standalone
elements.
|
Button_Toggle
|
<parent.relname>
|
Chain of non-package owners excluding the element,
_-joined. Empty when the element is
directly owned by a package.
|
Button
|
<package.name>
|
Name of containing package
|
Nesting
|
<package.qname>
|
Fully qualified package name with _
separator
|
Root_Sub_Pkg_SubPkg
|
<package.lib.qname>
|
Package qualified name relative to the
<<ModelLibrary>> with
_ separator, the library name excluded
|
Continue_Nesting
|
<lib.name>
|
Name of the enclosing
<<ModelLibrary>>
|
ALibrary
|
<lib.qname>
|
Fully qualified name of the
<<ModelLibrary>> with
_ separator
|
Root_Sub_ALibrary
|
<lib.prefix>
|
<lib.name>_ when the element is
inside a <<ModelLibrary>>,
empty otherwise: composes with
<element.lib.qname> without an
orphan separator
|
ALibrary_
|
Variables for File Path Patterns (*Path
Properties)
Syntax:
<variable.name> (Path Syntax)
|
Variable
|
Description
|
Example
|
<file.name>
|
Computed filename from element-type name pattern
|
MyClass.hpp
|
<area.public>
|
Public header directory (from
publicArea)
|
include
|
<area.internal>
|
Internal header directory (from
internalArea)
|
internal
|
<area.source>
|
Source files directory (from
sourceArea)
|
src
|
<package.path>
|
Full package path with / separator
|
Root/Sub/ALibrary/Continue/Nesting
|
<package.lib.path>
|
Package path relative to the
<<ModelLibrary>>, the
library name excluded
(<lib.dir><package.lib.path>
includes it)
|
Continue/Nesting
|
<lib.name>
|
Name of the
<<ModelLibrary>>
|
ALibrary
|
<lib.dir>
|
<lib.name>/ when the element is
inside a <<ModelLibrary>>,
empty otherwise: composes with
<package.lib.path> without an
orphan separator
|
ALibrary/
|
<configuration.name>
|
Name of the generation configuration
|
MyConfig
|
<project.name>
|
Name of the current project
|
VehicleProject
|
Built-In Deployments
The following
<<CFamilyCodeDeployment>>
configurations are shipped as built-in options:
|
Name
|
File Names
|
Directory Structure
|
Build File
|
|
Flat (Default)
|
Simple
(<element.name><file.ext>), C
symbols use <element.relname>
|
No hierarchy
|
None
|
|
FlatQualified
|
Qualified:
<element.qname><file.ext> /
<lib.prefix><element.lib.qname><file.ext>
|
No hierarchy
|
None
|
|
CMake
|
Simple:
<element.name><file.ext>
|
include/ / internal/ /
src/
|
CMakeLists.txt
|
|
Makefile
|
Simple:
<element.name><file.ext>
|
include/ / internal/ /
src/
|
Makefile
|
Validation Rules Summary
Stereotype Validation
|
Rule
|
Applies To
|
FR Reference
|
Name contains only [A-Za-z0-9_-]
|
<<CFamilyCodeDeployment>>
name
|
REQ_DEPLOY_CC_1001
|
|
Unique name within project
|
<<CFamilyCodeDeployment>>
|
REQ_DEPLOY_CC_1006
|
|
Nonempty patterns
|
All pattern properties
|
REQ_DEPLOY_CC_1003
|
|
Valid path characters
|
publicArea,
internalArea,
sourceArea
|
REQ_DEPLOY_CC_1002
|
Closed variable placeholders
<...> in paths,
${...} in templates
|
All pattern properties
|
REQ_DEPLOY_CC_1004
|
|
Warn on unknown variables
|
All pattern properties
|
REQ_DEPLOY_CC_1005
|
Template Validation
|
Rule
|
Applies To
|
FR Reference
|
Closed macro blocks ##NAME { ... ##}
|
body property
|
REQ_DEPLOY_CC_1007
|
Valid Resource filePath (no ../, no
absolute paths)
|
Resource filePath
|
REQ_DEPLOY_CC_1008
|
|
Known collection macro names
|
body property
|
REQ_DEPLOY_CC_1009
|
|
Variables match collection context
|
body property
|
REQ_DEPLOY_CC_1010
|
Related Stereotypes Not Defined by this Feature
|