Merge pull request #2316 from jwillemsen/jwi-taskcommenttypo
[ACE_TAO.git] / TAO / examples / Quoter / client.h
blob298fb1075f0494712d64e37d1f832b2f083794e6
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file client.h
7 * Contains classes that do the work of the client side of the Quoter Test
9 * @author Darrell Brunsch
11 //=============================================================================
13 #ifndef QUOTER_CLIENT_H
14 #define QUOTER_CLIENT_H
16 #include "ace/Get_Opt.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "QuoterC.h"
24 #include "orbsvcs/CosLifeCycleC.h"
26 #include "ace/Task.h"
27 #include "ace/Thread_Manager.h"
29 /**
30 * @class Quoter_Client
32 * @brief Quoter_Client
34 * Does all the work of making the calls on the Quoter server
36 class Quoter_Client
38 public:
39 // = Constructor and destructor.
40 Quoter_Client ();
41 ~Quoter_Client ();
43 /// Execute client example code.
44 int run ();
46 /// Initialize the client communication endpoint with server.
47 int init (int argc, ACE_TCHAR **argv);
49 private:
50 /// Remember our orb.
51 CORBA::ORB_var orb_;
53 /// Function to initialize the naming service.
54 int init_naming_service ();
56 /// Parses the arguments passed on the command line.
57 int parse_args ();
59 /// # of arguments on the command line.
60 int argc_;
62 /// arguments from command line.
63 ACE_TCHAR **argv_;
65 /// Key of factory obj ref.
66 char *quoter_factory_key_;
68 /// Key of the obj ref to be retrieved via the factory.
69 char *quoter_key_;
71 /// Flag to tell server to shutdown.
72 int shutdown_;
74 /// Pointer to a factory finder
75 Stock::Quoter_Factory_Finder_var factory_Finder_var_;
77 /// Pointer to a factory
78 Stock::Quoter_Factory_var factory_var_;
80 /// Pointer to a generic factory
81 CosLifeCycle::GenericFactory_var generic_Factory_var_;
83 /// Quoter obj ref.
84 Stock::Quoter_var quoter_var_;
86 /// Flag to tell if the a Generic Factory is going to be used
87 /// or the LifeCycle Service (0 means Generic Factory, 1 means LCS)
88 int useLifeCycleService_;
90 /// debug level (0 = quiet, 1 = default, informative, 2+ = noisy);
91 int debug_level_;
94 /**
95 * @class Quoter_Task
97 * @brief Quoter_Task
99 * Task that creates a Quoter_Client and uses it
101 class Quoter_Task : public ACE_Task<ACE_SYNCH>
103 public:
104 Quoter_Task (int argc, ACE_TCHAR **argv);
106 virtual int svc ();
108 private:
109 Quoter_Client quoter_client;
110 int argc_;
111 ACE_TCHAR **argv_;
114 #endif /* QUOTER_CLIENT_H */