-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRuntime.h
More file actions
139 lines (115 loc) · 4.39 KB
/
Copy pathRuntime.h
File metadata and controls
139 lines (115 loc) · 4.39 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef MicroMiddleware_Runtime_h_IsIncluded
#define MicroMiddleware_Runtime_h_IsIncluded
#include"MicroMiddleware/NetObjects/HostInformation.h"
#include"MicroMiddleware/NetObjects/InterfaceHandle.h"
#include"MicroMiddleware/Export.h"
namespace MicroMiddleware
{
class DLL_STATE Runtime
{
private:
static InterfaceHandle lookupServerHandle;
static InterfaceHandle localHostHandle;
static HostInformation componentHostInformation;
public:
/**
* True if middleware has been initialized, false if otherwise.
*/
static bool Initialized;
/**
* A static method that must be called by an application before using the
* LightweightMiddleware.
*/
static void Initialize();
/**
* A static method that must be called by an application before using the
* LightweightMiddleware.
*/
static void Initialize(int arg, char* argv[]);
/**
* A static method that must be called by an application or DLL before shutting down
* in order to free resources used by the LightweightMiddleware.
*
* @param maxWaitCounter number of quarter seconds to wait before exiting
*/
static void Release(int maxWaitCounter=40);
/**
* Check if command line arguments contains LookupServer info.
*
* @param argc the number of arguments on the command line for the process
* @param argv an array of strings containing the command line arguments
* @return true if LookupServer arguments are parts of the command line arguments
*/
static bool HasLookupServerInfo(int argc, char* argv[]);
/**
* Extract the InterfaceHandle to the LookupServer
*
* @param argc the number of arguments on the command line for the process (including the file name of the process)
* @param argv an array of strings containing the command line arguments
* @return the LookupServer InterfaceHandle
*/
static InterfaceHandle GetLookupServerHandle(int argc, char* argv[]);
/**
* Return the static private InterfaceHandle Runtime::lookupServerHandle to the LookupServer.
*
* @return the LookupServer InterfaceHandle
*/
static InterfaceHandle GetLookupServerHandle();
/**
* Return the static private InterfaceHandle Runtime::settingsManagerHandle to the SettingsManager.
*
* @return the SettingsManager InterfaceHandle
*/
static InterfaceHandle GetSettingsManagerHandle();
/**
* Extract the HostInformation from file-name retrieved from GetInstanceName
*
* @param componentName The component's name
* @return The component's HostInformation
*/
static HostInformation GetHostInformation(string instanceName);
/**
* Extract the HostInformation from arguments, and initializes the static InterfaceHandle localHostHandle,
* and the static HostInformation componentHostInformation.
*
* @param argc the number of arguments on the command line for the process (including the file name of the process)
* @param argv an array of strings containing the command line arguments
* @return The component's HostInformation
*/
static HostInformation GetHostInformation(int argc, char* argv[]);
/**
* Return the static private HostInformation Runtime::componentHostInformation to the Component.
*
* @return the HostInformation for the Component.
*/
static HostInformation GetHostInformation();
static std::string GetComponentName();
/**
* After logging in to the MembershipManager update Runtime's static HostInformation.
*
* @param hostInfo The current running process's HostInformation.
*/
static void SetHostInformation(HostInformation hostInfo);
/**
* Extract the static InterfaceHandle localHostHandle.
*
* @return The component's HostInformation
*/
static InterfaceHandle GetInterfaceHandle();
/**
* Extract the instance name from the command line arguments.
*
* @param argc the number of arguments on the command line for the process (including the file name of the process)
* @param argv an array of strings containing the command line arguments
* @return the name of the instance
*/
static string GetInstanceName(int argc, char* argv[]);
/**
* This method make the current process shutdown in an orderly fashion. Typically used when detecting
* a fatal error within another thread than the main thread. Currently the effect of this method
* is the same as sending the process a SIGTERM signal.
*/
static void ShutDown();
};
} // namespace MicroMiddleware
#endif