Previous Table of Contents Next


22.11.2 Client-Side C++ Example for the Asynchronous Method Signatures


   This section shows sample C++ that is generated from the implied-IDL of the previous subsections of Section 22.4, “Section II - Introduction,? on page 22-13. The C++ mapping specifies a generated interface class (stub) on which method invocations are translated into operation requests. It is this class on which the function signatures are generated from their operation declarations in IDL. It is in this class that the async functions signatures are also declared (and implemented). Using the IDL from the example in the previous section the stub class StockManager is generated following the C++ mapping. The following notes apply to this sample generated C++ code:

   // Generated file: stockmgr_c.hh (Filename is non-normative)

   // C++ - StockManager declarationclass StockManager : public virtual CORBA::Object{ public:// … all the other stuff.// StockManager SYNCHRONOUS CALLSvirtual void stock_exchange_name(const char * attr);virtual char * stock_exchange_name(); virtual CORBA::Boolean add_stock(const char* symbol,CORBA::Double q);virtual void edit_stock(const char* symbol, CORBA::Double q);virtual void remove_stock(const char* symbol, CORBA::Double_out q);virtual CORBA::Boolean find_closest_symbol(CORBA::String_out symbol);virtual CORBA::Double get_quote(const char * symbol);

   // ASYNCHRONOUS CALLBACK-MODEL CALLS

   virtual void sendc_get_stock_exchange_name(AMI_StockManagerHandler_ptr ami_handler);

   virtual void sendc_set_stock_exchange_name(

   AMI_StockManagerHandler_ptr ami_handler,const char* attr_stock_exchange_name);

   virtual void sendc_addStock(AMI_StockManagerHandler_ptr ami_handler,const char* symbol, CORBA::Double q);

   virtual void sendc_editStock(AMI_StockManagerHandler_ptr ami_handler,const char* symbol, CORBA::Double q);

   virtual void sendc_removeStock(AMI_StockManagerHandler_ptr ami_handler,const char* symbol);

   virtual void sendc_find_closest_symbol(AMI_StockManagerHandler_ptr ami_handler,const char * symbol);

   virtual void sendc_get_quote(AMI_StockManagerHandler_ptr ami_handler,const char * symbol);

   // ASYNCHRONOUS POLLING-MODEL CALLSvirtual AMI_StockManagerPoller* sendp_get_stock_exchange_name( );virtual AMI_StockManagerPoller* sendp_set_stock_exchange_name(

   const char* attr_stock_exchange_name);virtual AMI_StockManagerPoller* sendp_addStock(const char* symbol, CORBA::Double q);virtual AMI_StockManagerPoller* sendp_editStock(const char* symbol, CORBA::Double q);virtual AMI_StockManagerPoller* sendp_removeStock(const char* symbol);virtual AMI_StockManagerPoller* sendp_find_closest_symbol(const char * symbol);virtual AMI_StockManagerPoller* sendp_get_quote(const char * symbol);};