Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / Quoter / Quoter_i.h
blob2539a4261f3abbf35fd2b2e26579b1d761ea3f31
2 //=============================================================================
3 /**
4 * @file Quoter_i.h
6 * @author Darrell Brunsch <brunsch@uci.edu>
7 */
8 //=============================================================================
11 #ifndef QUOTER_IMPL_H
12 #define QUOTER_IMPL_H
14 #include "QuoterS.h"
16 // Forward declaration.
17 class Quoter_i;
19 // Typedefs.
20 typedef Quoter_i *Quoter_i_ptr;
21 typedef Quoter_i_ptr Quoter_i_ref;
23 /**
24 * @class Quoter_i:
26 * @brief Quoter_i
28 * Actual Quoter Implementation class. Returns a quoter for a given stock
29 * and provides an example for the lifecycle functionality.
31 class Quoter_i: public POA_Stock::Quoter
33 public:
34 /// Constructor (use_LifeCycle_Service is 1 if the LifeCycle_Service should be used
35 /// instead of the Quoter Generic_Factory
36 Quoter_i (const char *obj_name = "",
37 const unsigned char use_LifeCycle_Service = 0,
38 PortableServer::POA_ptr poa_ptr = 0);
40 /// Destructor
41 ~Quoter_i ();
43 /// Returns the current quote for the stock <stock_name>
44 virtual CORBA::Long get_quote (const char *stock_name);
46 // = Lifecycle methods
48 /// Make a copy of this object
49 virtual CosLifeCycle::LifeCycleObject_ptr copy (CosLifeCycle::FactoryFinder_ptr there,
50 const CosLifeCycle::Criteria &the_criteria);
52 /// Move this object using <there>
53 virtual void move (CosLifeCycle::FactoryFinder_ptr there,
54 const CosLifeCycle::Criteria &the_criteria);
56 /// Removes the object.
57 virtual void remove ();
59 private:
60 /// This flag defines if a Generic Factory is used (0 by default) or
61 /// the more sophisticated LifeCycle Service (1)
62 unsigned char use_LifeCycle_Service_;
64 /// Keep a reference to the POA for use by the move operation
65 PortableServer::POA_var poa_var_;
68 // Forward declaration.
69 class Quoter_Factory_i;
71 typedef Quoter_Factory_i *Quoter_Factory_i_ptr;
73 /**
74 * @class Quoter_Factory_i:
76 * @brief Quoter_Factory_i
78 * Factory object returning the quoter_impl objrefs.
80 class Quoter_Factory_i: public POA_Stock::Quoter_Factory
82 public:
83 /// Constructor that takes in the number of quoters in the pool.
84 Quoter_Factory_i (size_t num, PortableServer::POA_ptr poa_ptr);
86 /// Destructor.
87 ~Quoter_Factory_i ();
89 /// Initialize everything in the factory
90 int init ();
92 /// Return the quoter by the id <name>.
93 virtual Stock::Quoter_ptr create_quoter (const char *name);
95 private:
96 /// Pointer to the poa.
97 PortableServer::POA_ptr poa_ptr_;
99 /// Array of quoters.
100 Quoter_i **my_quoters_;
102 /// Number of quoters.
103 size_t quoter_num_;
105 /// Which quoter to return next.
106 size_t next_quoter_;
109 #endif /* QUOTER_IMPL_H */