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 < 10
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 // C++11 mapping
106 return std::tie(reason);
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 _makeLamdaOutgoing<::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>();
296 using FileParserPtr = ::std::shared_ptr<FileParser>;
297 using FileParserPrxPtr = ::std::shared_ptr<FileParserPrx>;
302 #else // C++98 mapping
313 ICEGRID_API ::IceProxy::Ice::Object* upCast(FileParser*);
325 ICEGRID_API ::Ice::Object* upCast(FileParser*);
327 typedef ::IceInternal::Handle< FileParser> FileParserPtr;
328 typedef ::IceInternal::ProxyHandle< ::IceProxy::IceGrid::FileParser> FileParserPrx;
329 typedef FileParserPrx FileParserPrxPtr;
331 ICEGRID_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;
390 static ParseException _iceS_ParseException_init;
410 class Callback_FileParser_parse_Base :
public virtual ::IceInternal::CallbackBase { };
411 typedef ::IceUtil::Handle< Callback_FileParser_parse_Base> Callback_FileParser_parsePtr;
421 class 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));
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)
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)
507 return _iceI_begin_parse(xmlFile, adminProxy, context, cb, cookie);
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&);
620 inline bool operator==(
const FileParser& lhs,
const FileParser& rhs)
625 inline bool operator<(
const FileParser& lhs,
const FileParser& rhs)
640 static const StreamHelperCategory helper = StreamHelperCategoryUserException;
646 static void write(S* ostr, const ::IceGrid::ParseException& v)
648 ostr->write(v.reason);
673 class CallbackNC_FileParser_parse :
public Callback_FileParser_parse_Base,
public ::IceInternal::TwowayCallbackNC<T>
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
692 ApplicationDescriptor ret;
695 ret = proxy->end_parse(result);
699 ::IceInternal::CallbackNC<T>::exception(result, ex);
704 (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret);
722 template<
class T> Callback_FileParser_parsePtr
725 return new CallbackNC_FileParser_parse<T>(instance, cb, excb, sentcb);
736 template<
class T> Callback_FileParser_parsePtr
737 newCallback_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);
747 template<
class T,
typename CT>
748 class Callback_FileParser_parse :
public Callback_FileParser_parse_Base,
public ::IceInternal::TwowayCallback<T, 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
767 ApplicationDescriptor ret;
770 ret = proxy->end_parse(result);
774 ::IceInternal::Callback<T, CT>::exception(result, ex);
779 (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie()));
798 template<
class T,
typename CT> Callback_FileParser_parsePtr
799 newCallback_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);
813 template<
class T,
typename CT> Callback_FileParser_parsePtr
814 newCallback_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);