summaryrefslogtreecommitdiff
path: root/TAO/examples/Simple/time-date/Time_Date.h
blob: e10e06c12bf5afa2122791a23ed9c40239dda21e (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
// $Id$

#include "Time_Date_i.h"
#include "tao/TAO.h"
#include "ace/Task.h"

class ACE_Svc_Export DLL_ORB : public ACE_Task_Base
{
  // = TITLE
  //   Define a class that dynamically links an ORB into a server
  //   process via the <ACE_Service_Configurator>.
public:
  virtual int init (int argc, char *argv[]);
  // Initialize the <TAO_ORB_Manager>.

  virtual int fini (void);
  // Shutdown the <TAO_ORB_Manager>.

  virtual int svc (void);
  // Concurrency hook.

  TAO_ORB_Manager orb_manager_;
  // ORB manager.
};

class ACE_Svc_Export Time_Date_Servant : public ACE_Service_Object
{
  // = TITLE
  //   Define a class that dynamically links the Time_Date service
  //   into a server process via the <ACE_Service_Configurator>.  Note
  //   that this assumes the ORB has been linked previously.
public:
  virtual int init (int argc, char *argv[]);
  // Initialize the <Time_Date> servant.

  int parse_args (int argc, char *argv[]);
  // Parse the "command-line" arguments.

private:
   Time_Date_i servant_;
  // Servant for the <Time_Date> object.

  FILE *ior_output_file_;
  // File where the IOR of the server object is stored.

  const char *orb_;
  // Name of the ORB we're linking dynamically.
};

// The following Factory is used by the <ACE_Service_Config> and
// dll_orb.conf file to dynamically initialize the state of the
// Time_Date service.
ACE_SVC_FACTORY_DECLARE (DLL_ORB)
ACE_SVC_FACTORY_DECLARE (Time_Date_Servant)