Book Contents | Book Index | Master Index | Previous Chapter | Next Chapter
Search STEP Tools Web Support

9.1 NULL Values

The following symbols are defined as null values for each of the primitive types. These values can be assigned to an attribute to "unset" the attribute. When reading or writing a Part 21 file, these values will be used to represent the "$" unset symbol.

    ROSE_NULL_INT        /* null int value */
    ROSE_NULL_REAL       /* null double value */
    ROSE_NULL_ENUM       /* null enumeration value */
    ROSE_NULL_BOOLEAN    /* null boolean/logical value */
    ROSE_NULL_LOGICAL    /* null boolean/logical value */
    ROSE_NULL_STRING     /* null string/binary value */

Refer to NULL Attribute Values for examples and discussion about the use of these predefined values.

Late-bound applications may find it easier to use the isUnset() or unset() methods on RoseObject . See RoseObject::isUnset() or RoseObject::unset() for more information.


9.2 RoseBoolean and RoseLogical

Boolean and logical values are represented by the RoseBoolean and RoseLogical defined types. These types can take on the following values:

    /* Values for booleans and logicals */
    #define ROSE_FALSE      (0)
    #define ROSE_TRUE       (1)
    #define ROSE_UNKNOWN    (2)


9.3 RoseDesignSectionType

The RoseDesignSectionType enumeration is used to indicate how the objects within a RoseDesignSection map to the organization of a Part 21 file. Sections may have one of three types, and a fourth enumerator is used by cursors to match any type. The values are as follows:

    enum RoseDesignSectionType {
        ROSE_SECTION_ANY = 0,   /* not a valid type, used by cursors */
        ROSE_SECTION_DATA,
        ROSE_SECTION_HEADER,
        ROSE_SECTION_SYSTEM
    };

The ROSE_SECTION_DATA and ROSE_SECTION_HEADER types correspond to the Part 21 header and data sections. The ROSE_SECTION_SYSTEM type indicates a section that contains objects created and managed by the ROSE library. A system section is not written to a Part 21 file, but it is stored by a ROSE working form file.

The RoseCursor::section_type() function instructs the cursor to return objects from a particular type of design section. The ROSE_SECTION_ANY type is used to indicate that all types of section should be traversed.

See Also

RoseCursor::section_type(); RoseDesignSection::section_type()


9.4 RoseNodeType

The RoseNodeType enumeration is used internally by the ROSE library to indicate the general form of a data value. The RoseDomain or RoseType data dictionary information can be used for more specific type descriptions. These values are for internal use and should be avoided by applications. The values are as follows:

    enum RoseNodeType {
        ROSE_UNSPECIFIED_NODETYPE=0,
        ROSE_INTEGER,     /* int */
        ROSE_FLOAT,       /* float */
        ROSE_BOOLEAN,     /* RoseBoolean (typedef char) */
        ROSE_LOGICAL,     /* RoseLogical (typedef char) */
        ROSE_STRING,      /* RoseSTR  (typedef char *) */
        ROSE_OID,         /* RoseOID  (typedef unsigned long) */
        ROSE_DOUBLE,      /* double */
        ROSE_BINARY,      /* RoseBinarySTR (typedef char *) */
        ROSE_ENUM,        /* For enumerated types */
      
        ROSE_LAST_PRIM,   /* Boundary between prims & objs */
        ROSE_STRUCT,      /* RoseStructure Object */
        ROSE_UNION,       /* RoseUnion Object */
        ROSE_AGGREGATE,   /* RoseAggregate Object */
        ROSE_DESIGN,      /* RoseDesign Object */
        ROSE_UNDEFINED    /* RoseObject - Unknown Type */
    };

See Also

RoseAttribute::slotNodeType(); RoseDomain::typeNodeType(); RoseType::nodeType()


9.5 RoseSeverity

The RoseSeverity enumeration is used by the RoseErrorContext and RoseErrorReporter classes to indicate the seriousness of error messages. The values are as follows:

    enum RoseSeverity {
            ROSE_SEV_NULL      = 0, /* unset value */
            ROSE_SEV_MESSAGE   = 1, /* Application status messages */
            ROSE_SEV_WARNING   = 2, /* problem, may still complete fn */
            ROSE_SEV_ERROR     = 3, /* problem, unable to complete fn */
            ROSE_SEV_FATAL     = 4  /* unrecoverable error */
    };

See Also

RoseErrorContext::<action>_threshold(); RoseErrorReporter::<action>_threshold()


9.6 ROSE_CAST()

<type> * ROSE_CAST (type,object)

The ROSE_CAST() macro is an extension to C++ pointer type casting that allows casting from sub to supertype and from super to subtype, even on classes with virtual base classes. It uses the ROSE C++ type information to provide run-time type checking as well. The macro works by concatenating tokens so it is important not put spaces around the type name.

Example

In the example below, the ROSE_CAST() macro is used to convert the result of a search to a Point reference.

    Point * p;
    RoseObject * obj;
     
    obj = ROSE.findObject("some_point");  /* search for an object */
    p = ROSE_CAST(Point,obj);             /* cast RoseObject* to Point* */

See Also

Pointer Type Casting


9.7 ROSE_COUNT()

unsigned ROSE_COUNT (array)

The ROSE_COUNT() function returns the number of elements in a static array of elements. This is useful when specifying a size to the RoseErrorContext constructor. See RoseErrorContext Constructor for an example.


9.8 ROSE_DOMAIN()

RoseDomain * ROSE_DOMAIN (type)

The ROSE_DOMAIN() function returns the EXPRESS data dictionary information for a C++ class or primitive type understood by ROSE. Classes must be linked into an application for this macro to work. The macro works by concatenating tokens so it is important not put spaces around the type name.

Example

    RoseDomain * point_domain = ROSE_DOMAIN(Point);
    RoseDomain * string_domain = ROSE_DOMAIN(STR);

See Also

ROSE Compiled Schemas; EXPRESS Data Dictionary


9.9 ROSE_LOAD()

void ROSE_LOAD (type)

The ROSE_LOAD() macro circumvents problems with some optimizing linkers. If an application does not explicitly use or reference a particular class, some linkers will not bring in the class definition from a library. This macro will force the linker to bring in the specified class. The macro works by concatenating tokens so it is important not put spaces around the type name

This is useful if an application expects ROSE I/O to create objects as certain classes, but otherwise never references those classes. Such a case might occur when the application only references a base class and calls virtual functions to do all its work.

Example

The following will force the C++ classes Point and Line to be linked in. It is not necessary to bring in the header files for the classes.

    ROSE_LOAD(Point);
    ROSE_LOAD(Line);

See Also

Force-Linking Classes


9.10 ROSE_TYPE()

RoseTypePtr& ROSE_TYPE (type)

The ROSE_TYPE() function returns the C++ type information for a C++ class or primitive type understood by ROSE. The classes must be linked into an application for this macro to work. The macro works by concatenating tokens so it is important not put spaces around the type name

Example

    RoseTypePtr& thePointRoseType = ROSE_TYPE(Point);
    RoseTypePtr& theFloatRoseType = ROSE_TYPE(float);

See Also

C++ Type Information

 

| Book Contents | Book Index | Master Index | ST-Developer Home | Previous Chapter | Next Chapter |