/*
 * This file was generated by orbit-idl - DO NOT EDIT!
 */

#include <string.h>
#include "CosEventComm.h"
#define GET_ATOM(x) G_STMT_START{ GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->decoder(&x, (GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur), sizeof(x)); ((guchar *)GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur) += sizeof(x); }G_STMT_END

/***************** Begin module CosEventComm ***************/
static void 
CosEventComm_Disconnected_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
}

static void
skel_CosEventComm_PushConsumer_push(POA_CosEventComm_PushConsumer * _ORBIT_servant,
				    GIOPRecvBuffer * _ORBIT_recv_buffer,
				    CORBA_Environment * ev,
			 void (*_impl_push) (PortableServer_Servant servant,
					     const CORBA_any * data,
					     CORBA_Environment * ev))
{
   CORBA_any data =
   {NULL, NULL, CORBA_FALSE};
   GIOPSendBuffer *_ORBIT_send_buffer;
   static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] =
   {
      {(CORBA_TypeCode) & TC_CosEventComm_Disconnected_struct, (gpointer) CosEventComm_Disconnected_marshal},
      {CORBA_OBJECT_NIL, NULL}};

   if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {

      /* demarshal parameter data */
      ORBit_demarshal_any(_ORBIT_recv_buffer, &(data), CORBA_FALSE, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
   } else {

      /* demarshal parameter data */
      ORBit_demarshal_any(_ORBIT_recv_buffer, &(data), CORBA_FALSE, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
   }

   _impl_push(_ORBIT_servant, &(data),
	      ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
   CORBA_any__free(&data, NULL, CORBA_FALSE);
}

static void
skel_CosEventComm_PushConsumer_disconnect_push_consumer(POA_CosEventComm_PushConsumer * _ORBIT_servant,
					GIOPRecvBuffer * _ORBIT_recv_buffer,
						     CORBA_Environment * ev,
     void (*_impl_disconnect_push_consumer) (PortableServer_Servant servant,
					     CORBA_Environment * ev))
{
   GIOPSendBuffer *_ORBIT_send_buffer;

   _impl_disconnect_push_consumer(_ORBIT_servant, ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, NULL);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
}

static ORBitSkeleton 
get_skel_CosEventComm_PushConsumer(POA_CosEventComm_PushConsumer * servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'd':
	*impl = servant->vepv->CosEventComm_PushConsumer_epv->disconnect_push_consumer;
	return (gpointer) skel_CosEventComm_PushConsumer_disconnect_push_consumer;
	break;
     case 'p':
	*impl = servant->vepv->CosEventComm_PushConsumer_epv->push;
	return (gpointer) skel_CosEventComm_PushConsumer_push;
	break;
     default:
	return NULL;
   }
}

static void 
init_local_objref_CosEventComm_PushConsumer(CORBA_Object obj, POA_CosEventComm_PushConsumer * servant)
{
   obj->vepv[CosEventComm_PushConsumer__classid] = servant->vepv->CosEventComm_PushConsumer_epv;
}

void 
POA_CosEventComm_PushConsumer__init(POA_CosEventComm_PushConsumer * servant,
				    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
   {(gpointer) & get_skel_CosEventComm_PushConsumer, "IDL:omg.org/CosEventComm/PushConsumer:1.0", (gpointer) & init_local_objref_CosEventComm_PushConsumer};

   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(servant->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosEventComm_PushConsumer__classid)
      CosEventComm_PushConsumer__classid = ORBit_register_class(&class_info);
}

void 
POA_CosEventComm_PushConsumer__fini(POA_CosEventComm_PushConsumer * servant,
				    CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}

static void
skel_CosEventComm_PushSupplier_disconnect_push_supplier(POA_CosEventComm_PushSupplier * _ORBIT_servant,
					GIOPRecvBuffer * _ORBIT_recv_buffer,
						     CORBA_Environment * ev,
     void (*_impl_disconnect_push_supplier) (PortableServer_Servant servant,
					     CORBA_Environment * ev))
{
   GIOPSendBuffer *_ORBIT_send_buffer;

   _impl_disconnect_push_supplier(_ORBIT_servant, ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, NULL);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
}

static ORBitSkeleton 
get_skel_CosEventComm_PushSupplier(POA_CosEventComm_PushSupplier * servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'd':
	*impl = servant->vepv->CosEventComm_PushSupplier_epv->disconnect_push_supplier;
	return (gpointer) skel_CosEventComm_PushSupplier_disconnect_push_supplier;
	break;
     default:
	return NULL;
   }
}

