Debian Codegraph @

netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h

raw symbols SCIP
1 // -*- C++ -*-
2 #include "ace/Event_Handler.h"
3
4 #if !defined (ACE_LACKS_PRAGMA_ONCE)
5 # pragma once
6 #endif /* ACE_LACKS_PRAGMA_ONCE */
7
8 #include "ace/Reactor.h"
9 #include "ace/Naming_Context.h"
10
11 class Dump_Restore : public ACE_Event_Handler
12 {
13 public:
14 enum Operation_Type
15 {
16 BIND,
17 UNBIND,
18 REBIND
19 };
20 Dump_Restore (int argc, ACE_TCHAR *argv[]);
21 // Initialize name options and naming context
22
23 ~Dump_Restore ();
24
25 virtual int handle_input (ACE_HANDLE handle);
26 // Handle user entered commands
27
28 void dump ();
29
30 private:
31 ACE_TCHAR hostname_[MAXHOSTNAMELEN + 1];
32 // Cache the hostname and port number for remote case
33
34 void display_menu ();
35 // Display user menu.
36
37 int set_proc_local ();
38 // Set options to use PROC_LOCAL naming context.
39
40 int set_node_local ();
41 // Set options to use NODE_LOCAL naming context.
42
43 int set_host (const ACE_TCHAR *hostname,
44 int port);
45 // Set options to use NET_LOCAL naming context specifying host name
46 // and port number.
47
48 int quit ();
49 // Gracefully exit.
50
51 int populate (Dump_Restore::Operation_Type op);
52
53 int doit (Dump_Restore::Operation_Type op,
54 const char *name,
55 const char *value,
56 const char *type = "");
57 int bind (const char *key,
58 const char *value,
59 const char *type = "");
60 int unbind (const char *key);
61 int rebind (const char *key,
62 const char *value,
63 const char *type = "");
64
65 char filename_[MAXPATHLEN + 1];
66 char dump_filename_[MAXPATHLEN + 1];
67
68 u_short port_;
69 // port server is listening on
70
71 ACE_Naming_Context *ns_context_;
72 // Current naming context
73
74 ACE_Naming_Context::Context_Scope_Type ns_scope_;
75 // Defines the scope of the naming context
76
77 FILE *infile_;
78 // input file
79
80 ACE_Name_Options *name_options_;
81 // Name Options associated with the Naming Context
82 };