parent property
DEPRECATED.
Purpose
Control the placement of an option within the configuration hierarchy.
Syntax
{
"cdlOptions": [
{
"name": "<name>",
...
"parent": "<string>",
...
}
]
}
The value of the parent property is a string containing the xCDL path of the
parent object.
Default value
If missing (the usual case), the surrounding object is considered the natural parent of this object. If none, the package object in the parent folder is used.
Description
Configuration objects exist within a hierarchy of packages and components. By
default, an object's position in the hierarchy is determined by its location
within the xCDL scripts, based on its position in the folder hierarchy. Packages
are generally placed at the top level of the configuration. Any cdlComponents
or cdlOptions objects defined at the same level
in a package's top-level xCDL script are placed immediately below that package
in the hierarchy. Any cdlOptions or cdlComponents objects defined within a
cdlComponents object, or read in as a result of processing an
object's includeCDLs property, will be placed immediately below that
cdlComponents in the hierarchy.
In some cases, it is useful to specify an alternative position in the hierarchy
for a given object. For example, it is often convenient to re-parent device
driver packages below the io package in the configuration hierarchy, reducing
the number of packages at the top level and making navigation easier. The
dot path naming convention can be used to achieve this.
Re-parenting to another package
Although the parent property affects an object's position in the overall
hierarchy and whether or not that object is active, a re-parented object still
belongs to the package that defines it. By default, any #define statements
will be generated into that package's configuration header file. Any
sourceFiles properties can only reference source files present in that
actual package, and it is not possible to cause a file in another package to be
built by re-parenting.
To implement this, objects should keep track of two parents, the one where the definition resides and the re-parented one (package-parent and activation-parent).
As a special case, if an empty string is specified for the parent, the object
is placed at the top of the hierarchy, ahead of any packages not explicitly
re-parented in this way. This feature is useful for configuration options such
as global preferences and default compiler flags.
Example
{
"cdlComponents": [
{
"name": "trace",
...
"cdlComponents": [
{
"name": "buffer",
"display": "Buffered tracing",
"customDefine": "OS_DEBUG_INFRA_DEBUG_TRACE_ASSERT_BUFFER",
"activeIf": [ "isEnabled('trace')" ]
}
],
"cdlOptions": [
{
"name": "size",
"display": "Trace buffer array size",
"parent": "buffer",
"valueType": "int",
"defaultValue": "32",
"legalValues": "5 to 65535"
}
]
}
]
}
See also
cdlComponentsobjectincludeCDLsproperty
eCos reference
parentproperty