Each component used in the solution must be described in the CDL language, in a separate <component name>.cdl
file.
The name of a CDL file must match the name of the component that it describes.
An CDL file contains the following sections:
component
is placed before the component name.The component name must begin with an uppercase letter and must not contain an underscore (_).
security
, which should be followed by the full name of the interface.interfaces
section in which each interface implementation is specified with a separate string in the following format:interfaces {
<interface implementation name>:<interface name>
}
A component can contain several implementations of one interface. All implemented interfaces must be described in the IDL language in IDL files.
The interface implementation name must not contain an underscore (_).
components
section in which each component instance is specified with a separate string in the following format:components {
<component instance name>:<component name>
}
For each specified component, a separate file named <component name>.cdl
needs to be created, containing a description of the component in the CDL language. Multiple instances of the same component can be added to a component, and each instance can have a separate state.
The component instance name must not contain an underscore (_).
CDL supports single-line comments and multi-line C++-style comments.
Examples of CDL files
At its simplest, the component contains a single interface implementation similar to the ping
component from the echo example.
Ping.cdl
/* Component name: Ping */
component Ping
/* The component contains a named implementation of the IPing interface. Implementation name: pingimpl.*/
components {
pingimpl: IPing
}
In the following example, the CoFoo
component contains implementations of two interfaces declared in two different packages named Foo
and Baz
(i.e. in the Foo.idl
and Bar.idl
files):
CoFoo.cdl
/* Component name: CoFoo */
component CoFoo
interfaces {
/* The component contains an implementation of the Foo interface. Implementation name: foo.*/
foo: Foo
/* The component contains three different implementations of the Bar interface. Names of the implementations: bar1, bar2 and bar3.*/
bar1: Bar
bar2: Bar
bar3: Bar
}
In the following example, the CoFoo
component contains a single interface implementation and an embedded component.
CoFoo.cdl
/* Component name: CoFoo */
component CoFoo
interfaces {
/* The component contains an implementation of the Foo interface. Implementation name: foo.*/
foo: Foo
}
components {
/* The component contains an instance of the CoBar component. Instance name: bar.*/
bar: CoBar
}
Page top