static void 
init_local_objref_CosEventComm_PushSupplier(CORBA_Object obj, POA_CosEventComm_PushSupplier * servant)
{
   obj->vepv[CosEventComm_PushSupplier__classid] = servant->vepv->CosEventComm_PushSupplier_epv;
}

void 
POA_CosEventComm_PushSupplier__init(POA_CosEventComm_PushSupplier * servant,
				    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
   {(gpointer) & get_skel_CosEventComm_PushSupplier, "IDL:omg.org/CosEventComm/PushSupplier:1.0", (gpointer) & init_local_objref_CosEventComm_PushSupplier};

   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(servant->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosEventComm_PushSupplier__classid)
      CosEventComm_PushSupplier__classid = ORBit_register_class(&class_info);
}

void 
POA_CosEventComm_PushSupplier__fini(POA_CosEventComm_PushSupplier * servant,
				    CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}

static void
skel_CosEventComm_PullSupplier_pull(POA_CosEventComm_PullSupplier * _ORBIT_servant,
				    GIOPRecvBuffer * _ORBIT_recv_buffer,
				    CORBA_Environment * ev,
		  CORBA_any * (*_impl_pull) (PortableServer_Servant servant,
					     CORBA_Environment * ev))
{
   CORBA_any *_ORBIT_retval;
   GIOPSendBuffer *_ORBIT_send_buffer;
   static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] =
   {
      {(CORBA_TypeCode) & TC_CosEventComm_Disconnected_struct, (gpointer) CosEventComm_Disconnected_marshal},
      {CORBA_OBJECT_NIL, NULL}};

   _ORBIT_retval = _impl_pull(_ORBIT_servant, ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
      /* marshal return value */
      ORBit_marshal_any(_ORBIT_send_buffer, &(*_ORBIT_retval));
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
   if (ev->_major == CORBA_NO_EXCEPTION)
      CORBA_free(_ORBIT_retval);
}

static void
skel_CosEventComm_PullSupplier_try_pull(POA_CosEventComm_PullSupplier * _ORBIT_servant,
					GIOPRecvBuffer * _ORBIT_recv_buffer,
					CORBA_Environment * ev,
	      CORBA_any * (*_impl_try_pull) (PortableServer_Servant servant,
					     CORBA_boolean * has_event,
					     CORBA_Environment * ev))
{
   CORBA_boolean has_event;
   CORBA_any *_ORBIT_retval;
   GIOPSendBuffer *_ORBIT_send_buffer;
   static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] =
   {
      {(CORBA_TypeCode) & TC_CosEventComm_Disconnected_struct, (gpointer) CosEventComm_Disconnected_marshal},
      {CORBA_OBJECT_NIL, NULL}};

   _ORBIT_retval = _impl_try_pull(_ORBIT_servant, &(has_event),
				  ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
      /* marshal return value */
      ORBit_marshal_any(_ORBIT_send_buffer, &(*_ORBIT_retval));
      /* marshal parameter has_event */
      giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &has_event, sizeof(has_event));
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
   if (ev->_major == CORBA_NO_EXCEPTION)
      CORBA_free(_ORBIT_retval);
}

static void
skel_CosEventComm_PullSupplier_disconnect_pull_supplier(POA_CosEventComm_PullSupplier * _ORBIT_servant,
					GIOPRecvBuffer * _ORBIT_recv_buffer,
						     CORBA_Environment * ev,
     void (*_impl_disconnect_pull_supplier) (PortableServer_Servant servant,
					     CORBA_Environment * ev))
{
   GIOPSendBuffer *_ORBIT_send_buffer;

   _impl_disconnect_pull_supplier(_ORBIT_servant, ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, NULL);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
}

