Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

examp6.cpp

This example is to show use of the Composite types and pattern.

In our scenario we have non-typed composites (other than the fact they are Equipment) and concrete equipment types (HardDrive, PowerSupply).

We could have created concrete composites (Bus, Case, etc.) and added semantics to them. For example, is it semantically correct for a Case to have a hard-drive, or a Bus to have a power-supply? We leave that to the curious.

We use the TransparentComponent to reduce the amount of type checking. This has its drawbacks as can be seen in the recursion function "dumpComposites".


This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium