//======================================================== // iBase PACKAGE -- // ITAPS UTITLIES COMMON ACROSS INTERFACES // ERRORS, TAGS //======================================================== package iBase version 0.7 { //==================================================== // ERROR FUNCTIONALITY //==================================================== enum ErrorActions { SILENT, // does nothing, not recommended WARN_ONLY, // prints something, but nothing else THROW_ERROR // throws an exception }; enum ErrorType { SUCCESS, DATA_ALREADY_LOADED, NO_DATA, FILE_NOT_FOUND, FILE_ACCESS_ERROR, NIL_ARRAY, // array was supposed to be initialized and have data BAD_ARRAY_SIZE, BAD_ARRAY_DIMENSION, // all itaps arrays should be 1D INVALID_ENTITY_HANDLE, INVALID_ENTITY_COUNT, INVALID_ENTITY_TYPE, INVALID_ENTITY_TOPOLOGY, BAD_TYPE_AND_TOPO, ENTITY_CREATION_ERROR, INVALID_TAG_HANDLE, TAG_NOT_FOUND, TAG_ALREADY_EXISTS, TAG_IN_USE, INVALID_ENTITYSET_HANDLE, INVALID_ITERATOR_HANDLE, INVALID_ARGUMENT, ARGUMENT_OUT_OF_RANGE, MEMORY_ALLOCATION_FAILED, NOT_SUPPORTED, FAILURE }; class Error extends sidl.SIDLException { void set(in ErrorType error, in string description); ErrorType getErrorType(); void get(out ErrorType err, out string description); string getDescription(); void echo(in string label); // prints label and then description string to stderr }; //==================================================== // TAGS //==================================================== enum TagValueType { INTEGER, DOUBLE, ENTITY_HANDLE, BYTES }; //==================================================== // BASIC TAG FUNCTIONALITY //==================================================== // be careful about size arguments // createTag takes number of values of type tag type interface Tag { void createTag(in string tag_name, in int number_of_values, in TagValueType tag_type, out opaque tag_handle) throws Error; void destroyTag(in opaque tag_handle, in bool forced) throws Error; string getTagName(in opaque tag_handle) throws Error; int getTagSizeValues(in opaque tag_handle) throws Error; // number of values int getTagSizeBytes(in opaque tag_handle) throws Error; // total number of bytes opaque getTagHandle(in string tag_name) throws Error; TagValueType getTagType(in opaque tag_handle) throws Error; }; //==================================================== // ENTITY TAGS //==================================================== interface EntTag extends Tag { void getData( in opaque entity_handle, in opaque tag_handle, inout array tag_value, out int tag_value_size) throws Error; // in bytes - number of things in the array int getIntData( in opaque entity_handle, in opaque tag_handle) throws Error; double getDblData( in opaque entity_handle, in opaque tag_handle) throws Error; opaque getEHData( in opaque entity_handle, in opaque tag_handle) throws Error; void setData( in opaque entity_handle, in opaque tag_handle, in array tag_value, in int tag_value_size) throws Error; void setIntData( in opaque entity_handle, in opaque tag_handle, in int tag_value) throws Error; void setDblData( in opaque entity_handle, in opaque tag_handle, in double tag_value) throws Error; void setEHData( in opaque entity_handle, in opaque tag_handle, in opaque tag_value) throws Error; void getAllTags( in opaque entity_handle, inout array tag_handles, out int tag_handles_size) throws Error; void rmvTag( in opaque entity_handle, in opaque tag_handle) throws Error; }; //==================================================== // ENTITY ARRAY TAGS //==================================================== // the value_array_size is the total number of characters // value_array_size = number of entity_handles*size of each tag's value in bytes // = entity_handles_size * tag value size // in units of elements in the array - value_array_size // on array tags - if you request an int tag on 100 entities and not all of them // have the tag - the behavior is: throw an error; array contents are undefined // error is TAG_NOT_FOUND // on removing tags on array of entities - if the entity doesn't have the tag // just skip over it - do not throw an error and delete tags on the rest of the ents interface ArrTag extends Tag { void getArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, inout array value_array, out int value_array_size) throws iBase.Error; void getIntArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, inout array value_array, out int value_array_size) throws iBase.Error; void getDblArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, inout array value_array, out int value_array_size) throws iBase.Error; void getEHArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, inout array value_array, out int value_array_size) throws iBase.Error; void setArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, in array value_array, in int value_array_size) throws iBase.Error; void setIntArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, in array value_array, in int value_array_size) throws iBase.Error; void setDblArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, in array value_array, in int value_array_size) throws iBase.Error; void setEHArrData( in array entity_handles, in int entity_handles_size, in opaque tag_handle, in array value_array, in int value_array_size) throws iBase.Error; void rmvArrTag( in array entity_handles, in int entity_handles_size, in opaque tag_handle) throws iBase.Error; }; //=================================================== // ENTITY SET TAGS //=================================================== interface SetTag extends Tag { //tags void setEntSetData( in opaque entity_set, in opaque tag_handle, inout array tag_value, in int tag_value_size) throws iBase.Error; void setEntSetIntData( in opaque entity_set, in opaque tag_handle, in int tag_value) throws iBase.Error; void setEntSetDblData( in opaque entity_set, in opaque tag_handle, in double tag_value) throws iBase.Error; void setEntSetEHData( in opaque entity_set, in opaque tag_handle, in opaque tag_value) throws iBase.Error; void getEntSetData( in opaque entity_set, in opaque tag_handle, inout array tag_value, out int tag_value_size) throws iBase.Error; int getEntSetIntData( in opaque entity_set, in opaque tag_handle) throws iBase.Error; double getEntSetDblData( in opaque entity_set, in opaque tag_handle) throws iBase.Error; opaque getEntSetEHData( in opaque entity_set, in opaque tag_handle) throws iBase.Error; void getAllEntSetTags( in opaque entity_set, inout array tag_handles, out int tag_handles_size) throws iBase.Error; void rmvEntSetTag( in opaque entity_set, in opaque tag_handle) throws iBase.Error; }; interface EntSet { // create/destroy void createEntSet( in bool isList, out opaque entity_set) throws iBase.Error; void destroyEntSet( in opaque entity_set) throws iBase.Error; // is this set ordered? bool isList(in opaque entity_set) throws iBase.Error; // get the entity sets // num_hops of >=0 is recurse down that many levels (=0 is that ESet only) // num_hops < 0 is recurse forever int getNumEntSets( in opaque entity_set, in int num_hops) throws iBase.Error; void getEntSets ( in opaque entity_set, in int num_hops, inout array contained_entset_handles, out int contained_entset_handles_size) throws iBase.Error; // add and remove entities void addEntToSet(in opaque entity_handle, inout opaque entity_set) throws iBase.Error; // if the entity isn't in the set, don't throw an error void rmvEntFromSet( in opaque entity_handle, inout opaque entity_set) throws iBase.Error; void addEntArrToSet( in array entity_handles, in int entity_handles_size, inout opaque entity_set) throws iBase.Error; // if the entity isn't in the set, don't throw an error void rmvEntArrFromSet( in array entity_handles, in int entity_handles_size, inout opaque entity_set) throws iBase.Error; // all entity sets are contained in root set // root set is contained in no other sets // root set cannot be removed - throw an error // can't remove anthing from root set - throw an error - use destroy // add/remove entity sets void addEntSet( in opaque entity_set_to_add, inout opaque entity_set_handle) throws iBase.Error; // if the entity set isn't in the set, don't throw an error void rmvEntSet( in opaque entity_set_to_remove, inout opaque entity_set_handle) throws iBase.Error; // check whether an entity is contained in the entity set bool isEntContained(in opaque containing_entity_set, in opaque entity_handle) throws iBase.Error; // check whether an entity set is contained in another bool isEntSetContained(in opaque containing_entity_set, in opaque contained_entity_set) throws iBase.Error; }; interface SetRelation extends EntSet { // Root set cannot be a child or parent // don't throw error if parent/child already exists void addPrntChld( inout opaque parent_entity_set, inout opaque child_entity_set) throws iBase.Error; // don't throw error if parent/child link doesn't exist void rmvPrntChld( inout opaque parent_entity_set, inout opaque child_entity_set) throws iBase.Error; bool isChildOf( in opaque parent_entity_set, in opaque child_entity_set) throws iBase.Error; int getNumChld( in opaque entity_set, in int num_hops) throws iBase.Error; int getNumPrnt( in opaque entity_set, in int num_hops) throws iBase.Error; void getChldn( in opaque from_entity_set, in int num_hops, inout array child_handles, out int child_handles_size) throws iBase.Error; void getPrnts( in opaque from_entity_set, in int num_hops, inout array parent_handles, out int parent_handles_size) throws iBase.Error; }; interface SetBoolOps extends EntSet { // Having root set as entity_set_1 gives the complement of entity_set_2 // behavior for contained sets // explicitly lay out what happens when there are multiple copies of something void subtract( in opaque entity_set_1, in opaque entity_set_2, out opaque result_entity_set) throws iBase.Error; void intersect( in opaque entity_set_1, in opaque entity_set_2, out opaque result_entity_set) throws iBase.Error; void unite( in opaque entity_set_1, in opaque entity_set_2, out opaque result_entity_set) throws iBase.Error; }; } // END iBase