|Home > Class Reference > CAInterface class > About the CAInterface class|
CAInterface provides a basis for a software model built around components and interfaces.
For CADI, an interface:
if_name_tand an integer revision of type
if_rev_t. A higher revision number indicates a newer revision of the same interface.
A component is a black-box entity that has a unique identity and provides concrete implementations of one or more interfaces:
There is no way for a client to enumerate the set of interfaces that a component implements. The client must ask for specific interfaces by name.
(The implementation of a component interface might be provided by one or several interacting C++ objects. This is an implementation detail that is opaque to the client.)
CAInterface class is the base class
for all interfaces. It defines a method,
that enables a client to obtain a reference to any of the interfaces
that the component implements.
The client specifies the ID and revision of the interface
that it is requesting. The component can return
it does not implement that interface, or only implements a lower
Because each interface derives from
a client can call
ObtainInterface() on any
one interface pointer to obtain a pointer to any other interface
implemented by the same component.
These rules govern the use of components and interfaces:
ObtainInterface()call on one component must not return an interface on a different component.
NULLor a pointer, castable to the class type.
if_name_t, the newer revision of the interface must be compatible with the old revision. (This includes the binary layout of any data structures that it uses and the semantics of any methods.)
ObtainInterface()for a given interface name and revision must always return the same pointer value. It must not matter which of the component interfaces is used to invoke