SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
UnSubscribeDelegate.h
1 #ifndef CBE__delegate__UnSubscribeDelegate_h__
2 #define CBE__delegate__UnSubscribeDelegate_h__
3 
4 #include "cbe/Types.h"
5 #include "cbe/util/Context.h"
6 #include "cbe/delegate/Error.h"
7 #include "cbe/util/ErrorInfo.h"
8 #include "cbe/util/Exception.h"
9 
10 namespace cbe {
11  namespace delegate {
12 class UnSubscribeSuccess;
21 public:
28  virtual void onUnSubscribeSuccess(cbe::PublishId publishId,
29  cbe::ItemId itemId) = 0;
30 
31  using Error = delegate::Error;
35  virtual void onUnSubscribeError(Error&& error,
36  cbe::util::Context&& context) = 0;
37 
42  using Base::Base; // Inherit base class' constructors
43  }; // struct ErrorInfo
44 
45 #ifndef CBE_NO_SYNC
54  struct Exception : cbe::util::ExceptionImpl<ErrorInfo> {
55  using Base::Base; // Inherit base class' constructors
56  }; // class struct CloudBackend::UnSubscribeException
57 #endif // #ifndef CBE_NO_SYNC
58 
59  virtual ~UnSubscribeDelegate();
60 }; // class UnSubscribeDelegate
61 
69 using UnSubscribeDelegatePtr = std::shared_ptr<UnSubscribeDelegate>;
70 
77 public:
78  cbe::PublishId publishId{};
79  cbe::ItemId itemId{};
80 
83  cbe::ItemId itemId);
89  explicit operator bool() const;
90 };
91  } // namespace delegate
92 } // namespace cbe
93 
94 #endif // #ifndef CBE__delegate__UnSubscribeDelegate_h__
Definition: Error.h:14
Definition: UnSubscribeDelegate.h:20
virtual void onUnSubscribeError(Error &&error, cbe::util::Context &&context)=0
virtual void onUnSubscribeSuccess(cbe::PublishId publishId, cbe::ItemId itemId)=0
Convenience type that bundles all parameters passed to method cbe::delegate::UnSubscribeDelegate::onU...
Definition: UnSubscribeDelegate.h:76
std::shared_ptr< UnSubscribeDelegate > UnSubscribeDelegatePtr
Definition: UnSubscribeDelegate.h:69
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
std::uint64_t ItemId
Id of a cbe::Container or cbe::Object.
Definition: Types.h:88
std::uint64_t PublishId
Id of a subscribed cbe::Container or cbe::Object.
Definition: Types.h:104
Definition: UnSubscribeDelegate.h:41
Definition: Context.h:11
Definition: ErrorInfo.h:27
Definition: Exception.h:38