SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
AclDelegate.h
1 #ifndef CBE__delegate__ACLDelegate_h__
2 #define CBE__delegate__ACLDelegate_h__
3 
4 #include "cbe/Types.h"
5 #include "cbe/delegate/Error.h"
6 #include "cbe/util/Context.h"
7 #include "cbe/util/ErrorInfo.h"
8 #include "cbe/util/Exception.h"
9 
10 namespace cbe {
11  namespace delegate {
12 class AclSuccess;
22 class AclDelegate {
23 public:
24  using Success = AclMap;
30  virtual void onAclSuccess(AclMap&& aclMap) = 0;
31 
32  using Error = delegate::Error;
36  virtual void onAclError(Error&& error, cbe::util::Context&& context) = 0;
37 
42  using Base::Base; // Inherit base class' constructors
43  }; // struct ErrorInfo
44 
45 #ifndef CBE_NO_SYNC
51  struct Exception : cbe::util::ExceptionImpl<ErrorInfo> {
52  using Base::Base; // Inherit base class' constructors
53  }; // class struct CloudBackend::GetAclException
54 #endif // #ifndef CBE_NO_SYNC
55 
56  virtual ~AclDelegate();
57 }; // class AclDelegate
58 
68 using AclDelegatePtr = std::shared_ptr<AclDelegate>;
69 
75 #ifdef HAL_INCLUDE
76 class AclSuccess {
77  bool success;
78 public:
79  AclMap aclMap{};
80 
81  AclSuccess();
82  AclSuccess(cbe::DefaultCtor);
83  AclSuccess(AclMap&& aclMap);
89  explicit operator bool() const;
90 }; // class AclSuccess
91 #endif // #ifdef HAL_INCLUDE
92 
93  } // namespace delegate
94 } // namespace cbe
95 #endif //ACLdelegate
Definition: AclDelegate.h:22
virtual void onAclSuccess(AclMap &&aclMap)=0
virtual void onAclError(Error &&error, cbe::util::Context &&context)=0
Definition: Error.h:14
std::shared_ptr< AclDelegate > AclDelegatePtr
Definition: AclDelegate.h:68
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
std::map< cbe::AclGroupId, std::pair< cbe::Permissions, AclScope > > AclMap
ACL map (Access Control List) relating to users and groups.
Definition: Types.h:390
DefaultCtor
Default constructor marker.
Definition: Types.h:204
Definition: AclDelegate.h:41
Definition: Context.h:11
Definition: ErrorInfo.h:27
Definition: Exception.h:38