To create an organization attribute class
.cxx implementation file:
|
|
|
1.
|
Copy the
at_tsl.cxx file from the
ACIS installation directory and rename it
at_abc.cxx. (If you do not have the source file, enter the content from this example into a file.)
|
|
|
2.
|
Change the bold sentinels as was done for the
at_abc.hxx header file.
|
|
|
3.
|
Enter statements to include the header files necessary to define the attribute.
|
|
Note
|
File kernel/acis.hxx should always be the first header file included in every ACIS application .cxx implementation file.
|
|
Example 3-3 of the attribute implementation file shows the sentinels that are to be replaced in
bold font. In the new file, the new sentinel is shown inbold italic font.
|
|
C++ Example
|
|
#include <stdio.h>
|
#include "kernel/acis.hxx"
|
#include "kernel/dcl_kern.h"
|
#include "kernel/kerndata/attrib/at_tsl.hxx"
|
#include "kernel/kerndata/data/datamsc.hxx"
|
|
// Define macros for this attribute and its parent, to provide
|
// the information to the definition macro.
|
|
#define THIS() ATTRIB_TSL
|
#define THIS_LIB KERN
|
#define PARENT() ATTRIB
|
#define PARENT_LIB KERN
|
|
// Identifier used externally to identify a particular entity
|
// type. This is only used within the save/restore system for
|
// translating to/from external file format, but must be unique
|
// amongst attributes derived directly from ATTRIB, across all
|
// application developers.
|
|
#define ATTRIB_TSL_NAME "tsl"
|
|
MASTER_ATTRIB_DEFN( "tsl master attribute" )
|
|
Example 3-3. Original at_tsl.cxx
|
|
The macro
MASTER_ATTRIB_DEFN generates all the code necessary to define the organization attribute class. The character string is the value returned by the
type_name method. After customizing
.at_tsl.cxx into
.at_abc.cxx, the organization class file should appear similar to Example 3-4.
|
|
C++ Example
|
|
#include <stdio.h>
|
#include "kernel/acis.hxx"
|
#include "kernel/dcl_kern.h"
|
#include "kernel/kerndata/data/datamsc.hxx"
|
#include "at_abc.hxx"
|
|
// Define macros for this attribute and its parent, to provide
|
// the information to the definition macro.
|
|
#define THIS() ATTRIB_ABC
|
#define THIS_LIB NONE
|
#define PARENT() ATTRIB
|
#define PARENT_LIB KERN
|
|
// Identifier used externally to identify a particular entity
|
// type. This is only used within the save/restore system for
|
// translating to/from external file format, but must be unique
|
// amongst attributes derived directly from ATTRIB, across all
|
// application developers.
|
|
#define ATTRIB_ABC_NAME "abc"
|
|
MASTER_ATTRIB_DEFN( "abc master attribute" )
|
|
Example 3-4. Customized at_abc.cxx
|