Module: scepter-tests
Author: Jason Trenouth
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

define test corba-services-idl-Relationships ()
  check("", test-idl-file, *corba-services-files*, "Relationships");
end test;

add-idl-file!(
  *corba-services-files*,
  "Relationships",
"// CosRelationships Module, p 9-21 CORBAservices, Relationship\n"
"// Service V1.0, 3/94\n"
"\n"
"#ifndef COSRELATIONSHIPS\n"
"#define COSRELATIONSHIPS\n"
"#include <ObjectIdentity.idl>\n"
"#include \"CORBA.idl\"\n"
"\n"
"module CosRelationships {\n"
"\n"
"\tinterface RoleFactory; \n"
"\tinterface RelationshipFactory; \n"
"\tinterface Relationship; \n"
"\tinterface Role;\n"
"\tinterface RelationshipIterator;\n"
"\n"
"\ttypedef Object RelatedObject;\n"
"\ttypedef sequence<Role> Roles;\n"
"\ttypedef string RoleName;\n"
"\ttypedef sequence<RoleName> RoleNames;\n"
"\n"
"\tstruct NamedRole {RoleName name; Role aRole;};\n"
"\ttypedef sequence<NamedRole> NamedRoles;\n"
"\n"
"\tstruct RelationshipHandle {\n"
"\t\t\tRelationship the_relationship;\n"
"\t\t\tCosObjectIdentity::ObjectIdentifier constant_random_id;\n"
"\t};\n"
"\ttypedef sequence<RelationshipHandle> RelationshipHandles;\n"
"\n"
"\tinterface RelationshipFactory {\n"
"\t\t\tstruct NamedRoleType {\n"
"\t\t\t\tRoleName name;\n"
"\t\t\t\t\tCORBA::InterfaceDef named_role_type;\n"
"\t\t\t};\n"
"\t\t\ttypedef sequence<NamedRoleType> NamedRoleTypes;\n"
"\t\t\treadonly attribute CORBA::InterfaceDef relationship_type;\n"
"\t\t\treadonly attribute unsigned short degree;\n"
"\t\t\treadonly attribute NamedRoleTypes named_role_types;\n"
"\t\t\texception RoleTypeError {NamedRoles culprits;};\n"
"\t\t\texception MaxCardinalityExceeded {\n"
"\t\t\t\tNamedRoles culprits;};\n"
"\t\t\texception DegreeError {unsigned short required_degree;};\n"
"\t\t\texception DuplicateRoleName {NamedRoles culprits;};\n"
"\t\t\texception UnknownRoleName {NamedRoles culprits;};\n"
"\n"
"\t\t\tRelationship create (in NamedRoles named_roles)\n"
"\t\t\t\t\traises (RoleTypeError,\n"
"\t\t\t\t\t\tMaxCardinalityExceeded,\n"
"\t\t\t\t\t\tDegreeError,\n"
"\t\t\t\t\t\tDuplicateRoleName,\n"
"\t\t\t\t\t\tUnknownRoleName);\n"
"\t};\n"
"\n"
"\tinterface Relationship : \n"
"\t\t\t\tCosObjectIdentity::IdentifiableObject {\n"
"\t\t\texception CannotUnlink {\n"
"\t\t\t\tRoles offending_roles;\n"
"\t\t\t};\n"
"\t\t\treadonly attribute NamedRoles named_roles;\n"
"\t\t\tvoid destroy () raises(CannotUnlink);\n"
"\t};\n"
"\n"
"\tinterface Role {\n"
"\t\t\texception UnknownRoleName {};\n"
"\t\t\texception UnknownRelationship {};\n"
"\t\t\texception RelationshipTypeError {};\n"
"\t\t\texception CannotDestroyRelationship {\n"
"\t\t\t\tRelationshipHandles offenders;\n"
"\t\t\t};\n"
"\t\t\texception ParticipatingInRelationship {\n"
"\t\t\t\tRelationshipHandles the_relationships;\n"
"\t\t\t};\n"
"\t\t\treadonly attribute RelatedObject related_object;\n"
"\t\t\tRelatedObject get_other_related_object (\n"
"\t\t\t\t\t\tin RelationshipHandle rel,\n"
"\t\t\t\t\t\tin RoleName target_name)\n"
"\t\t\t\traises (UnknownRoleName,\n"
"\t\t\t\t\t\tUnknownRelationship);\n"
"\t\t\tRole get_other_role (in RelationshipHandle rel, \n"
"\t\t\t\t\t\tin RoleName target_name)\n"
"\t\t\t\traises (UnknownRoleName, UnknownRelationship);\n"
"\t\t\tvoid get_relationships (\n"
"\t\t\t\t\t\tin unsigned long how_many,\n"
"\t\t\t\t\t\tout RelationshipHandles rels,\n"
"\t\t\t\t\t\tout RelationshipIterator iterator);\n"
"\t\t\tvoid destroy_relationships()\n"
"\t\t\t\traises(CannotDestroyRelationship);\n"
"\t\t\tvoid destroy() raises(ParticipatingInRelationship);\n"
"\t\t\tboolean check_minimum_cardinality ();\n"
"\t\t\tvoid link (in RelationshipHandle rel,\n"
"\t\t\t\t\t\tin NamedRoles named_roles)\n"
"\t\t\t\t\traises(RelationshipFactory::MaxCardinalityExceeded,\n"
"\t\t\t\t\t\tRelationshipTypeError);\n"
"\t\t\tvoid unlink (in RelationshipHandle rel)\n"
"\t\t\t\traises (UnknownRelationship);\n"
"\t};\n"
"\n"
"\tinterface RoleFactory {\n"
"\t\t\texception NilRelatedObject {};\n"
"\t\t\texception RelatedObjectTypeError {};\n"
"\t\t\treadonly attribute CORBA::InterfaceDef role_type;\n"
"\t\t\treadonly attribute unsigned long max_cardinality;\n"
"\t\t\treadonly attribute unsigned long min_cardinality;\n"
"\t\t\treadonly attribute sequence\n"
"\t\t\t\t<CORBA::InterfaceDef> related_object_types;\n"
"\t\t\tRole create_role (in RelatedObject related_object)\n"
"\t\t\t\traises (NilRelatedObject, RelatedObjectTypeError);\n"
"\t};\n"
"\n"
"\tinterface RelationshipIterator {\n"
"\t\t\tboolean next_one (out RelationshipHandle rel);\n"
"\t\t\tboolean next_n (in unsigned long how_many,\n"
"\t\t\t\t\t\tout RelationshipHandles rels);\n"
"\t\t\tvoid destroy ();\n"
"\t};\n"
"\n"
"};\n"
"#endif\n"
"\n");
