Ice 3.7 C++11 API Reference
Loading...
Searching...
No Matches
FileParser.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4//
5// Ice version 3.7.11
6//
7// <auto-generated>
8//
9// Generated from file `FileParser.ice'
10//
11// Warning: do not edit this file.
12//
13// </auto-generated>
14//
15
16#ifndef __IceGrid_FileParser_h__
17#define __IceGrid_FileParser_h__
18
20#include <Ice/ProxyF.h>
21#include <Ice/ObjectF.h>
22#include <Ice/ValueF.h>
23#include <Ice/Exception.h>
24#include <Ice/LocalObject.h>
25#include <Ice/StreamHelpers.h>
26#include <Ice/Comparable.h>
27#include <Ice/Proxy.h>
28#include <Ice/Object.h>
29#include <Ice/GCObject.h>
30#include <Ice/Value.h>
31#include <Ice/Incoming.h>
32#include <Ice/IncomingAsync.h>
34#include <IceUtil/ScopedArray.h>
35#include <Ice/Optional.h>
37#include <Ice/SlicedDataF.h>
38#include <IceGrid/Admin.h>
40#include <IceGrid/Config.h>
41
42#ifndef ICE_IGNORE_VERSION
43# if ICE_INT_VERSION / 100 != 307
44# error Ice version mismatch!
45# endif
46# if ICE_INT_VERSION % 100 >= 50
47# error Beta header file detected
48# endif
49# if ICE_INT_VERSION % 100 < 11
50# error Ice patch level mismatch!
51# endif
52#endif
53
54#ifndef ICEGRID_API
55# if defined(ICE_STATIC_LIBS)
56# define ICEGRID_API /**/
57# elif defined(ICEGRID_API_EXPORTS)
58# define ICEGRID_API ICE_DECLSPEC_EXPORT
59# else
60# define ICEGRID_API ICE_DECLSPEC_IMPORT
61# endif
62#endif
63
64#ifdef ICE_CPP11_MAPPING // C++11 mapping
65
66namespace IceGrid
67{
68
69class FileParser;
70class FileParserPrx;
71
72}
73
74namespace IceGrid
75{
76
81class ICE_CLASS(ICEGRID_API) ParseException : public ::Ice::UserExceptionHelper<ParseException, ::Ice::UserException>
82{
83public:
84
86
87 ParseException(const ParseException&) = default;
88
89 ParseException() = default;
90
95 ParseException(const ::std::string& reason) :
97 {
98 }
99
104 std::tuple<const ::std::string&> ice_tuple() const
105 {
106 return std::tie(reason);
107 }
108
113 ICE_MEMBER(ICEGRID_API) static const ::std::string& ice_staticId();
114
118 ::std::string reason;
119};
120
122static ParseException _iceS_ParseException_init;
124
125}
126
127namespace IceGrid
128{
129
137{
138public:
139
141
148 virtual bool ice_isA(::std::string id, const ::Ice::Current& current) const override;
149
155 virtual ::std::vector<::std::string> ice_ids(const ::Ice::Current& current) const override;
156
162 virtual ::std::string ice_id(const ::Ice::Current& current) const override;
163
168 static const ::std::string& ice_staticId();
169
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&);
183
185 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&) override;
187};
188
189}
190
191namespace IceGrid
192{
193
200class ICE_CLASS(ICEGRID_API) FileParserPrx : public virtual ::Ice::Proxy<FileParserPrx, ::Ice::ObjectPrx>
201{
202public:
203
213 ApplicationDescriptor parse(const ::std::string& xmlFile, const ::std::shared_ptr<AdminPrx>& adminProxy, const ::Ice::Context& context = ::Ice::noExplicitContext)
214 {
215 return _makePromiseOutgoing<::IceGrid::ApplicationDescriptor>(true, this, &FileParserPrx::_iceI_parse, xmlFile, adminProxy, context).get();
216 }
217
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())
229 {
230 return _makePromiseOutgoing<::IceGrid::ApplicationDescriptor, P>(false, this, &FileParserPrx::_iceI_parse, xmlFile, adminProxy, context);
231 }
232
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,
249 const ::Ice::Context& context = ::Ice::noExplicitContext)
250 {
251 return _makeLambdaOutgoing<::IceGrid::ApplicationDescriptor>(std::move(response), std::move(ex), std::move(sent), this, &IceGrid::FileParserPrx::_iceI_parse, xmlFile, adminProxy, context);
252 }
253
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&);
257
262 ICE_MEMBER(ICEGRID_API) static const ::std::string& ice_staticId();
263
264protected:
265
267 FileParserPrx() = default;
268 friend ::std::shared_ptr<FileParserPrx> IceInternal::createProxy<FileParserPrx>();
269
270 ICE_MEMBER(ICEGRID_API) virtual ::std::shared_ptr<::Ice::ObjectPrx> _newInstance() const override;
272};
273
274}
275
277namespace Ice
278{
279
280template<typename S>
281struct StreamReader<::IceGrid::ParseException, S>
282{
283 static void read(S* istr, ::IceGrid::ParseException& v)
284 {
285 istr->readAll(v.reason);
286 }
287};
288
289}
291
293namespace IceGrid
294{
295
296using FileParserPtr = ::std::shared_ptr<FileParser>;
297using FileParserPrxPtr = ::std::shared_ptr<FileParserPrx>;
298
299}
301
302#else // C++98 mapping
303
304namespace IceProxy
305{
306
307namespace IceGrid
308{
309
310class FileParser;
312ICEGRID_API void _readProxy(::Ice::InputStream*, ::IceInternal::ProxyHandle< FileParser>&);
313ICEGRID_API ::IceProxy::Ice::Object* upCast(FileParser*);
315
316}
317
318}
319
320namespace IceGrid
321{
322
323class FileParser;
325ICEGRID_API ::Ice::Object* upCast(FileParser*);
327typedef ::IceInternal::Handle< FileParser> FileParserPtr;
328typedef ::IceInternal::ProxyHandle< ::IceProxy::IceGrid::FileParser> FileParserPrx;
329typedef FileParserPrx FileParserPrxPtr;
331ICEGRID_API void _icePatchObjectPtr(FileParserPtr&, const ::Ice::ObjectPtr&);
333
334}
335
336namespace IceGrid
337{
338
343class ICEGRID_API ParseException : public ::Ice::UserException
344{
345public:
346
347 ParseException() {}
352 explicit ParseException(const ::std::string& reason);
353
354#ifdef ICE_CPP11_COMPILER
355 ParseException(const ParseException&) = default;
356 virtual ~ParseException();
357#else
358 virtual ~ParseException() throw();
359#endif
360
365 virtual ::std::string ice_id() const;
370 virtual ParseException* ice_clone() const;
374 virtual void ice_throw() const;
375
379 ::std::string reason;
380
381protected:
382
384 virtual void _writeImpl(::Ice::OutputStream*) const;
385 virtual void _readImpl(::Ice::InputStream*);
387};
388
390static ParseException _iceS_ParseException_init;
392
393}
394
396namespace IceAsync
397{
398
399}
401
402namespace IceGrid
403{
404
410class Callback_FileParser_parse_Base : public virtual ::IceInternal::CallbackBase { };
411typedef ::IceUtil::Handle< Callback_FileParser_parse_Base> Callback_FileParser_parsePtr;
412
413}
414
415namespace IceProxy
416{
417
418namespace IceGrid
419{
420
421class ICE_CLASS(ICEGRID_API) FileParser : public virtual ::Ice::Proxy<FileParser, ::IceProxy::Ice::Object>
422{
423public:
424
434 ICE_MEMBER(ICEGRID_API) ::IceGrid::ApplicationDescriptor parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::Context& context = ::Ice::noExplicitContext)
435 {
436 return end_parse(_iceI_begin_parse(xmlFile, adminProxy, context, ::IceInternal::dummyCallback, 0, true));
437 }
438
447 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::Context& context = ::Ice::noExplicitContext)
448 {
449 return _iceI_begin_parse(xmlFile, adminProxy, context, ::IceInternal::dummyCallback, 0);
450 }
451
461 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::Ice::CallbackPtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
462 {
463 return _iceI_begin_parse(xmlFile, adminProxy, ::Ice::noExplicitContext, cb, cookie);
464 }
465
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)
477 {
478 return _iceI_begin_parse(xmlFile, adminProxy, context, cb, cookie);
479 }
480
490 ::Ice::AsyncResultPtr begin_parse(const ::std::string& xmlFile, const ::IceGrid::AdminPrx& adminProxy, const ::IceGrid::Callback_FileParser_parsePtr& cb, const ::Ice::LocalObjectPtr& cookie = 0)
491 {
492 return _iceI_begin_parse(xmlFile, adminProxy, ::Ice::noExplicitContext, cb, cookie);
493 }
494
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)
506 {
507 return _iceI_begin_parse(xmlFile, adminProxy, context, cb, cookie);
508 }
509
516 ICE_MEMBER(ICEGRID_API) ::IceGrid::ApplicationDescriptor end_parse(const ::Ice::AsyncResultPtr& result);
517
518private:
519
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);
521
522public:
523
528 ICE_MEMBER(ICEGRID_API) static const ::std::string& ice_staticId();
529
530protected:
532
533 ICE_MEMBER(ICEGRID_API) virtual ::IceProxy::Ice::Object* _newInstance() const;
535};
536
537}
538
539}
540
541namespace IceGrid
542{
543
550class ICEGRID_API FileParser : public virtual ::Ice::Object
551{
552public:
553
554 typedef FileParserPrx ProxyType;
555 typedef FileParserPtr PointerType;
556
557 virtual ~FileParser();
558
559#ifdef ICE_CPP11_COMPILER
560 FileParser() = default;
561 FileParser(const FileParser&) = default;
562 FileParser& operator=(const FileParser&) = default;
563#endif
564
571 virtual bool ice_isA(const ::std::string& id, const ::Ice::Current& current = ::Ice::emptyCurrent) const;
572
578 virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& current = ::Ice::emptyCurrent) const;
579
585 virtual const ::std::string& ice_id(const ::Ice::Current& current = ::Ice::emptyCurrent) const;
586
591 static const ::std::string& ice_staticId();
592
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&);
606
608 virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&);
610
611protected:
612
614 virtual void _iceWriteImpl(::Ice::OutputStream*) const;
615 virtual void _iceReadImpl(::Ice::InputStream*);
617};
618
620inline bool operator==(const FileParser& lhs, const FileParser& rhs)
621{
622 return static_cast<const ::Ice::Object&>(lhs) == static_cast<const ::Ice::Object&>(rhs);
623}
624
625inline bool operator<(const FileParser& lhs, const FileParser& rhs)
626{
627 return static_cast<const ::Ice::Object&>(lhs) < static_cast<const ::Ice::Object&>(rhs);
628}
630
631}
632
634namespace Ice
635{
636
637template<>
638struct StreamableTraits< ::IceGrid::ParseException>
639{
640 static const StreamHelperCategory helper = StreamHelperCategoryUserException;
641};
642
643template<typename S>
644struct StreamWriter< ::IceGrid::ParseException, S>
645{
646 static void write(S* ostr, const ::IceGrid::ParseException& v)
647 {
648 ostr->write(v.reason);
649 }
650};
651
652template<typename S>
653struct StreamReader< ::IceGrid::ParseException, S>
654{
655 static void read(S* istr, ::IceGrid::ParseException& v)
656 {
657 istr->read(v.reason);
658 }
659};
660
661}
663
664namespace IceGrid
665{
666
672template<class T>
673class CallbackNC_FileParser_parse : public Callback_FileParser_parse_Base, public ::IceInternal::TwowayCallbackNC<T>
674{
675public:
676
677 typedef IceUtil::Handle<T> TPtr;
678
679 typedef void (T::*Exception)(const ::Ice::Exception&);
680 typedef void (T::*Sent)(bool);
681 typedef void (T::*Response)(const ApplicationDescriptor&);
682
683 CallbackNC_FileParser_parse(const TPtr& obj, Response cb, Exception excb, Sent sentcb)
684 : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb)
685 {
686 }
687
689 virtual void completed(const ::Ice::AsyncResultPtr& result) const
690 {
691 FileParserPrx proxy = FileParserPrx::uncheckedCast(result->getProxy());
692 ApplicationDescriptor ret;
693 try
694 {
695 ret = proxy->end_parse(result);
696 }
697 catch(const ::Ice::Exception& ex)
698 {
699 ::IceInternal::CallbackNC<T>::exception(result, ex);
700 return;
701 }
702 if(_response)
703 {
704 (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret);
705 }
706 }
708
709private:
710
711 Response _response;
712};
713
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)
724{
725 return new CallbackNC_FileParser_parse<T>(instance, cb, excb, sentcb);
726}
727
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)
738{
739 return new CallbackNC_FileParser_parse<T>(instance, cb, excb, sentcb);
740}
741
747template<class T, typename CT>
748class Callback_FileParser_parse : public Callback_FileParser_parse_Base, public ::IceInternal::TwowayCallback<T, CT>
749{
750public:
751
752 typedef IceUtil::Handle<T> TPtr;
753
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&);
757
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)
760 {
761 }
762
764 virtual void completed(const ::Ice::AsyncResultPtr& result) const
765 {
766 FileParserPrx proxy = FileParserPrx::uncheckedCast(result->getProxy());
767 ApplicationDescriptor ret;
768 try
769 {
770 ret = proxy->end_parse(result);
771 }
772 catch(const ::Ice::Exception& ex)
773 {
774 ::IceInternal::Callback<T, CT>::exception(result, ex);
775 return;
776 }
777 if(_response)
778 {
779 (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie()));
780 }
781 }
783
784private:
785
786 Response _response;
787};
788
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)
800{
801 return new Callback_FileParser_parse<T, CT>(instance, cb, excb, sentcb);
802}
803
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)
815{
816 return new Callback_FileParser_parse<T, CT>(instance, cb, excb, sentcb);
817}
818
819}
820
821#endif
822
824#endif
#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 &current)=0
Parse a file.
virtual bool ice_isA(::std::string id, const ::Ice::Current &current) 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 &current) 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 &current) 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.
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 Admin.h:73
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