1
// Quoter_i.h,v 1.8 2002/01/29 20:20:41 okellogg Exp
3
// ============================================================================
12
// Darrell Brunsch <brunsch@uci.edu>
14
// ============================================================================
21
// Forward declaration.
25
typedef Quoter_i *Quoter_i_ptr;
26
typedef Quoter_i_ptr Quoter_i_ref;
28
class Quoter_i: public POA_Stock::Quoter
34
// Actual Quoter Implementation class. Returns a quoter for a given stock
35
// and provides an example for the lifecycle functionality.
37
Quoter_i (const char *obj_name = "",
38
const unsigned char use_LifeCycle_Service = 0,
39
PortableServer::POA_ptr poa_ptr = 0);
40
// Constructor (use_LifeCycle_Service is 1 if the LifeCycle_Service should be used
41
// instead of the Quoter Generic_Factory
46
virtual CORBA::Long get_quote (const char *stock_name
48
ACE_THROW_SPEC ((CORBA::SystemException,
50
Stock::Invalid_Quoter));
51
// Returns the current quote for the stock <stock_name>
53
// = Lifecycle methods
55
virtual CosLifeCycle::LifeCycleObject_ptr copy (CosLifeCycle::FactoryFinder_ptr there,
56
const CosLifeCycle::Criteria &the_criteria
58
ACE_THROW_SPEC ((CORBA::SystemException,
59
CosLifeCycle::NoFactory,
60
CosLifeCycle::NotCopyable,
61
CosLifeCycle::InvalidCriteria,
62
CosLifeCycle::CannotMeetCriteria));
63
// Make a copy of this object
65
virtual void move (CosLifeCycle::FactoryFinder_ptr there,
66
const CosLifeCycle::Criteria &the_criteria
68
ACE_THROW_SPEC ((CORBA::SystemException,
69
CosLifeCycle::NoFactory,
70
CosLifeCycle::NotMovable,
71
CosLifeCycle::InvalidCriteria,
72
CosLifeCycle::CannotMeetCriteria));
73
// Move this object using <there>
75
virtual void remove (ACE_ENV_SINGLE_ARG_DECL)
76
ACE_THROW_SPEC ((CORBA::SystemException,
77
CosLifeCycle::NotRemovable));
78
// Removes the object.
81
unsigned char use_LifeCycle_Service_;
82
// This flag defines if a Generic Factory is used (0 by default) or
83
// the more sophisticated LifeCycle Service (1)
85
PortableServer::POA_var poa_var_;
86
// Keep a reference to the POA for use by the move operation
89
// Forward declaration.
90
class Quoter_Factory_i;
92
typedef Quoter_Factory_i *Quoter_Factory_i_ptr;
94
class Quoter_Factory_i: public POA_Stock::Quoter_Factory
100
// Factory object returning the quoter_impl objrefs.
102
Quoter_Factory_i (size_t num, PortableServer::POA_ptr poa_ptr);
103
// Constructor that takes in the number of quoters in the pool.
105
~Quoter_Factory_i (void);
108
int init (ACE_ENV_SINGLE_ARG_DECL);
109
// Initialize everything in the factory
111
virtual Stock::Quoter_ptr create_quoter (const char *name
113
ACE_THROW_SPEC ((CORBA::SystemException,
114
Stock::Invalid_Quoter));
115
// Return the quoter by the id <name>.
118
PortableServer::POA_ptr poa_ptr_;
119
// Pointer to the poa.
121
Quoter_i **my_quoters_;
125
// Number of quoters.
128
// Which quoter to return next.
131
#endif /* QUOTER_IMPL_H */