Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
FileParser.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.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 / 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 < 0
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. It accepts:
108 /// - The application descriptor.
109 /// @param exception The exception callback.
110 /// @param sent The sent callback.
111 /// @param context The request context.
112 /// @return A function that can be called to cancel the invocation locally.
113 // NOLINTNEXTLINE(modernize-use-nodiscard)
114 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;
115
116 /// @private
117 void _iceI_parse(const std::shared_ptr<IceInternal::OutgoingAsyncT<ApplicationDescriptor>>&, std::string_view, const std::optional<AdminPrx>&, const Ice::Context&) const;
118
119 /// Gets the type ID of the associated Slice interface.
120 /// @return The string `"::IceGrid::FileParser"`.
121 static const char* ice_staticId() noexcept;
122
123 /// @private
124 static FileParserPrx _fromReference(IceInternal::ReferencePtr ref) { return FileParserPrx{std::move(ref)}; }
125
126 protected:
127 /// @private
128 FileParserPrx() = default;
129
130 /// @private
131 explicit FileParserPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
132 {
133 }
134 };
135}
136
137namespace IceGrid
138{
139 /// The exception that is thrown when an error occurs during the parsing of an IceGrid XML file.
140 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceGrid::ParseException`.
141 /// @headerfile IceGrid/IceGrid.h
142 class ICEGRID_API ParseException : public Ice::UserException
143 {
144 public:
145 /// Default constructor.
146 ParseException() noexcept = default;
147
148 /// One-shot constructor to initialize all data members.
149 /// @param reason The reason for the failure.
150 ParseException(std::string reason) noexcept :
151 reason(std::move(reason))
152 {
153 }
154
155 /// Copy constructor.
156 ParseException(const ParseException&) noexcept = default;
157
158 /// Creates a tuple with all the fields of this exception.
159 /// @return A tuple with all the fields of this exception.
160 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
161 {
162 return std::tie(reason);
163 }
164
165 void ice_printFields(std::ostream& os) const override;
166 /// Gets the type ID of the associated Slice exception.
167 /// @return The string `"::IceGrid::ParseException"`.
168 static const char* ice_staticId() noexcept;
169
170 [[nodiscard]] const char* ice_id() const noexcept override;
171
172 void ice_throw() const override;
173
174 /// The reason for the failure.
175 std::string reason;
176
177 protected:
178 /// @private
179 void _writeImpl(Ice::OutputStream*) const override;
180
181 /// @private
182 void _readImpl(Ice::InputStream*) override;
183 };
184}
185
186namespace IceGrid
187{
188 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
189 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::FileParser`.
190 /// @headerfile IceGrid/IceGrid.h
191 class ICEGRID_API FileParser : public virtual Ice::Object
192 {
193 public:
194 /// The associated proxy type.
195 using ProxyType = FileParserPrx;
196
197 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
198 /// @param request The incoming request.
199 /// @param sendResponse The callback to send the response.
200 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
201
202 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
203
204 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
205
206 /// Parses a file.
207 /// @param xmlFile The full path to the file.
208 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
209 /// @param current The Current object of the incoming request.
210 /// @return The application descriptor.
211 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
212 virtual ApplicationDescriptor parse(std::string xmlFile, std::optional<AdminPrx> adminProxy, const Ice::Current& current) = 0;
213
214 /// @private
215 void _iceD_parse(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
216
217 /// Gets the type ID of the associated Slice interface.
218 /// @return The string `"::IceGrid::FileParser"`.
219 static const char* ice_staticId() noexcept;
220 };
221
222 /// A shared pointer to a FileParser.
223 using FileParserPtr = std::shared_ptr<FileParser>;
224}
225
226namespace IceGrid
227{
228 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
229 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::FileParser`.
230 /// @headerfile IceGrid/IceGrid.h
231 class ICEGRID_API AsyncFileParser : public virtual Ice::Object
232 {
233 public:
234 /// The associated proxy type.
236
237 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
238 /// @param request The incoming request.
239 /// @param sendResponse The callback to send the response.
240 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
241
242 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
243
244 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
245
246 /// Parses a file.
247 /// @param xmlFile The full path to the file.
248 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
249 /// @param response The response callback. It accepts:
250 /// - The application descriptor.
251 /// @param exception The exception callback.
252 /// @param current The Current object of the incoming request.
253 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
254 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;
255
256 /// @private
257 void _iceD_parse(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
258
259 /// Gets the type ID of the associated Slice interface.
260 /// @return The string `"::IceGrid::FileParser"`.
261 static const char* ice_staticId() noexcept;
262 };
263
264 /// A shared pointer to an AsyncFileParser.
265 using AsyncFileParserPtr = std::shared_ptr<AsyncFileParser>;
266}
267
268// NOLINTEND(modernize-concat-nested-namespaces)
269
270#include <Ice/PopDisableWarnings.h>
271#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:235
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:232
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:175
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:160
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:232
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:45
Abstract base class for all exceptions defined in Slice.
std::shared_ptr< FileParser > FileParserPtr
A shared pointer to a FileParser.
Definition FileParser.h:223
std::shared_ptr< AsyncFileParser > AsyncFileParserPtr
A shared pointer to an AsyncFileParser.
Definition FileParser.h:265
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