Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
FileParser.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.3
4// <auto-generated>Generated from Slice file 'FileParser.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceGrid_FileParser_h_
8#define IceGrid_FileParser_h_
9
11#include <Ice/Ice.h>
12#include "Admin.h"
13#include <IceGrid/Config.h>
14
15#ifndef ICE_DISABLE_VERSION
16# if ICE_INT_VERSION / 100 != 308
17# error Ice version mismatch!
18# endif
19# if ICE_INT_VERSION % 100 >= 50
20# error Beta header file detected
21# endif
22# if ICE_INT_VERSION % 100 < 3
23# error Ice patch level mismatch!
24# endif
25#endif
26
27#ifndef ICEGRID_API
28# if defined(ICEGRID_API_EXPORTS)
29# define ICEGRID_API ICE_DECLSPEC_EXPORT
30# else
31# define ICEGRID_API ICE_DECLSPEC_IMPORT
32# endif
33#endif
34
35// NOLINTBEGIN(modernize-concat-nested-namespaces)
36
37namespace IceGrid
38{
39 class FileParserPrx;
40}
41
42namespace IceGrid
43{
44 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
45 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceGrid::FileParser`.
46 /// @headerfile IceGrid/IceGrid.h
47 class ICEGRID_API FileParserPrx : public Ice::Proxy<FileParserPrx, Ice::ObjectPrx>
48 {
49 public:
50 /// Constructs a proxy from a Communicator and a proxy string.
51 /// @param communicator The communicator of the new proxy.
52 /// @param proxyString The proxy string to parse.
53 FileParserPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
54
55 /// Copy constructor. Constructs with a copy of the contents of @p other.
56 /// @param other The proxy to copy from.
57 FileParserPrx(const FileParserPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
58
59 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
60 /// @param other The proxy to move from.
61 FileParserPrx(FileParserPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
62
63 ~FileParserPrx() override;
64
65 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
66 /// @param rhs The proxy to copy from.
67 /// @return A reference to this proxy.
69 {
70 if (this != &rhs)
71 {
73 }
74 return *this;
75 }
76
77 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
78 /// @param rhs The proxy to move from.
80 {
81 if (this != &rhs)
82 {
83 Ice::ObjectPrx::operator=(std::move(rhs));
84 }
85 return *this;
86 }
87
88 /// Parses a file.
89 /// @param xmlFile The full path to the file.
90 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
91 /// @param context The request context.
92 /// @return The application descriptor.
93 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
94 ApplicationDescriptor parse(std::string_view xmlFile, const std::optional<AdminPrx>& adminProxy, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
95
96 /// Parses a file.
97 /// @param xmlFile The full path to the file.
98 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
99 /// @param context The request context.
100 /// @return A future that becomes available when the invocation completes. This future holds:
101 /// - The application descriptor.
102 [[nodiscard]] std::future<ApplicationDescriptor> parseAsync(std::string_view xmlFile, const std::optional<AdminPrx>& adminProxy, const Ice::Context& context = Ice::noExplicitContext) const;
103
104 /// Parses a file.
105 /// @param xmlFile The full path to the file.
106 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
107 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
108 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
109 /// function. It accepts:
110 /// - The application descriptor.
111 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
112 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
113 /// function.
114 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
115 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
116 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
117 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
118 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
119 /// asynchronous case.
120 /// @param context The request context.
121 /// @return A function that can be called to cancel the invocation locally.
122 // NOLINTNEXTLINE(modernize-use-nodiscard)
123 std::function<void()> parseAsync(std::string_view xmlFile, const std::optional<AdminPrx>& adminProxy, std::function<void(::IceGrid::ApplicationDescriptor)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
124
125 /// @private
126 void _iceI_parse(const std::shared_ptr<IceInternal::OutgoingAsyncT<ApplicationDescriptor>>&, std::string_view, const std::optional<AdminPrx>&, const Ice::Context&) const;
127
128 /// Gets the type ID of the associated Slice interface.
129 /// @return The string `"::IceGrid::FileParser"`.
130 static const char* ice_staticId() noexcept;
131
132 /// @private
133 static FileParserPrx _fromReference(IceInternal::ReferencePtr ref) { return FileParserPrx{std::move(ref)}; }
134
135 protected:
136 /// @private
137 FileParserPrx() = default;
138
139 /// @private
140 explicit FileParserPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
141 {
142 }
143 };
144}
145
146namespace IceGrid
147{
148 /// The exception that is thrown when an error occurs during the parsing of an IceGrid XML file.
149 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceGrid::ParseException`.
150 /// @headerfile IceGrid/IceGrid.h
151 class ICEGRID_API ParseException : public Ice::UserException
152 {
153 public:
154 /// Default constructor.
155 ParseException() noexcept = default;
156
157 /// One-shot constructor to initialize all data members.
158 /// @param reason The reason for the failure.
159 ParseException(std::string reason) noexcept :
160 reason(std::move(reason))
161 {
162 }
163
164 /// Copy constructor.
165 ParseException(const ParseException&) noexcept = default;
166
167 /// Creates a tuple with all the fields of this exception.
168 /// @return A tuple with all the fields of this exception.
169 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
170 {
171 return std::tie(reason);
172 }
173
174 void ice_printFields(std::ostream& os) const override;
175 /// Gets the type ID of the associated Slice exception.
176 /// @return The string `"::IceGrid::ParseException"`.
177 static const char* ice_staticId() noexcept;
178
179 [[nodiscard]] const char* ice_id() const noexcept override;
180
181 void ice_throw() const override;
182
183 /// The reason for the failure.
184 std::string reason;
185
186 protected:
187 /// @private
188 void _writeImpl(Ice::OutputStream*) const override;
189
190 /// @private
191 void _readImpl(Ice::InputStream*) override;
192 };
193}
194
195namespace IceGrid
196{
197 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
198 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::FileParser`.
199 /// @headerfile IceGrid/IceGrid.h
200 class ICEGRID_API FileParser : public virtual Ice::Object
201 {
202 public:
203 /// The associated proxy type.
204 using ProxyType = FileParserPrx;
205
206 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
207 /// @param request The incoming request.
208 /// @param sendResponse The callback to send the response.
209 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
210
211 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
212
213 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
214
215 /// Parses a file.
216 /// @param xmlFile The full path to the file.
217 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
218 /// @param current The Current object of the incoming request.
219 /// @return The application descriptor.
220 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
221 virtual ApplicationDescriptor parse(std::string xmlFile, std::optional<AdminPrx> adminProxy, const Ice::Current& current) = 0;
222
223 /// @private
224 void _iceD_parse(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
225
226 /// Gets the type ID of the associated Slice interface.
227 /// @return The string `"::IceGrid::FileParser"`.
228 static const char* ice_staticId() noexcept;
229 };
230
231 /// A shared pointer to a FileParser.
232 using FileParserPtr = std::shared_ptr<FileParser>;
233}
234
235namespace IceGrid
236{
237 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
238 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::FileParser`.
239 /// @headerfile IceGrid/IceGrid.h
240 class ICEGRID_API AsyncFileParser : public virtual Ice::Object
241 {
242 public:
243 /// The associated proxy type.
245
246 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
247 /// @param request The incoming request.
248 /// @param sendResponse The callback to send the response.
249 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
250
251 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
252
253 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
254
255 /// Parses a file.
256 /// @param xmlFile The full path to the file.
257 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
258 /// @param response The response callback. It accepts:
259 /// - The application descriptor.
260 /// @param exception The exception callback.
261 /// @param current The Current object of the incoming request.
262 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
263 virtual void parseAsync(std::string xmlFile, std::optional<AdminPrx> adminProxy, std::function<void(const ApplicationDescriptor& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
264
265 /// @private
266 void _iceD_parse(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
267
268 /// Gets the type ID of the associated Slice interface.
269 /// @return The string `"::IceGrid::FileParser"`.
270 static const char* ice_staticId() noexcept;
271 };
272
273 /// A shared pointer to an AsyncFileParser.
274 using AsyncFileParserPtr = std::shared_ptr<AsyncFileParser>;
275}
276
277// NOLINTEND(modernize-concat-nested-namespaces)
278
279#include <Ice/PopDisableWarnings.h>
280#endif
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
FileParserPrx ProxyType
The associated proxy type.
Definition FileParser.h:244
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
virtual void parseAsync(std::string xmlFile, std::optional< AdminPrx > adminProxy, std::function< void(const ApplicationDescriptor &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Parses a file.
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:241
FileParserPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition FileParser.h:53
FileParserPrx & operator=(FileParserPrx &&rhs) noexcept
Move assignment operator.
Definition FileParser.h:79
FileParserPrx & operator=(const FileParserPrx &rhs) noexcept
Copy assignment operator.
Definition FileParser.h:68
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::future< ApplicationDescriptor > parseAsync(std::string_view xmlFile, const std::optional< AdminPrx > &adminProxy, const Ice::Context &context=Ice::noExplicitContext) const
Parses a file.
std::function< void()> parseAsync(std::string_view xmlFile, const std::optional< AdminPrx > &adminProxy, std::function< void(::IceGrid::ApplicationDescriptor)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Parses a file.
FileParserPrx(FileParserPrx &&other) noexcept
Move constructor.
Definition FileParser.h:61
ApplicationDescriptor parse(std::string_view xmlFile, const std::optional< AdminPrx > &adminProxy, const Ice::Context &context=Ice::noExplicitContext) const
Parses a file.
FileParserPrx(const FileParserPrx &other) noexcept
Copy constructor.
Definition FileParser.h:57
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:48
std::string reason
The reason for the failure.
Definition FileParser.h:184
ParseException() noexcept=default
Default constructor.
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
ParseException(const ParseException &) noexcept=default
Copy constructor.
std::tuple< const std::string & > ice_tuple() const
Creates a tuple with all the fields of this exception.
Definition FileParser.h:169
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:265
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:48
Abstract base class for all exceptions defined in Slice.
std::shared_ptr< FileParser > FileParserPtr
A shared pointer to a FileParser.
Definition FileParser.h:232
std::shared_ptr< AsyncFileParser > AsyncFileParserPtr
A shared pointer to an AsyncFileParser.
Definition FileParser.h:274
Deploy and manage Ice servers.
Definition Admin.h:40
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::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:34
The Ice RPC framework.
Definition SampleEvent.h:66
Describes an application.
Provides information about an incoming request being dispatched.
Definition Current.h:18