static ORBitSkeleton 
get_skel_CosEventComm_PullSupplier(POA_CosEventComm_PullSupplier * servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'd':
	*impl = servant->vepv->CosEventComm_PullSupplier_epv->disconnect_pull_supplier;
	return (gpointer) skel_CosEventComm_PullSupplier_disconnect_pull_supplier;
	break;
     case 'p':
	*impl = servant->vepv->CosEventComm_PullSupplier_epv->pull;
	return (gpointer) skel_CosEventComm_PullSupplier_pull;
	break;
     case 't':
	*impl = servant->vepv->CosEventComm_PullSupplier_epv->try_pull;
	return (gpointer) skel_CosEventComm_PullSupplier_try_pull;
	break;
     default:
	return NULL;
   }
}

static void 
init_local_objref_CosEventComm_PullSupplier(CORBA_Object obj, POA_CosEventComm_PullSupplier * servant)
{
   obj->vepv[CosEventComm_PullSupplier__classid] = servant->vepv->CosEventComm_PullSupplier_epv;
}

void 
POA_CosEventComm_PullSupplier__init(POA_CosEventComm_PullSupplier * servant,
				    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
   {(gpointer) & get_skel_CosEventComm_PullSupplier, "IDL:omg.org/CosEventComm/PullSupplier:1.0", (gpointer) & init_local_objref_CosEventComm_PullSupplier};

   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(servant->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosEventComm_PullSupplier__classid)
      CosEventComm_PullSupplier__classid = ORBit_register_class(&class_info);
}

void 
POA_CosEventComm_PullSupplier__fini(POA_CosEventComm_PullSupplier * servant,
				    CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}

static void
skel_CosEventComm_PullConsumer_disconnect_pull_consumer(POA_CosEventComm_PullConsumer * _ORBIT_servant,
					GIOPRecvBuffer * _ORBIT_recv_buffer,
						     CORBA_Environment * ev,
     void (*_impl_disconnect_pull_consumer) (PortableServer_Servant servant,
					     CORBA_Environment * ev))
{
   GIOPSendBuffer *_ORBIT_send_buffer;

   _impl_disconnect_pull_consumer(_ORBIT_servant, ev);
   _ORBIT_send_buffer =
      giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL,
			   _ORBIT_recv_buffer->message.u.request.request_id,
				 ev->_major);

   if (ev->_major == CORBA_NO_EXCEPTION) {
   } else if (ev->_major == CORBA_SYSTEM_EXCEPTION)
      ORBit_send_system_exception(_ORBIT_send_buffer, ev);
   else if (ev->_major == CORBA_USER_EXCEPTION)
      ORBit_send_user_exception(_ORBIT_send_buffer, ev, NULL);
   giop_send_buffer_write(_ORBIT_send_buffer);
   giop_send_buffer_unuse(_ORBIT_send_buffer);
}

static ORBitSkeleton 
get_skel_CosEventComm_PullConsumer(POA_CosEventComm_PullConsumer * servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'd':
	*impl = servant->vepv->CosEventComm_PullConsumer_epv->disconnect_pull_consumer;
	return (gpointer) skel_CosEventComm_PullConsumer_disconnect_pull_consumer;
	break;
     default:
	return NULL;
   }
}

static void 
init_local_objref_CosEventComm_PullConsumer(CORBA_Object obj, POA_CosEventComm_PullConsumer * servant)
{
   obj->vepv[CosEventComm_PullConsumer__classid] = servant->vepv->CosEventComm_PullConsumer_epv;
}

void 
POA_CosEventComm_PullConsumer__init(POA_CosEventComm_PullConsumer * servant,
				    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
   {(gpointer) & get_skel_CosEventComm_PullConsumer, "IDL:omg.org/CosEventComm/PullConsumer:1.0", (gpointer) & init_local_objref_CosEventComm_PullConsumer};

   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(servant->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosEventComm_PullConsumer__classid)
      CosEventComm_PullConsumer__classid = ORBit_register_class(&class_info);
}

void 
POA_CosEventComm_PullConsumer__fini(POA_CosEventComm_PullConsumer * servant,
				    CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}

/***************** End module CosEventComm ***************/
