// CosCompoundExternalization Module, p 8-20 CORBAservices,
// Externalization Service V1.0, 3/94

#ifndef __CosCompoundExternalization_IDL
#define __CosCompoundExternalization_IDL

#pragma prefix "omg.org"

#include <CosGraphs.idl>
#include <CosLifeCycle.idl>

//
//#include <CosStream.idl>
//
// including CosStream would lead to a cycle of inlcudes,
// thus we have to define the necessary names as empty interfaces
// here

module CosStream
{
  interface Node{};
  interface Streamable{};
  interface StreamIO{};
};

module CosCompoundExternalization 
{
        interface Node;
        interface Role;
        interface Relationship;
        interface PropagationCriteriaFactory;
        
        struct RelationshipHandle {
                        Relationship theRelationship;
                        CosObjectIdentity::ObjectIdentifier constantRandomId;
        };

        interface Node : CosGraphs::Node, CosStream::Streamable
	  {
                        void externalize_node (in CosStream::StreamIO sio);
                        void internalize_node (in CosStream::StreamIO sio,
                                                in CosLifeCycle::FactoryFinder there,
                                                out CosGraphs::Node::Roles rolesOfNode)
                                raises (CosLifeCycle::NoFactory);
        };

        interface Role : CosGraphs::Role {
                        void externalize_role (in CosStream::StreamIO sio); 
                        void internalize_role (in CosStream::StreamIO sio); 
                        CosGraphs::PropagationValue externalize_propagation (
                                                in RelationshipHandle rel,
                                                in CosRelationships::RoleName toRoleName,
                                                out boolean sameForAll);
                };

        interface Relationship : 
                                CosRelationships::Relationship {
                  void externalize_relationship (
			in CosStream::StreamIO sio);
			void internalize_relationship(
				in CosStream::StreamIO sio,
				in CosGraphs::NamedRoles newRoles);
                        CosGraphs::PropagationValue externalize_propagation (
				in CosRelationships::RoleName fromRoleName,
				in CosRelationships::RoleName toRoleName,
				out boolean sameForAll);
        };

        interface PropagationCriteriaFactory {
                        CosGraphs::TraversalCriteria create_for_externalize( );
        };

};

#endif
