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

Overview

Many features of the Working Set library are provided through C++ class member functions. However, some services are provided through ordinary functions. These functions are documented in the following sections.

p21_get_file_info()

RoseErrorCode p21_get_file_info(
	P21FileInfo* file_info
	);

The function retrieves the file statistics. The file_info argument is a pointer to a P21FileInfo structure and is used for both input and output. You have to fill the name member of this structure with the name of a STEP Part 21 file. The function will fill the rest of the structure with statistical information, such as the number of entities in the file, the number of complex entities, the number of simple entities, and the number of types.

The function returns ROSE_OK if the file can be opened, ROSE_GENERAL otherwise.

p21_get_id_list()

RoseErrorCode p21_get_id_list(
	char* file_name,
	SetOfString* types,
	SetOfString* ids,
	RoseBoolean isa_mode = ROSE_FALSE
	);

The p21_get_id_list() function obtains the list of instances (entity IDs) for the list of given types. The types arguments is a pointer to the list of types for which you want to obtain the instances. The ids argument is a pointer to the list that receives the list of instances. The isa_mode flag specifies the function behavior -- if it is set to ROSE_TRUE then the function will consider all complex types that have an IS-A relationship to the types given in the types argument. If this flag is set to ROSE_FALSE (default) the function will only consider exact types.

The function returns ROSE_OK if the file can be opened, ROSE_GENERAL otherwise. If no instances of the given types are found, no elements are added to the ids list.

p21_get_type_from_id()

RoseLogical p21_get_type_from_id(
	char* file_name,
	char* entity_id,
	char* type
	);
	 
RoseLogical p21_get_type_from_id(
	char* file_name,
	unsigned long entity_id,
	char* type
	);

These functions get the type(s) of the specified entity. The entity ID is given in the entity_id argument in the form of a "#<number>" string for the first implementation of this function or in the numeric form for the second implementation. The entity type is returned in the type argument that should point to a string long enough to accommodate the type name.

The function returns ROSE_FALSE if the file can not be opened, ROSE_TRUE if the given ID is for a single type, ROSE_UNKNOWN if the given ID is for a set of types (complex entity). In the last case the list of types will be in the type argument, separated by spaces.

p21_get_references()

RoseErrorCode p21_get_references(
	char* file_name,
	char* entity_id,
	SetOfint* refs
	);
RoseErrorCode p21_get_references(
	char* file_name,
	unsigned long entity_id,
	SetOfint* refs
	);

This function retrieves the list of references for the given entity (the list of entity instances this entity refers to). The entity ID is given in the entity_id argument in the form of a "#<number>" string for the first implementation of this function or in the numeric form for the second implementation. The references are returned as a list of integers pointed to by the refs argument.

The p21_get_references function returns ROSE_OK if the file can be opened, ROSE_GENERAL otherwise. If the given entity does not contain any references, no elements are added to the refs list.

 

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