SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
LeaveDelegate.h
1 #ifndef CBE__delegate__LeaveDelegate_h__
2 #define CBE__delegate__LeaveDelegate_h__
3 
4 #include "cbe/QueryResult.h"
5 #include "cbe/Types.h"
6 
7 #include "cbe/delegate/Error.h"
8 
9 #include "cbe/util/Context.h"
10 #include "cbe/util/ErrorInfo.h"
11 #include "cbe/util/Exception.h"
12 
13 #include <memory>
14 
15 namespace cbe {
16  namespace delegate {
17 class LeaveSuccess;
25 public:
26  using Success = LeaveSuccess;
30  virtual void onLeaveSuccess(std::string&& memberName,
31  cbe::MemberId memberId) = 0;
32 
33  using Error = delegate::Error;
37  virtual void onLeaveError(Error&& error, cbe::util::Context&& context) = 0;
38 
43  using Base::Base; // Inherit base class' constructors
44  }; // struct ErrorInfo
45 
46 #ifndef CBE_NO_SYNC
52  struct Exception : cbe::util::ExceptionImpl<ErrorInfo> {
53  using Base::Base; // Inherit base class' constructors
54  }; // class struct CloudBackend::LeaveException
55 #endif // #ifndef CBE_NO_SYNC
56 
57  virtual ~LeaveDelegate();
58 }; // class LeaveDelegate
63 using LeaveDelegatePtr = std::shared_ptr<LeaveDelegate>;
64 class LeaveSuccess {
65 public:
66  std::string memberName{};
67  cbe::MemberId memberId{};
68 
69  LeaveSuccess();
71  LeaveSuccess(std::string&& memberName, cbe::MemberId memberId);
72 
78  explicit operator bool() const;
79 }; // class LeaveSuccess
80  } // namespace delegate
81 } // namespace cbe
82 
83 #endif // !CBE__delegate__LeaveDelegate_h__
Definition: Error.h:14
Definition: LeaveDelegate.h:24
virtual void onLeaveError(Error &&error, cbe::util::Context &&context)=0
virtual void onLeaveSuccess(std::string &&memberName, cbe::MemberId memberId)=0
Definition: LeaveDelegate.h:64
std::shared_ptr< LeaveDelegate > LeaveDelegatePtr
Definition: LeaveDelegate.h:63
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
DefaultCtor
Default constructor marker.
Definition: Types.h:204
std::uint64_t MemberId
Represents the cbe::Group membership id.
Definition: Types.h:92
Definition: LeaveDelegate.h:42
Definition: Context.h:11
Definition: ErrorInfo.h:27
Definition: Exception.h:38