2 //=============================================================================
6 * @author Darrell Brunsch <brunsch@uci.edu>
8 //=============================================================================
16 // Forward declaration.
20 typedef Quoter_i
*Quoter_i_ptr
;
21 typedef Quoter_i_ptr Quoter_i_ref
;
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
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);
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 ();
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
;
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
83 /// Constructor that takes in the number of quoters in the pool.
84 Quoter_Factory_i (size_t num
, PortableServer::POA_ptr poa_ptr
);
89 /// Initialize everything in the factory
92 /// Return the quoter by the id <name>.
93 virtual Stock::Quoter_ptr
create_quoter (const char *name
);
96 /// Pointer to the poa.
97 PortableServer::POA_ptr poa_ptr_
;
100 Quoter_i
**my_quoters_
;
102 /// Number of quoters.
105 /// Which quoter to return next.
109 #endif /* QUOTER_IMPL_H */