summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.h
blob: d60f76a6c68baf09e560ef3a510c11b3f42d66c3 (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

// -*- C++ -*-
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/examples/CosEC/Factory
//
// = FILENAME
//    FactoryDriver.h
//
// = DESCRIPTION
//    This class implements the Factory driver.
//
// = AUTHOR
//    Pradeep Gore <pradeep@cs.wustl.edu>
//
// ============================================================================

#ifndef TAO_FACTORYDRIVER_H
#define TAO_FACTORYDRIVER_H

#include "CosEventChannelFactory_i.h"
#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h"

// @@ Pradeep: I know this is just an example, but could you talk to
//    Vishal about making this a service that could be bootstraped
//    using the -ORBInitRef mechanisms?  That way we can run this
//    stuff without the naming service running.

class FactoryDriver
{
  // = TITLE
  //   Driver class for the CosEventChannel Factory.
  // = DESCRIPTION
  //   creates a CosEventChannel Factory and registers it with the
  //   naming service.
  //
 public:
  // = Initialization and termination code.
  FactoryDriver (const char* factory = "CosEC_Factory");
  // Constructor.

  ~FactoryDriver (void);
  // Destructor.

  int start (int argc, char *argv []);
  // Start the driver.

  int stop (void);
  //Stop the driver.

 protected:
  int parse_args (int argc, char *argv []);
  // Parse the command-line arguments and set options.

  const char* factoryName_;
  // The name of the factory registered with the naming service.

  const char* child_poa_name_;
  // The name of the Child POA.

  CORBA::ORB_var orb_;
  // The ORB that we use.

  TAO_CosEventChannelFactory_i *factory_servant_;
  // The factory servant.

  PortableServer::POA_var root_poa_;
  // Reference to the root poa.

  CosEventChannelFactory::ChannelFactory_var factory_;
  // The corba object after activation.

  TAO_Naming_Client naming_client_;
  // Use a naming client.

};
#endif /*  TAO_FACTORYDRIVER_H */