Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / docs / tutorials / Quoter / RTCORBA / Broker_i.h
blob2d7fd13d37db6e157375be9f807e276be3dad2a4
1 /**
2 * @file Broker_i.h
3 * @author Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
4 * @author William R. Otte <wotte@dre.vanderbilt.edu>
5 * @author Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
6 */
8 #ifndef BROKERI_H_
9 #define BROKERI_H_
11 // local headers
12 #include "StockNameConsumer_i.h"
13 #include "BrokerS.h"
14 #include "DistributorC.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 /**
21 * @class Stock_StockBroker_i
22 * @brief This class defined the Stock Broker client.
24 class Stock_StockBroker_i
25 : public virtual POA_Stock::StockBroker
27 public:
28 /**
29 * Constructor.
31 * @param orb
32 * @param stock_name The name of the stock that the Stock Broker client is interested in.
33 * @param priority The CORBA priority of this Stock Broker client.
35 Stock_StockBroker_i (CORBA::ORB_ptr orb,
36 Stock::StockDistributor_ptr dist,
37 const char *stock_name);
39 /// Destructor
40 virtual ~Stock_StockBroker_i (void);
42 /**
43 * Return the StockNameConsumer object created by the Constructor.
45 * @return Returns a StockNameConsumer object reference.
47 virtual ::Stock::StockNameConsumer_ptr get_consumer_notifier ();
49 /**
50 * Duplicate a StockQuoter object using the StockQuoter object reference "c" in the argument.
52 * @param c A StockQuoter object reference.
54 virtual void connect_quoter_info (::Stock::StockQuoter_ptr c);
56 /**
57 * Destroy the StockQuoter object and return it.
59 * @return Returns the destroyed StockQuoter object reference.
61 virtual ::Stock::StockQuoter_ptr disconnect_quoter_info ();
63 /**
64 * Return the StockQuoter object.
66 * @return Returns the StockQuoter object reference that has been
67 * created by connect_quoter_info ().
69 virtual ::Stock::StockQuoter_ptr get_connection_quoter_info ();
71 /**
72 * Shutdown the object and destroy the application.
74 virtual void shutdown ();
76 private:
77 // Cached ORB pointer
78 CORBA::ORB_var orb_;
80 /// A StockQuoter object reference that is used to get detailed
81 /// stock information.
82 Stock::StockQuoter_var quoter_;
84 /// A StockNameConsumer servant that is used to get notification of
85 /// updates.
86 Stock_StockNameConsumer_i *consumer_;
88 /// The distributor that we are registered with, useful for shutdown.
89 Stock::StockDistributor_var distributor_;
92 /**
93 * @class Stock_StockBrokerHome_i
94 * @brief This class defined the Stock Broker home.
96 class Stock_StockBrokerHome_i
97 : public virtual POA_Stock::StockBrokerHome,
98 public ACE_Event_Handler
100 public:
102 * Constructor.
103 * Register the necessary factories and mappings with the specified orb and
104 * Create a new instance of the StockBroker object.
106 * @param orb
108 Stock_StockBrokerHome_i (CORBA::ORB_ptr orb);
110 /// Destructor
111 virtual ~Stock_StockBrokerHome_i (void);
114 * Return the StockBroker object created by the Constructor.
116 * @return The StockBroker object created by the Constructor.
118 virtual ::Stock::StockBroker_ptr create (Stock::StockDistributor_ptr dist,
119 const char *stock_name);
121 virtual int handle_signal (int signum,
122 siginfo_t * = 0,
123 ucontext_t * = 0);
125 private:
126 /// The StockDistributor object created by its home.
127 Stock::StockBroker_var broker_;
129 /// Cache a reference to the ORB.
130 CORBA::ORB_var orb_;
133 #endif /* BROKERI_H_ */