cosnotifycomm_i.h

来自「编译工具」· C头文件 代码 · 共 599 行 · 第 1/2 页

H
599
字号
// -*- Mode: C++; -*-#ifndef _COS_NOTIFY_COMM_I_H_#define _COS_NOTIFY_COMM_I_H_#include <iostream.h>#include "corba_wrappers.h"#ifndef COS_USES_BOA#include "COS/CosNotifyComm.hh"#else#include "COS/BOA/CosNotifyComm.hh"#endif// ------------------------------------------------------------- //// Here, we define the implementation of the client skeletons so //// that a "default" library can be provided to applications.  In //// most cases, applications will customize these implementations //// using inheritance.                                            //// ------------------------------------------------------------- //typedef CosNotification::EventType       CosN_EventType;typedef CosNotification::EventTypeSeq    CosN_EventTypeSeq;typedef CosNotification::StructuredEvent CosN_StructuredEvent;typedef CosNotification::EventBatch      CosN_EventBatch;// ---------------- CosNotifyComm::PushConsumer ---------------- //class PushConsumer_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, PushConsumer) {public:  PushConsumer_i() : num_push(0) {;}  inline void push(const CORBA::Any & data  WRAPPED_DECLARG );  inline void disconnect_push_consumer( WRAPPED_DECLARG_VOID );  inline void offer_change(const CosN_EventTypeSeq& added,                           const CosN_EventTypeSeq& deled  WRAPPED_DECLARG );protected:  CORBA::ULong num_push;};inline void PushConsumer_i::push(const CORBA::Any& data WRAPPED_IMPLARG ){ cout << "PushConsumer: push() called " << ++num_push << " times" << endl; }inline void PushConsumer_i::disconnect_push_consumer( WRAPPED_IMPLARG_VOID ){ cout << "PushConsumer: disconnected" << endl; }inline void PushConsumer_i::offer_change(const CosN_EventTypeSeq& added,				         const CosN_EventTypeSeq& deled 					 WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "PushConsumer: offer_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		 "::"  << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 	        "::"   << (const char*)type.type_name   << endl;  }}// ---------------- CosNotifyComm::PullConsumer ---------------- //class PullConsumer_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, PullConsumer) {public:  PullConsumer_i() {;}  inline void disconnect_pull_consumer(  WRAPPED_DECLARG_VOID );  inline void offer_change(const CosN_EventTypeSeq& added,			   const CosN_EventTypeSeq& deled WRAPPED_DECLARG );};inline void PullConsumer_i::disconnect_pull_consumer( WRAPPED_IMPLARG_VOID ){ cout << "PullConsumer: disconnected" << endl; }inline void PullConsumer_i::offer_change(const CosN_EventTypeSeq& added,                                         const CosN_EventTypeSeq& deled				         WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "PullConsumer: offer_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }}// ---------------- CosNotifyComm::PullSupplier ---------------- //class PullSupplier_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, PullSupplier) {public:  PullSupplier_i() : event_value(0) {;}   inline CORBA::Any* pull( WRAPPED_DECLARG_VOID );  inline CORBA::Any* try_pull(CORBA::Boolean& has_event WRAPPED_DECLARG );  inline void        disconnect_pull_supplier( WRAPPED_DECLARG_VOID );  inline void        subscription_change(const CosN_EventTypeSeq& added,                                  	 const CosN_EventTypeSeq& deled					 WRAPPED_DECLARG );protected:  CORBA::ULong event_value;};inline CORBA::Any* PullSupplier_i::pull( WRAPPED_IMPLARG_VOID ){   CORBA::Any *any = new CORBA::Any();  *any <<= ++event_value;  cout << "PullSupplier: pull() called for event " << event_value << endl;  return any;}inline CORBA::Any* PullSupplier_i::try_pull(CORBA::Boolean& has_event					    WRAPPED_IMPLARG ){  CORBA::Any *any = new CORBA::Any();  *any <<= ++event_value;  cout << "PullSupplier: try_pull() called for event " << event_value << endl;  has_event = 1;  return any;}inline void PullSupplier_i::disconnect_pull_supplier( WRAPPED_IMPLARG_VOID ){ cout << "PullSupplier: disconnected" << endl; }inline void PullSupplier_i::subscription_change(const CosN_EventTypeSeq& added,					        const CosN_EventTypeSeq& deled					        WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "PullSupplier: subscription_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }}					// ---------------- CosNotifyComm::PushSupplier ---------------- //class PushSupplier_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, PushSupplier) {public:  PushSupplier_i() {;}  inline void disconnect_push_supplier(  WRAPPED_DECLARG_VOID );  inline void subscription_change(const CosN_EventTypeSeq& added,                                  const CosN_EventTypeSeq& deled 				  WRAPPED_DECLARG );};inline void PushSupplier_i::disconnect_push_supplier( WRAPPED_IMPLARG_VOID ){ cout << "PushSupplier: disconnected" << endl; }inline void PushSupplier_i::subscription_change(const CosN_EventTypeSeq& added,					 	const CosN_EventTypeSeq& deled					        WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "PushSupplier: subscription_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }}// ----------- CosNotifyComm::StructuredPushConsumer ----------- //class StructuredPushConsumer_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, StructuredPushConsumer) {public:  StructuredPushConsumer_i() : num_push(0) {;}  inline void push_structured_event(const CosN_StructuredEvent& event				    WRAPPED_DECLARG );  inline void disconnect_structured_push_consumer( WRAPPED_DECLARG_VOID );  inline void offer_change(const CosN_EventTypeSeq& added,                           const CosN_EventTypeSeq& deled			   WRAPPED_DECLARG );protected:  CORBA::ULong num_push;};inline void StructuredPushConsumer_i::push_structured_event(		const CosN_StructuredEvent& event WRAPPED_IMPLARG ){ cout << "StructuredPushConsumer: push() " << ++num_push << " times" << endl; }inline void StructuredPushConsumer_i::disconnect_structured_push_consumer( 			WRAPPED_IMPLARG_VOID ){ cout << "StructuredPushConsumer: disconnected" << endl; }inline void StructuredPushConsumer_i::offer_change(				const CosN_EventTypeSeq& added,			      	const CosN_EventTypeSeq& deled WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "StructuredPushConsumer: offer_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }}// ----------- CosNotifyComm::StructuredPullConsumer ----------- //class StructuredPullConsumer_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, StructuredPullConsumer) {public:  StructuredPullConsumer_i() {;}  inline void disconnect_structured_pull_consumer(  WRAPPED_DECLARG_VOID );  inline void offer_change(const CosN_EventTypeSeq& added,			   const CosN_EventTypeSeq& deled WRAPPED_DECLARG );};inline void StructuredPullConsumer_i::disconnect_structured_pull_consumer( 				WRAPPED_IMPLARG_VOID ){ cout << "StructuredPullConsumer: disconnected" << endl; }inline void StructuredPullConsumer_i::offer_change(				const CosN_EventTypeSeq& added,				const CosN_EventTypeSeq& deled WRAPPED_IMPLARG ){  CORBA::ULong indx;  CosN_EventType   type;  cout << "StructuredPullConsumer: offer_change contains: " << endl;  for (indx = 0; indx < added.length(); indx++) {        type = added[indx];        cout << "\t+ " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }  for (indx = 0; indx < deled.length(); indx++) {        type = deled[indx];        cout << "\t- " << (const char*)type.domain_name << 		"::"   << (const char*)type.type_name   << endl;  }}// ----------- CosNotifyComm::StructuredPullSupplier ----------- //class StructuredPullSupplier_i : 	WRAPPED_SKELETON_SUPER(CosNotifyComm::, StructuredPullSupplier) {public:  inline StructuredPullSupplier_i();  inline CosN_StructuredEvent* pull_structured_event( WRAPPED_DECLARG_VOID );  inline CosN_StructuredEvent* try_pull_structured_event(			CORBA::Boolean& has_event WRAPPED_DECLARG );  inline void disconnect_structured_pull_supplier(  WRAPPED_DECLARG_VOID );  inline void subscription_change(const CosN_EventTypeSeq& added,			          const CosN_EventTypeSeq& deled 				  WRAPPED_DECLARG );protected:  CORBA::ULong num_events;  CosN_EventType   event_type;};inline StructuredPullSupplier_i::StructuredPullSupplier_i() : num_events(0){ event_type.domain_name = CORBA::string_dup("DummyDomain");  event_type.type_name   = CORBA::string_dup("DummyType");}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?