The base
C++ class,
ATTRIB, provides the data and functionality that all attributes share. The developer creates specific classes of attributes by deriving those classes from
ATTRIB and adding extra information and functionality.
|
|
Each attribute class generally has a
.hxx header file that defines the class, includes necessary header files, and prototypes related functions. It also has a
.cxx source file that implements all of the methods of the attribute class (that were not defined as inline methods within the body of the class in the
.hxx header file). The
cxx source file includes the
.hxx class header file and also defines class-specific macros.
|
|
Because both the header file and the implementation file are highly stylized, a number of attribute code macros are provided to simplify the derivation process. The macros also help to maintain compatibility with other attributes and entities. Refer to
User-Defined Attribute Macros and
Predefined Attribute Macros for more information.
|
|
Organization attribute classes are always the first level of derivation from the
ACIS class
ATTRIB (Figure 3-5). They define no methods or data of their own, and are not instantiated.
Specific attribute classes are derived from the organization class (i.e., a second-level derivation from
ATTRIB), define data and methods, and are instantiated. They may be categorized as simple, complex, or bridge attributes.
|
|
|
|
Figure 3-5. Attribute Derivation
|