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