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