Search STEP Tools Web Support

Overview

An aggregate property of an ARM object requires more functions than than a single value property because each aggregate element may represent a collection of AIM objects. The classes and functions for an aggregate property are described below. In the generated code, <property> is replaced with the name of the ARM property.

Element, Collection, and Cursor Classes

For each aggregate property, four classes are generated: a collection class, two element classes, and a cursor class. These are nested within the ARM interface and implementation classes for namespace issues. The classes are named after the property with the first letter uppercase and rest lowercase.

The examples below show what would be generated for a "Workplan" ARM object with an aggregate property called "its_elements"

add_<property>()

<Property>_IF * add_<property>(
	<stp_aim_class> * val, 
	double idx=ROSE_NULL_REAL
	);

The add method takes an AIM instance for the aggregate contents, adds it to the collection, with a given index if appropriate, and returns a pointer to the new element wrapper.

find_<property>()

<Property>_IF * find_<property>(
	double idx
	);

The find method takes a double and searches the collection for an element with the matching ARM index value. This is different than the integer position index, and is only present if a mapping explicitly declares such a value.

get_<property>()

<Property>_IF * get_<property>(
	unsigned idx
	);

The get method takes an integer index and returns the element of the collection at that position.

remove_<property>()

RoseBoolean remove_<property>(
	ARMCollectionElement * element
	);

The remove method takes an element wrapper and removes it from the collection. The function returns true if the value was successfully removed.

size_<property>()

unsigned size_<property>();

The size method returns the number of elements in the collection.

unset_<property>()

void unset_<property>();

The unset method removes all elements from the collection by unlinking the AIM elements for the collection. This is done by nulling out the first available attribute in the mapping path for elements of the collection.

Functions on the Element Class

The element class wraps a single element of an aggregate. Two classes are generated. The element interface class inherits from ARMCollectionElement and is named with the "_IF" suffix on the ARM interface class. The element implementation class inherits from the element interface class, and named after the propery on the ARM implementation class.

design()

RoseDesign * design();
The design() function is inherited from ARMCollectionElement and returns the RoseDesign of the owner AIM data.

display()

void display();

The display() function is inherited from ARMCollectionElement and prints IDs for the mapping AIM data to stdout.

getARMOwner()

STModule * getARMOwner();
The getARMOwner() function is inherited from ARMCollectionElement and returns the ARM object with the collection that the element belongs to.

getComment()

RoseStringObject getComment();

getElement()

ARMCollectionElement * getElement(unsigned i);

getIndex() / getIndexString()

double getIndex();
RoseStringObject getIndexString();

getPath()

ListOfRoseObject * getPath(
	ListOfRoseObject * path
	);

getValue() / getValueObject()

<stp_aim_class> * getValue();
RoseObject * getValueObject();

isset()

RoseBoolean isset();

Functions on the Collection Class

findValue()

ARMCollectionElement * findValue(double idx);

get()

ARMCollectionElement * get(unsigned idx);

getComment()

RoseStringObject getComment();

getNextIndex()

double getNextIndex();

remove()

RoseBoolean remove(ARMCollectionElement * el);
RoseBoolean remove(unsigned idx);

removeAll()

void removeAll();

size()

unsigned size();

sort()

void sort();

Cursor Functions

Constructor

<Property>_IFCursor(<ARM_class>_IF * mod);

get() / getElement()

<Property>_IF * get(unsigned idx);
ARMCollectionElement * getElement(unsigned index);

remove() / removeElement()

RoseBoolean remove();
RoseBoolean removeElement(ARMCollectionElement * el);

current() / getCurrent()

<Property>_IF* current();
ARMCollectionElement * getCurrent();

next() / getNext()

<Property>_IF* next();
ARMCollectionElement * getNext();

rewind()

void rewind()

size()

unsigned size();