~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/examples/Quoter/Quoter_i.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Quoter_i.h,v 1.8 2002/01/29 20:20:41 okellogg Exp
2
 
 
3
 
// ============================================================================
4
 
//
5
 
// = LIBRARY
6
 
//    TAO/examples/Quoter
7
 
//
8
 
// = FILENAME
9
 
//    Quoter_i.h
10
 
//
11
 
// = AUTHOR
12
 
//    Darrell Brunsch <brunsch@uci.edu>
13
 
//
14
 
// ============================================================================
15
 
 
16
 
#ifndef QUOTER_IMPL_H
17
 
#define QUOTER_IMPL_H
18
 
 
19
 
#include "QuoterS.h"
20
 
 
21
 
// Forward declaration.
22
 
class Quoter_i;
23
 
 
24
 
// Typedefs.
25
 
typedef Quoter_i *Quoter_i_ptr;
26
 
typedef Quoter_i_ptr Quoter_i_ref;
27
 
 
28
 
class Quoter_i: public POA_Stock::Quoter
29
 
{
30
 
  // = TITLE
31
 
  //   Quoter_i
32
 
  //
33
 
  // = DESCRIPTION
34
 
  //   Actual Quoter Implementation class.  Returns a quoter for a given stock
35
 
  //   and provides an example for the lifecycle functionality.
36
 
public:
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
42
 
 
43
 
  ~Quoter_i (void);
44
 
  // Destructor
45
 
 
46
 
  virtual CORBA::Long get_quote (const char *stock_name
47
 
                                 ACE_ENV_ARG_DECL)
48
 
      ACE_THROW_SPEC ((CORBA::SystemException,
49
 
                       Stock::Invalid_Stock,
50
 
                       Stock::Invalid_Quoter));
51
 
  // Returns the current quote for the stock <stock_name>
52
 
 
53
 
  // = Lifecycle methods
54
 
 
55
 
  virtual CosLifeCycle::LifeCycleObject_ptr copy (CosLifeCycle::FactoryFinder_ptr there,
56
 
                                                  const CosLifeCycle::Criteria &the_criteria
57
 
                                                  ACE_ENV_ARG_DECL)
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
64
 
 
65
 
  virtual void move (CosLifeCycle::FactoryFinder_ptr there,
66
 
                     const CosLifeCycle::Criteria &the_criteria
67
 
                     ACE_ENV_ARG_DECL)
68
 
      ACE_THROW_SPEC ((CORBA::SystemException,
69
 
                       CosLifeCycle::NoFactory,
70
 
                       CosLifeCycle::NotMovable,
71
 
                       CosLifeCycle::InvalidCriteria,
72
 
                       CosLifeCycle::CannotMeetCriteria));
73
 
  // Move this object using <there>
74
 
 
75
 
  virtual void remove (ACE_ENV_SINGLE_ARG_DECL)
76
 
      ACE_THROW_SPEC ((CORBA::SystemException,
77
 
                       CosLifeCycle::NotRemovable));
78
 
  // Removes the object.
79
 
 
80
 
private:
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)
84
 
 
85
 
  PortableServer::POA_var poa_var_;
86
 
  // Keep a reference to the POA for use by the move operation
87
 
};
88
 
 
89
 
// Forward declaration.
90
 
class Quoter_Factory_i;
91
 
 
92
 
typedef Quoter_Factory_i *Quoter_Factory_i_ptr;
93
 
 
94
 
class Quoter_Factory_i: public POA_Stock::Quoter_Factory
95
 
{
96
 
  // = TITLE
97
 
  //   Quoter_Factory_i
98
 
  //
99
 
  // = DESCRIPTION
100
 
  //   Factory object returning the quoter_impl objrefs.
101
 
public:
102
 
  Quoter_Factory_i (size_t num, PortableServer::POA_ptr poa_ptr);
103
 
  // Constructor that takes in the number of quoters in the pool.
104
 
 
105
 
  ~Quoter_Factory_i (void);
106
 
  // Destructor.
107
 
 
108
 
  int init (ACE_ENV_SINGLE_ARG_DECL);
109
 
  // Initialize everything in the factory
110
 
 
111
 
  virtual Stock::Quoter_ptr create_quoter (const char *name
112
 
                                           ACE_ENV_ARG_DECL)
113
 
      ACE_THROW_SPEC ((CORBA::SystemException,
114
 
                       Stock::Invalid_Quoter));
115
 
  // Return the quoter by the id <name>.
116
 
 
117
 
private:
118
 
  PortableServer::POA_ptr poa_ptr_;
119
 
  // Pointer to the poa.
120
 
 
121
 
  Quoter_i **my_quoters_;
122
 
  // Array of quoters.
123
 
 
124
 
  size_t quoter_num_;
125
 
  // Number of quoters.
126
 
 
127
 
  size_t next_quoter_;
128
 
  // Which quoter to return next.
129
 
};
130
 
 
131
 
#endif /* QUOTER_IMPL_H */