Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / docs / tutorials / Quoter / RTCORBA / StockNameConsumer_i.h
blob9636f90e23b55bc5ab040abb8c1086b4956de66b
1 /**
2 * @file StockNameConsumer_i.h
4 * @author Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
5 * @author William R. Otte <wotte@dre.vanderbilt.edu>
6 * @author Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
7 */
9 #ifndef STOCKNAMECONSUMER_I_H_
10 #define STOCKNAMECONSUMER_I_H_
12 // local headers
13 #include "CommonS.h"
14 #include "BrokerS.h"
16 // TAO headers
17 #include "tao/RTCORBA/RTCORBA.h"
19 // STL headers
20 #include <string>
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 // Forward declaration
27 class Stock_StockBroker_i;
29 /**
30 * @class Stock_StockNameConsumer_i
31 * @brief This class is used as a callback interface used by the
32 * distributor to notify brokers of updates. This class is ALSO used as a
33 * signal handler to catch SIGINT and properly unsubscribe from the
34 * distributor.
36 class Stock_StockNameConsumer_i :
37 public virtual POA_Stock::StockNameConsumer
39 public:
40 /**
41 * Constructor.
43 * @param parent The parent StockBroker object reference of the StockNameConsumer object.
44 * @param stock_name The name of the stock that the parent StockBroker object need to listen to.
46 Stock_StockNameConsumer_i (Stock_StockBroker_i &context,
47 const char *stock_name);
49 /// Destructor.
50 virtual ~Stock_StockNameConsumer_i (void);
52 /**
53 * Push an event to the consumer.
55 * @param the_stockname The name of the stock that will be provided to the context StockBroker object.
57 virtual void push_StockName (::Stock::StockNames *the_stockname);
59 /**
60 * Get the cookie attribute.
62 * @return The cookie attribute.
64 virtual ::Stock::Cookie * cookie_ ();
66 /**
67 * Set the cookie attribute.
69 * @param cookie The value of cookie attribute that need to be set.
71 virtual void cookie_ (::Stock::Cookie *cookie);
73 private:
74 /// Context of the StockNameConsumer object.
75 Stock_StockBroker_i &context_;
77 /// Name of the stock to listen to.
78 CORBA::String_var stock_name_;
80 Stock::Cookie_var cookie__;
83 #endif /* STOCKNAMECONSUMER_I_H_ */