16#ifndef __IceGrid_FileParser_h__
17#define __IceGrid_FileParser_h__
42#ifndef ICE_IGNORE_VERSION
43# if ICE_INT_VERSION / 100 != 307
44# error Ice version mismatch!
46# if ICE_INT_VERSION % 100 >= 50
47# error Beta header file detected
49# if ICE_INT_VERSION % 100 < 11
50# error Ice patch level mismatch!
55# if defined(ICE_STATIC_LIBS)
57# elif defined(ICEGRID_API_EXPORTS)
58# define ICEGRID_API ICE_DECLSPEC_EXPORT
60# define ICEGRID_API ICE_DECLSPEC_IMPORT
64#ifdef ICE_CPP11_MAPPING
81class ICE_CLASS(ICEGRID_API) ParseException :
public ::Ice::UserExceptionHelper<ParseException, ::Ice::UserException>
87 ParseException(
const ParseException&) =
default;
89 ParseException() =
default;
95 ParseException(const ::std::string& reason) :
104 std::tuple<const ::std::string&> ice_tuple()
const
106 return std::tie(reason);
118 ::std::string reason;
122static ParseException _iceS_ParseException_init;
148 virtual bool ice_isA(::std::string
id, const ::Ice::Current& current)
const override;
155 virtual ::std::vector<::std::string> ice_ids(const ::Ice::Current& current)
const override;
162 virtual ::std::string ice_id(const ::Ice::Current& current)
const override;
168 static const ::std::string& ice_staticId();
179 virtual ApplicationDescriptor parse(::std::string xmlFile, ::std::shared_ptr<AdminPrx> adminProxy, const ::Ice::Current& current) = 0;
181 bool _iceD_parse(::IceInternal::Incoming&, const ::Ice::Current&);
185 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&)
override;
200class ICE_CLASS(ICEGRID_API)
FileParserPrx :
public virtual ::Ice::Proxy<FileParserPrx, ::Ice::ObjectPrx>
213 ApplicationDescriptor parse(const ::std::string& xmlFile, const ::std::shared_ptr<AdminPrx>& adminProxy, const ::Ice::Context& context =
::Ice::noExplicitContext)
215 return _makePromiseOutgoing<::IceGrid::ApplicationDescriptor>(
true,
this, &FileParserPrx::_iceI_parse, xmlFile, adminProxy, context).
get();
226 template<
template<
typename>
class P = ::std::promise>
227 auto parseAsync(const ::std::string& xmlFile, const ::std::shared_ptr<AdminPrx>& adminProxy, const ::Ice::Context& context =
::Ice::noExplicitContext)
228 ->
decltype(::std::declval<P<::IceGrid::ApplicationDescriptor>>().get_future())
230 return _makePromiseOutgoing<::IceGrid::ApplicationDescriptor, P>(
false,
this, &FileParserPrx::_iceI_parse, xmlFile, adminProxy, context);
244 ::std::function<void()>
245 parseAsync(const ::std::string& xmlFile, const ::std::shared_ptr<AdminPrx>& adminProxy,
246 ::std::function<
void(::IceGrid::ApplicationDescriptor)> response,
247 ::std::function<
void(::std::exception_ptr)> ex =
nullptr,
248 ::std::function<
void(
bool)> sent =
nullptr,
251 return _makeLambdaOutgoing<::IceGrid::ApplicationDescriptor>(std::move(response), std::move(ex), std::move(sent),
this, &IceGrid::FileParserPrx::_iceI_parse, xmlFile, adminProxy, context);
255 ICE_MEMBER(
ICEGRID_API)
void _iceI_parse(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceGrid::ApplicationDescriptor>>&, const ::std::string&, const ::std::shared_ptr<AdminPrx>&, const ::Ice::Context&);
268 friend ::std::shared_ptr<FileParserPrx> IceInternal::createProxy<FileParserPrx>();
281struct StreamReader<::IceGrid::ParseException, S>
283 static void read(S* istr, ::IceGrid::ParseException& v)
312ICEGRID_API void _readProxy(::Ice::InputStream*, ::IceInternal::ProxyHandle< FileParser>&);
328typedef ::IceInternal::ProxyHandle< ::IceProxy::IceGrid::FileParser>
FileParserPrx;
354#ifdef ICE_CPP11_COMPILER
436 return end_parse(_iceI_begin_parse(xmlFile, adminProxy, context, ::IceInternal::dummyCallback, 0,
true));
449 return _iceI_begin_parse(xmlFile, adminProxy, context, ::IceInternal::dummyCallback, 0);
461 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::CallbackPtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
476 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::Context& context, const ::Ice::CallbackPtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
478 return _iceI_begin_parse(xmlFile, adminProxy, context, cb, cookie);
490 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::IceGrid::Callback_FileParser_parsePtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
505 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::Context& context, const ::IceGrid::Callback_FileParser_parsePtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
507 return _iceI_begin_parse(xmlFile, adminProxy, context, cb, cookie);
520 ICE_MEMBER(
ICEGRID_API) ::
Ice::AsyncResultPtr _iceI_begin_parse(const ::std::string&, const ::
IceGrid::AdminPrx&, const ::
Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::
Ice::LocalObjectPtr& cookie = 0, bool sync = false);
559#ifdef ICE_CPP11_COMPILER
604 bool _iceD_parse(::IceInternal::Incoming&, const ::Ice::Current&);
608 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&);
625inline bool operator<(
const FileParser& lhs,
const FileParser& rhs)
638struct StreamableTraits< ::IceGrid::ParseException>
640 static const StreamHelperCategory helper = StreamHelperCategoryUserException;
644struct StreamWriter< ::IceGrid::ParseException, S>
646 static void write(S* ostr, const ::IceGrid::ParseException& v)
648 ostr->write(v.reason);
653struct StreamReader< ::IceGrid::ParseException, S>
655 static void read(S* istr, ::IceGrid::ParseException& v)
684 : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb)
689 virtual void completed(const ::Ice::AsyncResultPtr& result)
const
691 FileParserPrx proxy = FileParserPrx::uncheckedCast(result->getProxy());
695 ret = proxy->end_parse(result);
697 catch(const ::Ice::Exception& ex)
699 ::IceInternal::CallbackNC<T>::exception(result, ex);
704 (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret);
736template<
class T> Callback_FileParser_parsePtr
747template<
class T,
typename CT>
754 typedef void (T::*
Exception)(const ::Ice::Exception& ,
const CT&);
755 typedef void (T::*
Sent)(bool ,
const CT&);
759 : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb)
764 virtual void completed(const ::Ice::AsyncResultPtr& result)
const
766 FileParserPrx proxy = FileParserPrx::uncheckedCast(result->getProxy());
770 ret = proxy->end_parse(result);
772 catch(const ::Ice::Exception& ex)
774 ::IceInternal::Callback<T, CT>::exception(result, ex);
779 (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie()));
813template<
class T,
typename CT> Callback_FileParser_parsePtr
#define ICEGRID_API
Definition Descriptor.h:58
#define ICE_MEMBER(API)
Definition Config.h:177
Type-safe asynchronous callback wrapper class used for calls to IceProxy::IceGrid::FileParser::begin_...
Definition FileParser.h:674
void(T::* Sent)(bool)
Definition FileParser.h:680
void(T::* Exception)(const ::Ice::Exception &)
Definition FileParser.h:679
CallbackNC_FileParser_parse(const TPtr &obj, Response cb, Exception excb, Sent sentcb)
Definition FileParser.h:683
void(T::* Response)(const ApplicationDescriptor &)
Definition FileParser.h:681
IceUtil::Handle< T > TPtr
Definition FileParser.h:677
Base class for asynchronous callback wrapper classes used for calls to IceProxy::IceGrid::FileParser:...
Definition FileParser.h:410
Type-safe asynchronous callback wrapper class with cookie support used for calls to IceProxy::IceGrid...
Definition FileParser.h:749
void(T::* Exception)(const ::Ice::Exception &, const CT &)
Definition FileParser.h:754
void(T::* Sent)(bool, const CT &)
Definition FileParser.h:755
Callback_FileParser_parse(const TPtr &obj, Response cb, Exception excb, Sent sentcb)
Definition FileParser.h:758
IceUtil::Handle< T > TPtr
Definition FileParser.h:752
void(T::* Response)(const ApplicationDescriptor &, const CT &)
Definition FileParser.h:756
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:551
virtual ApplicationDescriptor parse(const ::std::string &xmlFile, const AdminPrx &adminProxy, const ::Ice::Current ¤t=::Ice::emptyCurrent)=0
Parse a file.
virtual const ::std::string & ice_id(const ::Ice::Current ¤t=::Ice::emptyCurrent) const
Obtains a Slice type ID representing the most-derived interface supported by this object.
virtual ::std::vector< ::std::string > ice_ids(const ::Ice::Current ¤t=::Ice::emptyCurrent) const
Obtains a list of the Slice type IDs representing the interfaces supported by this object.
FileParserPtr PointerType
Definition FileParser.h:555
static const ::std::string & ice_staticId()
Obtains the Slice type ID corresponding to this class.
virtual bool ice_isA(const ::std::string &id, const ::Ice::Current ¤t=::Ice::emptyCurrent) const
Determines whether this object supports an interface with the given Slice type ID.
FileParserPrx ProxyType
Definition FileParser.h:554
This exception is raised if an error occurs during parsing.
Definition FileParser.h:344
ParseException(const ::std::string &reason)
One-shot constructor to initialize all data members.
virtual void ice_throw() const
Throws this exception.
::std::string reason
The reason for the failure.
Definition FileParser.h:379
virtual ParseException * ice_clone() const
Polymorphically clones this exception.
ParseException()
Definition FileParser.h:347
virtual ~ParseException()
virtual::std::string ice_id() const
Obtains the Slice type ID of this exception.
Definition FileParser.h:422
::Ice::AsyncResultPtr begin_parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::IceGrid::Callback_FileParser_parsePtr &cb, const ::Ice::LocalObjectPtr &cookie=0)
Parse a file.
Definition FileParser.h:490
::Ice::AsyncResultPtr begin_parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::Ice::Context &context=::Ice::noExplicitContext)
Parse a file.
Definition FileParser.h:447
::IceGrid::ApplicationDescriptor parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::Ice::Context &context=::Ice::noExplicitContext)
Parse a file.
Definition FileParser.h:434
::Ice::AsyncResultPtr begin_parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::Ice::CallbackPtr &cb, const ::Ice::LocalObjectPtr &cookie=0)
Parse a file.
Definition FileParser.h:461
::Ice::AsyncResultPtr begin_parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::Ice::Context &context, const ::IceGrid::Callback_FileParser_parsePtr &cb, const ::Ice::LocalObjectPtr &cookie=0)
Parse a file.
Definition FileParser.h:505
static const ::std::string & ice_staticId()
Obtains the Slice type ID corresponding to this interface.
::IceGrid::ApplicationDescriptor end_parse(const ::Ice::AsyncResultPtr &result)
Completes an invocation of begin_parse.
::Ice::AsyncResultPtr begin_parse(const ::std::string &xmlFile, const ::IceGrid::AdminPrx &adminProxy, const ::Ice::Context &context, const ::Ice::CallbackPtr &cb, const ::Ice::LocalObjectPtr &cookie=0)
Parse a file.
Definition FileParser.h:476
T * get() const
Definition Handle.h:25
Shared & operator=(const Shared &)
Definition Shared.h:94
The base class for servants.
Definition Object.h:193
Interface for output streams used to create a sequence of bytes from Slice types.
Definition OutputStream.h:28
Helper template that supplies proxy factory functions.
Definition Proxy.h:2904
Base class for all Ice user exceptions.
Definition Exception.h:68
::IceUtil::Handle< Callback_FileParser_parse_Base > Callback_FileParser_parsePtr
Definition FileParser.h:411
::IceInternal::Handle< FileParser > FileParserPtr
Definition FileParser.h:327
::IceInternal::ProxyHandle< ::IceProxy::IceGrid::FileParser > FileParserPrx
Definition FileParser.h:328
::IceInternal::ProxyHandle< ::IceProxy::IceGrid::Admin > AdminPrx
Definition Admin.h:7211
Callback_FileParser_parsePtr newCallback_FileParser_parse(const IceUtil::Handle< T > &instance, void(T::*cb)(const ApplicationDescriptor &), void(T::*excb)(const ::Ice::Exception &), void(T::*sentcb)(bool)=0)
Creates a callback wrapper instance that delegates to your object.
Definition FileParser.h:723
FileParserPrx FileParserPrxPtr
Definition FileParser.h:329
Definition BuiltinSequences.h:113
const Context noExplicitContext
Marker value used to indicate that no explicit context was passed to a proxy invocation.
Definition ProxyHandle.h:51
const Current emptyCurrent
A default-initialized Current instance.
IceInternal::Handle< AsyncResult > AsyncResultPtr
Definition AsyncResultF.h:18
IceUtil::Shared * upCast(::Ice::AsyncResult *)
An application descriptor.
Definition Descriptor.h:2948