blob: 2261ee9574c25afd22360d3fa2c744cd1e6108cf (
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
109
110
111
112
113
114
115
116
117
118
119
|
// -*- C++ -*-
// $Id$
/**
* @file controller_i.h
*
* @brief Controller command implementations for CIAO's daemon controller.
*
* @author Nanbor Wang <nanbor@cs.wustl.edu>
*/
#ifndef CIAO_CONTROLLER_I_H
#define CIAO_CONTROLLER_I_H
#include "ace/pre.h"
#include "DaemonC.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
namespace CIAO
{
namespace Daemon_i
{
class Command_Base;
/**
* @class controller
*
* @brief Daemon Controller.
*/
class controller
{
public:
controller (void);
~controller (void);
int parse_args (int argc, char *argv[] ACE_ENV_ARG_DECL_WITH_DEFAULTS);
int init (int argc,
char *argv[]
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
int fini (void);
void print_usage (void);
int write_IOR (const char *ior,
const char *filename);
/// Does not increase reference count.
Daemon_ptr daemon ();
CORBA::ORB_ptr orb ();
protected:
CORBA::ORB_var orb_;
Command_Base *cmd_;
Daemon_var daemon_;
};
/**
* @class Command
*
* @brief Abstract base for CIAO daemon controller supported commands.
*/
class Command
{
public:
Command (controller *c);
virtual ~Command () = 0;
virtual int parse_args (int argc,
char *argv[]
ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
virtual int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) = 0;
protected:
controller *controller_;
};
/**
* @class Command_Base
*
* @brief Abstract base for CIAO daemon controller supported commands.
*/
class Command_Base
{
public:
Command_Base (controller *c);
virtual ~Command_Base () = 0;
virtual int parse_args (int argc,
char *argv[]
ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
virtual int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) = 0;
protected:
controller *controller_;
};
}
}
#if defined (__ACE_INLINE__)
# include "controller_i.inl"
#endif /* __ACE_INLINE__ */
#include "ace/post.h"
#endif /* CIAO_CONTROLLER_I_H */
|