//File: CosExternalization.idl
//Part of the Externalization Service
//OMG File: 98-10-09

#ifndef _COS_EXTERNALIZATION_IDL_
#define _COS_EXTERNALIZATION_IDL_

#ifdef _PRE_3_0_COMPILER_
#include <CosLifeCycle.idl>
#include <CosStream.idl>
#pragma prefix "omg.org"
#else
import ::CosLifeCycle;
import ::CosStream;
#endif // _PRE_3_0_COMPILER_

module CosExternalization {

#ifndef _PRE_3_0_COMPILER_
	typeprefix CosExternalization "omg.org";
#endif // _PRE_3_0_COMPILER_

	exception InvalidFileNameError{};
	exception ContextAlreadyRegistered{};
	interface Stream: CosLifeCycle::LifeCycleObject{
		void externalize(
			in CosStream::Streamable theObject);
		CosStream::Streamable internalize( 
			in CosLifeCycle::FactoryFinder there)
			raises( CosLifeCycle::NoFactory,
					CosStream::StreamDataFormatError );
		void begin_context()
			raises( ContextAlreadyRegistered);
		void end_context(); 
		void flush();
	};
	interface StreamFactory {
		Stream create();
	};
	interface FileStreamFactory {
		Stream create(
			in string theFileName) 
			raises( InvalidFileNameError );
	};
};
#endif /* ifndef _COS_EXTERNALIZATION_IDL_ */
