Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Process.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0-alpha.0
4// <auto-generated>Generated from Slice file 'Process.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Ice_Process_h_
8#define Ice_Process_h_
9
11#include <Ice/Ice.h>
12#include "LocatorRegistry.h"
13
14#ifndef ICE_DISABLE_VERSION
15# if ICE_INT_VERSION != 30850
16# error Ice version mismatch: an exact match is required for beta generated code
17# endif
18#endif
19
20// NOLINTBEGIN(modernize-concat-nested-namespaces)
21
22namespace Ice
23{
24 class ProcessPrx;
25}
26
27namespace Ice
28{
29 /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
30 /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
31 /// @headerfile Ice/Ice.h
32 class ICE_API ProcessPrx : public Ice::Proxy<ProcessPrx, Ice::ObjectPrx>
33 {
34 public:
35 /// Constructs a proxy from a Communicator and a proxy string.
36 /// @param communicator The communicator of the new proxy.
37 /// @param proxyString The proxy string to parse.
38 ProcessPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
39
40 /// Copy constructor. Constructs with a copy of the contents of @p other.
41 /// @param other The proxy to copy from.
42 ProcessPrx(const ProcessPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
43
44 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
45 /// @param other The proxy to move from.
46 ProcessPrx(ProcessPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
47
48 ~ProcessPrx() override;
49
50 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
51 /// @param rhs The proxy to copy from.
52 /// @return A reference to this proxy.
53 ProcessPrx& operator=(const ProcessPrx& rhs) noexcept
54 {
55 if (this != &rhs)
56 {
58 }
59 return *this;
60 }
61
62 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
63 /// @param rhs The proxy to move from.
65 {
66 if (this != &rhs)
67 {
68 Ice::ObjectPrx::operator=(std::move(rhs));
69 }
70 return *this;
71 }
72
73 /// Initiates a graceful shutdown of the server application.
74 /// @param context The request context.
75 void shutdown(const Ice::Context& context = Ice::noExplicitContext) const;
76
77 /// Initiates a graceful shutdown of the server application.
78 /// @param context The request context.
79 /// @return A future that becomes available when the invocation completes.
80 [[nodiscard]] std::future<void> shutdownAsync(const Ice::Context& context = Ice::noExplicitContext) const;
81
82 /// Initiates a graceful shutdown of the server application.
83 /// @param response The response callback.
84 /// @param exception The exception callback.
85 /// @param sent The sent callback.
86 /// @param context The request context.
87 /// @return A function that can be called to cancel the invocation locally.
88 // NOLINTNEXTLINE(modernize-use-nodiscard)
89 std::function<void()> shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
90
91 /// @private
92 void _iceI_shutdown(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
93
94 /// Writes a message on the server application's stdout or stderr.
95 /// @param message The message to write.
96 /// @param fd 1 for stdout, 2 for stderr.
97 /// @param context The request context.
98 void writeMessage(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;
99
100 /// Writes a message on the server application's stdout or stderr.
101 /// @param message The message to write.
102 /// @param fd 1 for stdout, 2 for stderr.
103 /// @param context The request context.
104 /// @return A future that becomes available when the invocation completes.
105 [[nodiscard]] std::future<void> writeMessageAsync(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;
106
107 /// Writes a message on the server application's stdout or stderr.
108 /// @param message The message to write.
109 /// @param fd 1 for stdout, 2 for stderr.
110 /// @param response The response callback.
111 /// @param exception The exception callback.
112 /// @param sent The sent callback.
113 /// @param context The request context.
114 /// @return A function that can be called to cancel the invocation locally.
115 // NOLINTNEXTLINE(modernize-use-nodiscard)
116 std::function<void()> writeMessageAsync(std::string_view message, std::int32_t fd, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
117
118 /// @private
119 void _iceI_writeMessage(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, std::int32_t, const Ice::Context&) const;
120
121 /// Gets the type ID of the associated Slice interface.
122 /// @return The string `"::Ice::Process"`.
123 static const char* ice_staticId() noexcept;
124
125 /// @private
126 static ProcessPrx _fromReference(IceInternal::ReferencePtr ref) { return ProcessPrx{std::move(ref)}; }
127
128 protected:
129 /// @private
130 ProcessPrx() = default;
131
132 /// @private
133 explicit ProcessPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
134 {
135 }
136 };
137}
138
139namespace Ice
140{
141 /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
142 /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
143 /// @headerfile Ice/Ice.h
144 class ICE_API Process : public virtual Ice::Object
145 {
146 public:
147 /// The associated proxy type.
148 using ProxyType = ProcessPrx;
149
150 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
151 /// @param request The incoming request.
152 /// @param sendResponse The callback to send the response.
153 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
154
155 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
156
157 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
158
159 /// Initiates a graceful shutdown of the server application.
160 /// @param current The Current object of the incoming request.
161 virtual void shutdown(const Ice::Current& current) = 0;
162
163 /// @private
164 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
165
166 /// Writes a message on the server application's stdout or stderr.
167 /// @param message The message to write.
168 /// @param fd 1 for stdout, 2 for stderr.
169 /// @param current The Current object of the incoming request.
170 virtual void writeMessage(std::string message, std::int32_t fd, const Ice::Current& current) = 0;
171
172 /// @private
173 void _iceD_writeMessage(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
174
175 /// Gets the type ID of the associated Slice interface.
176 /// @return The string `"::Ice::Process"`.
177 static const char* ice_staticId() noexcept;
178 };
179
180 /// A shared pointer to a Process.
181 using ProcessPtr = std::shared_ptr<Process>;
182}
183
184// NOLINTEND(modernize-concat-nested-namespaces)
185
186#include <Ice/PopDisableWarnings.h>
187#endif
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:232
std::future< void > writeMessageAsync(std::string_view message, std::int32_t fd, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
std::function< void()> shutdownAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
ProcessPrx(const ProcessPrx &other) noexcept
Copy constructor.
Definition Process.h:42
ProcessPrx & operator=(ProcessPrx &&rhs) noexcept
Move assignment operator.
Definition Process.h:64
std::function< void()> writeMessageAsync(std::string_view message, std::int32_t fd, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
void writeMessage(std::string_view message, std::int32_t fd, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
ProcessPrx(ProcessPrx &&other) noexcept
Move constructor.
Definition Process.h:46
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void shutdown(const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
ProcessPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition Process.h:38
ProcessPrx & operator=(const ProcessPrx &rhs) noexcept
Copy assignment operator.
Definition Process.h:53
std::future< void > shutdownAsync(const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
A server application managed by a locator implementation such as IceGrid hosts a Process object and r...
Definition Process.h:33
Provides typed proxy functions.
Definition Proxy.h:45
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
const Context noExplicitContext
Marker value used to indicate that no explicit request context was passed to a proxy invocation.
std::shared_ptr< Process > ProcessPtr
A shared pointer to a Process.
Definition Process.h:181
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:28
The Ice RPC framework.
Definition SampleEvent.h:59