summaryrefslogtreecommitdiff
path: root/TAO/tests/Quoter/Quoter_Client.h
blob: c259ed4b5ddff73a2f1b3e93494dd64c5fc15512 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// $Id$
// -*- C++ -*-

#if !defined (QUOTER_CLIENT_H)
#define QUOTER_CLIENT_H

// ============================================================================
//
// = LIBRARY
//    TAO/tests/Quoter
//
// = FILENAME
//    quoter_client.h
//
// = DESCRIPTION
//    @@@ Write this
//
// = AUTHORS
//    Darrell Brunsch
//
// ============================================================================

#include "ace/Get_Opt.h"
#include "ace/Task.h"
#include "ace/Thread_Manager.h"
#include "tao/corba.h"
#include "quoterC.h"

class Quoter_Client
{
  // = TITLE
  //    @@@ Write this
  //
  // = DESCRIPTION
  //    @@@ Write this
public:
  // = Constructor and destructor.
  Quoter_Client (void);
  ~Quoter_Client (void);

  int run (void);
  // Execute client example code.

  int init (int argc, char **argv);
  // Initialize the client communication endpoint with server.

private:
  int init_naming_service (void);
  // Function to initialize the naming service.

  int read_ior (char *filename);
  // Function to read the Quoter factory ior from a file.

  int parse_args (void);
  // Parses the arguments passed on the command line.

  int argc_;
  // # of arguments on the command line.

  char **argv_;
  // arguments from command line.

  char *quoter_factory_key_;
  // Key of factory obj ref.

  char *quoter_key_;
  // Key of the obj ref to be retrieved via the factory.

  int shutdown_;
  // Flag to tell server to shutdown.

  Stock::Quoter_Factory_var factory_;
  // factory pointer for cubit.

  CORBA::Environment env_;
  // Environment variable.

  Stock::Quoter_ptr quoter_;
  // Quoter obj ref.

  CORBA::ORB_var orb_;
  // Remember our orb.

  FILE *quoter_factory_ior_file_;
  // File from which to obtain the IOR.

  ACE_HANDLE f_handle_;
  // File handle to read the IOR.

  int use_naming_service_;
  // Flag to tell client not to use Namingservice to find the cubit
  // Factory.
};

class Quoter_Task : public ACE_Task<ACE_SYNCH>
{
public:
  Quoter_Task (int argc, char **argv);

  virtual int svc (void);

private:
  Quoter_Client quoter_client;
  int argc_;
  char **argv_;
};

#endif /* QUOTER_CLIENT_H */