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-Graphs ()
  check("", test-idl-file, *corba-services-files*, "Graphs");
end test;

add-idl-file!(
  *corba-services-files*,
  "Graphs",
"// CosGraphs Module, p 9-39 CORBAservices, Relationship Service\n"
"// V1.0, 3/94\n"
"\n"
"#ifndef COSGRAPHS\n"
"#define COSGRAPHS\n"
"#include <Relationships.idl>\n"
"#include <ObjectIdentity.idl>\n"
"\n"
"module CosGraphs {\n"
"\n"
"\t\tinterface TraversalFactory; \n"
"\t\tinterface Traversal;\n"
"\t\tinterface TraversalCriteria;\n"
"\t\tinterface Node;\n"
"\t\tinterface NodeFactory;\n"
"\t\tinterface Role; \n"
"\t\tinterface EdgeIterator; \n"
"\n"
"\t\tstruct NodeHandle {\n"
"\t\t\tNode the_node;\n"
"\t\t\tCosObjectIdentity::ObjectIdentifier constant_random_id;\n"
"\t\t};\n"
"\t\ttypedef sequence<NodeHandle> NodeHandles;\n"
"\n"
"\t\tstruct NamedRole {\n"
"\t\t\tRole the_role;\n"
"\t\t\tCosRelationships::RoleName the_name;\n"
"\t\t};\n"
"\t\ttypedef sequence<NamedRole> NamedRoles;\n"
"\n"
"\t\tstruct EndPoint {\n"
"\t\t\tNodeHandle the_node;\n"
"\t\t\tNamedRole the_role;\n"
"\t\t};\n"
"\t\ttypedef sequence<EndPoint> EndPoints;\n"
"\n"
"\t\tstruct Edge {\n"
"\t\t\tEndPoint from;\n"
"\t\t\tCosRelationships::RelationshipHandle the_relationship;\n"
"\t\t\tEndPoints relatives;\n"
"\t\t};\n"
"\t\ttypedef sequence<Edge> Edges;\n"
"\n"
"\t\tenum PropagationValue {deep, shallow, none, inhibit};\n"
"\t\tenum Mode {depthFirst, breadthFirst, bestFirst};\n"
"\n"
"\t\tinterface TraversalFactory {\n"
"\t\t\tTraversal create_traversal_on (\n"
"\t\t\t\t\tin NodeHandle root_node,\n"
"\t\t\t\t\tin TraversalCriteria the_criteria,\n"
"\t\t\t\t\tin Mode how);\n"
"\t\t};\n"
"\n"
"\t\tinterface Traversal {\n"
"\t\t\ttypedef unsigned long TraversalScopedId;\n"
"\t\t\tstruct ScopedEndPoint {\n"
"\t\t\t\tEndPoint point;\n"
"\t\t\t\tTraversalScopedId id;\n"
"\t\t\t};\n"
"\t\t\ttypedef sequence<ScopedEndPoint> ScopedEndPoints;\n"
"\t\t\tstruct ScopedRelationship {\n"
"\t\t\t\tCosRelationships::RelationshipHandle\n"
"\t\t\t\t\tscoped_relationship;\n"
"\t\t\t\tTraversalScopedId id;\n"
"\t\t\t};\n"
"\t\t\tstruct ScopedEdge {\n"
"\t\t\t\tScopedEndPoint from;\n"
"\t\t\t\tScopedRelationship the_relationship;\n"
"\t\t\t\tScopedEndPoints relatives;\n"
"\t\t\t};\n"
"\t\t\ttypedef sequence<ScopedEdge> ScopedEdges;\n"
"\t\t\tboolean next_one (out ScopedEdge the_edge);\n"
"\t\t\tboolean next_n (in short how_many,\n"
"\t\t\t\t\tout ScopedEdges the_edges);\n"
"\t\t\tvoid destroy ();\n"
"\t\t};\n"
"\n"
"\t\tinterface TraversalCriteria {\n"
"\t\t\tstruct WeightedEdge {\n"
"\t\t\t\tEdge the_edge;\n"
"\t\t\t\tunsigned long weight;\n"
"\t\t\t\tsequence<NodeHandle> next_nodes;\n"
"\t\t\t};\n"
"\t\t\ttypedef sequence<WeightedEdge> WeightedEdges;\n"
"\t\t\tvoid visit_node(in NodeHandle a_node,\n"
"\t\t\t\t\tin Mode search_mode);\n"
"\t\t\tboolean next_one (out WeightedEdge the_edge);\n"
"\t\t\tboolean next_n (in short how_many, \n"
"\t\t\t\t\tout WeightedEdges the_edges);\n"
"\t\t\tvoid destroy();\n"
"\t\t};\n"
"\n"
"\t\tinterface Node: CosObjectIdentity::IdentifiableObject {\n"
"\t\t\ttypedef sequence<Role> Roles;\n"
"\t\t\texception NoSuchRole {};\n"
"\t\t\texception DuplicateRoleType {};\n"
"\n"
"\t\t\treadonly attribute CosRelationships::RelatedObject\n"
"\t\t\t\t related_object;\n"
"\t\t\treadonly attribute Roles roles_of_node;\n"
"\t\t\tRoles roles_of_type ( \n"
"\t\t\t\t\tin CORBA::InterfaceDef role_type);\n"
"\t\t\tvoid add_role (in Role a_role)\n"
"\t\t\t\t\traises (DuplicateRoleType);\n"
"\t\t\tvoid remove_role (in CORBA::InterfaceDef of_type)\n"
"\t\t\t\traises (NoSuchRole);\n"
"\t\t};\n"
"\n"
"\t\tinterface NodeFactory {\n"
"\t\t\tNode create_node (in Object related_object);\n"
"\t\t};\n"
"\n"
"\t\tinterface Role : CosRelationships::Role {\n"
"\t\t\tvoid get_edges ( in long how_many,\n"
"\t\t\t\t\tout Edges the_edges,\n"
"\t\t\t\t\tout EdgeIterator the_rest);\n"
"\t\t};\n"
"\n"
"\t\tinterface EdgeIterator {\n"
"\t\t\tboolean next_one (out Edge the_edge);\n"
"\t\t\tboolean next_n ( in unsigned long how_many,\n"
"\t\t\t\t\tout Edges the_edges);\n"
"\t\t\tvoid destroy ();\n"
"\t\t};\n"
"\n"
"};\n"
"#endif\n"
"\n");
