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
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;
181 bool _iceD_parse(::IceInternal::Incoming&, const ::Ice::Current&);
185 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&)
override;
215 return _makePromiseOutgoing<::IceGrid::ApplicationDescriptor>(
true,
this, &FileParserPrx::_iceI_parse, xmlFile, adminProxy, context).get();
226 template<
template<
typename>
class P = ::std::promise>
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,
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>();
296using FileParserPtr = ::std::shared_ptr<FileParser>;
297using FileParserPrxPtr = ::std::shared_ptr<FileParserPrx>;
312ICEGRID_API void _readProxy(::Ice::InputStream*, ::IceInternal::ProxyHandle< FileParser>&);
313ICEGRID_API ::IceProxy::Ice::Object* upCast(
FileParser*);
325ICEGRID_API ::Ice::Object* upCast(
FileParser*);
327typedef ::IceInternal::Handle< FileParser> FileParserPtr;
328typedef ::IceInternal::ProxyHandle< ::IceProxy::IceGrid::FileParser>
FileParserPrx;
331ICEGRID_API void _icePatchObjectPtr(FileParserPtr&, const ::Ice::ObjectPtr&);
352 explicit ParseException(const ::std::string& reason);
354#ifdef ICE_CPP11_COMPILER
355 ParseException(
const ParseException&) =
default;
356 virtual ~ParseException();
358 virtual ~ParseException() throw();
365 virtual ::std::string ice_id()
const;
370 virtual ParseException* ice_clone()
const;
374 virtual void ice_throw()
const;
379 ::std::string reason;
384 virtual void _writeImpl(::Ice::OutputStream*)
const;
385 virtual void _readImpl(::Ice::InputStream*);
410class Callback_FileParser_parse_Base :
public virtual ::IceInternal::CallbackBase { };
411typedef ::IceUtil::Handle< Callback_FileParser_parse_Base> Callback_FileParser_parsePtr;
421class ICE_CLASS(ICEGRID_API) FileParser :
public virtual ::Ice::Proxy<FileParser, ::IceProxy::Ice::Object>
436 return end_parse(_iceI_begin_parse(xmlFile, adminProxy, context, ::IceInternal::dummyCallback, 0,
true));
447 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::Context& context =
::Ice::noExplicitContext)
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);
516 ICE_MEMBER(
ICEGRID_API) ::IceGrid::ApplicationDescriptor end_parse(const ::Ice::AsyncResultPtr& result);
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);
550class ICEGRID_API FileParser :
public virtual ::Ice::Object
554 typedef FileParserPrx ProxyType;
555 typedef FileParserPtr PointerType;
557 virtual ~FileParser();
559#ifdef ICE_CPP11_COMPILER
560 FileParser() =
default;
561 FileParser(
const FileParser&) =
default;
562 FileParser& operator=(
const FileParser&) =
default;
571 virtual bool ice_isA(const ::std::string&
id, const ::Ice::Current& current =
::Ice::emptyCurrent)
const;
578 virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& current =
::Ice::emptyCurrent)
const;
585 virtual const ::std::string& ice_id(const ::Ice::Current& current =
::Ice::emptyCurrent)
const;
591 static const ::std::string& ice_staticId();
602 virtual ApplicationDescriptor parse(const ::std::string& xmlFile,
const AdminPrx& adminProxy, const ::Ice::Current& current =
::Ice::emptyCurrent) = 0;
604 bool _iceD_parse(::IceInternal::Incoming&, const ::Ice::Current&);
608 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&);
614 virtual void _iceWriteImpl(::Ice::OutputStream*)
const;
615 virtual void _iceReadImpl(::Ice::InputStream*);
620inline bool operator==(
const FileParser& lhs,
const FileParser& rhs)
622 return static_cast<const ::Ice::Object&
>(lhs) ==
static_cast<const ::Ice::Object&
>(rhs);
625inline bool operator<(
const FileParser& lhs,
const FileParser& rhs)
627 return static_cast<const ::Ice::Object&
>(lhs) <
static_cast<const ::Ice::Object&
>(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)
673class CallbackNC_FileParser_parse :
public Callback_FileParser_parse_Base,
public ::IceInternal::TwowayCallbackNC<T>
677 typedef IceUtil::Handle<T> TPtr;
679 typedef void (T::*Exception)(const ::Ice::Exception&);
680 typedef void (T::*Sent)(bool);
681 typedef void (T::*Response)(
const ApplicationDescriptor&);
683 CallbackNC_FileParser_parse(
const TPtr& obj, Response cb, Exception excb, Sent sentcb)
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());
692 ApplicationDescriptor ret;
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);
722template<
class T> Callback_FileParser_parsePtr
723newCallback_FileParser_parse(
const IceUtil::Handle<T>& instance,
void (T::*cb)(
const ApplicationDescriptor&),
void (T::*excb)(const ::Ice::Exception&),
void (T::*sentcb)(
bool) = 0)
725 return new CallbackNC_FileParser_parse<T>(instance, cb, excb, sentcb);
736template<
class T> Callback_FileParser_parsePtr
737newCallback_FileParser_parse(T* instance,
void (T::*cb)(
const ApplicationDescriptor&),
void (T::*excb)(const ::Ice::Exception&),
void (T::*sentcb)(
bool) = 0)
739 return new CallbackNC_FileParser_parse<T>(instance, cb, excb, sentcb);
747template<
class T,
typename CT>
748class Callback_FileParser_parse :
public Callback_FileParser_parse_Base,
public ::IceInternal::TwowayCallback<T, CT>
752 typedef IceUtil::Handle<T> TPtr;
754 typedef void (T::*Exception)(const ::Ice::Exception& ,
const CT&);
755 typedef void (T::*Sent)(bool ,
const CT&);
756 typedef void (T::*Response)(
const ApplicationDescriptor&,
const CT&);
758 Callback_FileParser_parse(
const TPtr& obj, Response cb, Exception excb, Sent sentcb)
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());
767 ApplicationDescriptor ret;
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()));
798template<
class T,
typename CT> Callback_FileParser_parsePtr
799newCallback_FileParser_parse(
const IceUtil::Handle<T>& instance,
void (T::*cb)(
const ApplicationDescriptor&,
const CT&),
void (T::*excb)(const ::Ice::Exception&,
const CT&),
void (T::*sentcb)(
bool,
const CT&) = 0)
801 return new Callback_FileParser_parse<T, CT>(instance, cb, excb, sentcb);
813template<
class T,
typename CT> Callback_FileParser_parsePtr
814newCallback_FileParser_parse(T* instance,
void (T::*cb)(
const ApplicationDescriptor&,
const CT&),
void (T::*excb)(const ::Ice::Exception&,
const CT&),
void (T::*sentcb)(
bool,
const CT&) = 0)
816 return new Callback_FileParser_parse<T, CT>(instance, cb, excb, sentcb);
#define ICEGRID_API
Definition Descriptor.h:58
#define ICE_MEMBER(API)
Definition Config.h:177
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:201
auto parseAsync(const ::std::string &xmlFile, const ::std::shared_ptr< AdminPrx > &adminProxy, const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P<::IceGrid::ApplicationDescriptor > >().get_future())
Parse a file.
Definition FileParser.h:227
ApplicationDescriptor parse(const ::std::string &xmlFile, const ::std::shared_ptr< AdminPrx > &adminProxy, const ::Ice::Context &context=::Ice::noExplicitContext)
Parse a file.
Definition FileParser.h:213
::std::function< void()> parseAsync(const ::std::string &xmlFile, const ::std::shared_ptr< AdminPrx > &adminProxy, ::std::function< void(::IceGrid::ApplicationDescriptor)> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
Parse a file.
Definition FileParser.h:245
static const ::std::string & ice_staticId()
Obtains the Slice type ID of this interface.
icegridadmin provides a FileParser object to transform XML files into ApplicationDescriptor objects.
Definition FileParser.h:137
virtual ApplicationDescriptor parse(::std::string xmlFile, ::std::shared_ptr< AdminPrx > adminProxy, const ::Ice::Current ¤t)=0
Parse a file.
virtual bool ice_isA(::std::string id, const ::Ice::Current ¤t) const override
Determines whether this object supports an interface with the given Slice type ID.
virtual ::std::vector<::std::string > ice_ids(const ::Ice::Current ¤t) const override
Obtains a list of the Slice type IDs representing the interfaces supported by this object.
virtual::std::string ice_id(const ::Ice::Current ¤t) const override
Obtains a Slice type ID representing the most-derived interface supported by this object.
FileParserPrx ProxyType
Definition FileParser.h:140
static const ::std::string & ice_staticId()
Obtains the Slice type ID corresponding to this class.
This exception is raised if an error occurs during parsing.
Definition FileParser.h:82
ParseException(const ::std::string &reason)
One-shot constructor to initialize all data members.
Definition FileParser.h:95
::std::string reason
The reason for the failure.
Definition FileParser.h:118
std::tuple< const ::std::string & > ice_tuple() const
Obtains a tuple containing all of the exception's data members.
Definition FileParser.h:104
ParseException(const ParseException &)=default
static const ::std::string & ice_staticId()
Obtains the Slice type ID of this exception.
virtual ~ParseException()
The base class for servants.
Definition Object.h:91
Helper template that supplies proxy factory functions.
Definition Proxy.h:1204
Helper template for the implementation of Ice::UserException.
Definition ExceptionHelpers.h:39
Definition BuiltinSequences.h:56
const Context noExplicitContext
Marker value used to indicate that no explicit context was passed to a proxy invocation.
::std::map<::std::string, ::std::string > Context
A request context.
Definition Current.h:68
const Current emptyCurrent
A default-initialized Current instance.
IceInternal::Handle< LocalObject > LocalObjectPtr
Definition LocalObjectF.h:17
bool operator<(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition Comparable.h:136
bool operator==(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition Comparable.h:184
An application descriptor.
Definition Descriptor.h:534