Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
FileParser.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.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 != 30850
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 /// @headerfile IceGrid/IceGrid.h
40 class ICEGRID_API FileParserPrx : public Ice::Proxy<FileParserPrx, Ice::ObjectPrx>
41 {
42 public:
43 /// Constructs a proxy from a Communicator and a proxy string.
44 /// @param communicator The communicator of the new proxy.
45 /// @param proxyString The proxy string to parse.
46 FileParserPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
47
48 /// Copy constructor. Constructs with a copy of the contents of @p other.
49 /// @param other The proxy to copy from.
50 FileParserPrx(const FileParserPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
51
52 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
53 /// @param other The proxy to move from.
54 FileParserPrx(FileParserPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
55
56 ~FileParserPrx() override;
57
58 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
59 /// @param rhs The proxy to copy from.
60 /// @return A reference to this proxy.
62 {
63 if (this != &rhs)
64 {
66 }
67 return *this;
68 }
69
70 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
71 /// @param rhs The proxy to move from.
73 {
74 if (this != &rhs)
75 {
76 Ice::ObjectPrx::operator=(std::move(rhs));
77 }
78 return *this;
79 }
80
81 /// Parses a file.
82 /// @param xmlFile The full path to the file.
83 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
84 /// @param context The request context.
85 /// @return The application descriptor.
86 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
87 ApplicationDescriptor parse(std::string_view xmlFile, const std::optional<AdminPrx>& adminProxy, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
88
89 /// Parses a file.
90 /// @param xmlFile The full path to the file.
91 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
92 /// @param context The request context.
93 /// @return A future that becomes available when the invocation completes. This future holds:
94 /// - The application descriptor.
95 [[nodiscard]] std::future<ApplicationDescriptor> parseAsync(std::string_view xmlFile, const std::optional<AdminPrx>& adminProxy, const Ice::Context& context = Ice::noExplicitContext) const;
96
97 /// Parses a file.
98 /// @param xmlFile The full path to the file.
99 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
100 /// @param response The response callback. It accepts:
101 /// - The application descriptor.
102 /// @param exception The exception callback.
103 /// @param sent The sent callback.
104 /// @param context The request context.
105 /// @return A function that can be called to cancel the invocation locally.
106 // NOLINTNEXTLINE(modernize-use-nodiscard)
107 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;
108
109 /// @private
110 void _iceI_parse(const std::shared_ptr<IceInternal::OutgoingAsyncT<ApplicationDescriptor>>&, std::string_view, const std::optional<AdminPrx>&, const Ice::Context&) const;
111
112 /// Gets the type ID of the associated Slice interface.
113 /// @return The string `"::IceGrid::FileParser"`.
114 static const char* ice_staticId() noexcept;
115
116 /// @private
117 static FileParserPrx _fromReference(IceInternal::ReferencePtr ref) { return FileParserPrx{std::move(ref)}; }
118
119 protected:
120 /// @private
121 FileParserPrx() = default;
122
123 /// @private
124 explicit FileParserPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
125 {
126 }
127 };
128}
129
130namespace IceGrid
131{
132 /// The exception that is thrown when an error occurs during the parsing of an IceGrid XML file.
133 /// @headerfile IceGrid/IceGrid.h
134 class ICEGRID_API ParseException : public Ice::UserException
135 {
136 public:
137 /// Default constructor.
138 ParseException() noexcept = default;
139
140 /// One-shot constructor to initialize all data members.
141 /// @param reason The reason for the failure.
142 ParseException(std::string reason) noexcept :
143 reason(std::move(reason))
144 {
145 }
146
147 /// Copy constructor.
148 ParseException(const ParseException&) noexcept = default;
149
150 /// Creates a tuple with all the fields of this exception.
151 /// @return A tuple with all the fields of this exception.
152 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
153 {
154 return std::tie(reason);
155 }
156
157 void ice_printFields(std::ostream& os) const override;
158 /// Gets the type ID of the associated Slice exception.
159 /// @return The string `"::IceGrid::ParseException"`.
160 static const char* ice_staticId() noexcept;
161
162 [[nodiscard]] const char* ice_id() const noexcept override;
163
164 void ice_throw() const override;
165
166 /// The reason for the failure.
167 std::string reason;
168
169 protected:
170 /// @private
171 void _writeImpl(Ice::OutputStream*) const override;
172
173 /// @private
174 void _readImpl(Ice::InputStream*) override;
175 };
176}
177
178namespace IceGrid
179{
180 /// `icegridadmin` provides a `FileParser` object to transform XML files into ApplicationDescriptor objects.
181 /// @headerfile IceGrid/IceGrid.h
182 class ICEGRID_API FileParser : public virtual Ice::Object
183 {
184 public:
185 /// The associated proxy type.
186 using ProxyType = FileParserPrx;
187
188 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
189 /// @param request The incoming request.
190 /// @param sendResponse The callback to send the response.
191 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
192
193 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
194
195 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
196
197 /// Parses a file.
198 /// @param xmlFile The full path to the file.
199 /// @param adminProxy An ::IceGrid::AdminPrx proxy, used only to retrieve default templates when needed. May be null.
200 /// @param current The Current object of the incoming request.
201 /// @return The application descriptor.
202 /// @throws IceGrid::ParseException Thrown when an error occurs during parsing.
203 virtual ApplicationDescriptor parse(std::string xmlFile, std::optional<AdminPrx> adminProxy, const Ice::Current& current) = 0;
204
205 /// @private
206 void _iceD_parse(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
207
208 /// Gets the type ID of the associated Slice interface.
209 /// @return The string `"::IceGrid::FileParser"`.
210 static const char* ice_staticId() noexcept;
211 };
212
213 /// A shared pointer to a FileParser.
214 using FileParserPtr = std::shared_ptr<FileParser>;
215}
216
217// NOLINTEND(modernize-concat-nested-namespaces)
218
220#endif
FileParserPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition FileParser.h:46
FileParserPrx & operator=(FileParserPrx &&rhs) noexcept
Move assignment operator.
Definition FileParser.h:72
FileParserPrx & operator=(const FileParserPrx &rhs) noexcept
Copy assignment operator.
Definition FileParser.h:61
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:54
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:50
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:41
std::string reason
The reason for the failure.
Definition FileParser.h:167
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:152
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 Ice exceptions defined in Slice.
std::shared_ptr< FileParser > FileParserPtr
A shared pointer to a FileParser.
Definition FileParser.h:214
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:59
Describes an application.
Provides information about an incoming request being dispatched.
Definition Current.h:18