Search STEP Tools Web Support

Overview

Most features of the ARM libraries are provided through C++ member functions on the ARM classes. However, there are a few services that are provides as ordinary functions or macros. All have the prefix "ARM" and are described in the following sections.

ARM_CAST()

<type> * ARM_CAST (type,object)

The ARM_CAST() macro is used to cast ARM object pointers from supertype down to subtype. A plain C++ cast can only convert a pointer from subtype to supertype, so this macro is necessary when you have a pointer of general type but know that the underlying object is of a more specific type.

The ARM_CAST() macro does run-time type checking, and will return null if you attempt to cast to a type that does not match the underlying ARM object.

You can safely pass a null pointer to the ARM_CAST() macro, and it will return a null pointer. The macro works by concatenating tokens so it is important not put spaces around the type name. The ROSE_CAST() macro performs the same service for the STEP AIM instances.

Example

In the example below, the ARM_CAST() macro is used to convert a pointer to a Base ARM type to a more specific Subtype.

Base_IF * b;
Subtype_IF * s;

s = ARM_CAST(Subtype_IF,b);

ARM_LOAD()

void ARM_LOAD (type)

The ARM_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

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.

ARM_LOAD(Point);
ARM_LOAD(Line);

ARMgc()

void ARMgc(
	RoseDesign * d
	);

The ARMgc() function performs garbage collection on a RoseDesign. This function will analyze the STEP AIM instances and corresponding ARM objects in the design and move unreferenced or unused instances to the trash.

STModule::strict_find

RoseBoolean STModule::strict_find

The STModule::strict_find variable is a global flag that controls how AIM data is matched against the mapping table rules. When the mapping tables are encoded into the ARM library, certain requirements, such as AIM types or string constants in fields, may be marked as just "suggested" in order to allow them to match data that does not follow the mappings exactly.

When the strict_find variable is set to true, the matching code treats all of the rules as requirements, so that it will only match data that follows the mappings exactly.

When the strict_find variable is set to false, the matching code will make two passes. The first pass looks for data that follows the mappings exactly, and the second pass looks for data that follows everything except the "suggested" mappings.

Example

STModule::strict_find = 1;   // match all mappings
STModule::strict_find = 0;   // ignore suggested mappings