//File: CosTimerEvent.idl
//Part of the Time Service
//OMG File: 98-10-46

#ifndef _COS_TIMER_EVENT_IDL_
#define _COS_TIMER_EVENT_IDL_

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

module CosTimerEvent {

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

	enum TimeType {
		TTAbsolute,
		TTRelative,
		TTPeriodic
	};

	enum EventStatus {
		ESTimeSet,				
		ESTimeCleared,
		ESTriggered,				
		ESFailedTrigger
	};

	struct TimerEventT {
		TimeBase::UtcT			utc;
		any						event_data;
	};

 	interface TimerEventHandler {
		readonly attribute EventStatus status;
		boolean time_set(
			out CosTime::UTO	uto);	
		void SetTimer(
			in TimeType			time_type,
			in CosTime::UTO 	trigger_time);
	    boolean cancel_timer();
	    void set_data(
			in any				event_data);
	};

	interface TimerEventService {
		TimerEventHandler register(
			in CosEventComm::PushConsumer 	event_interface,
			in any 							data);
		void unregister(
			in TimerEventHandler 	timer_event_handler);
		CosTime::UTO event_time(
			in TimerEventT		timer_event);
	};	
};
#endif /* ifndef _COS_TIMER_EVENT_IDL_ */
