SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
Item.h
1 /*
2  Copyright © CloudBackend AB 2020-2023.
3 */
4 
5 #ifndef INCLUDE_CBE_ITEM_H_
6 #define INCLUDE_CBE_ITEM_H_
7 
8 #include <thread>
9 #include <mutex>
10 #include <map>
11 #include <string>
12 #include <vector>
13 #include "cbe/Types.h"
14 #include "cbe/Utility.h"
15 
16 namespace CBI {
17 class Item;
18 using ItemPtr = std::shared_ptr<CBI::Item>;
19 class ItemEventProtocol;
20 using ItemDelegatePtr = std::shared_ptr<ItemEventProtocol>;
21 class PublishEventProtocol;
22 using PublishDelegatePtr = std::shared_ptr<PublishEventProtocol>;
23 class SubscribeEventProtocol;
24 using SubscribeDelegatePtr = std::shared_ptr<SubscribeEventProtocol>;
25 } // namespace CBI
26 
27 namespace cbe
28 {
29 
36 class Item {
37  public:
38 
41 
44 
47 
49  std::string aclTag() const;
50 
52  std::string description() const;
53 
55  cbe::ItemId id() const;
56 
59 
63 
65  std::string name() const;
66 
68  std::string path() const;
69 
72 
75 
77  std::string username() const;
78 
80  bool idLoaded() const;
81 
83  bool dataLoaded() const;
84 
86  cbe::Date created() const;
87 
89  cbe::Date updated() const;
90 
92  cbe::Date deleted() const;
93 
96 
100  bool hasPublished() const;
101 
107 
111  bool hasSubscribe() const;
112 
118 
119  bool operator<(const cbe::Item& rh) const;
120 
124  AclMap aclMap() const;
125 
130  ~Item();
132 
145  explicit operator bool() const;
146 
147  friend std::ostream& operator<<(std::ostream& os, const Item& item);
148 private:
149  struct Impl;
150  std::shared_ptr<Impl> pImpl{};
151 
152  friend class CloudBackend;
153  friend class Container;
154  friend class Object;
155  friend class PublishManager;
156  friend class QueryResult;
157  friend class SubscribeManager;
158  Item(CBI::ItemPtr cbiPeerPtr);
159  CBI::Item& getCbiPeer() const;
160 protected:
161  Item(std::shared_ptr<Impl> pImpl);
162 
163  template <class ImplT>
164  ImplT& castImpl() const;
165 private:
166  CBI::ItemPtr& getCbiPeerPtr();
167  const CBI::ItemPtr& getCbiPeerPtr() const;
168 }; // class Item
169 
170 cbe::ItemType operator|(cbe::ItemType lh, cbe::ItemType rh);
171 
172 std::ostream& operator<<(std::ostream& os, ItemType itemType);
173 
174 
175 } // namespace cbe
176 // namespace XAPI
177 
178 #endif // INCLUDE_XAPI_ITEM_H_
The session that holds the connection with the cloud.
Definition: CloudBackend.h:47
A collection of Item, can also represent a table or folder.
Definition: Container.h:63
A set made up of Container and Object.
Definition: Item.h:36
std::string path() const
bool hasSubscribe() const
cbe::UserId ownerId() const
cbe::Date created() const
Subscribe getSubscribe() const
cbe::ShareId getShareFromUserId(cbe::UserId userId)
cbe::ShareIds getShareIds() const
bool dataLoaded() const
cbe::UserId getUserFromShareId(cbe::UserId shareId)
AclMap aclMap() const
cbe::ContainerId driveId() const
cbe::Date updated() const
std::string description() const
std::string aclTag() const
cbe::ContainerId parentId() const
cbe::ItemType type() const
cbe::Date deleted() const
std::string name() const
bool idLoaded() const
std::string username() const
cbe::ContainerId oldParentId() const
Publish getPublished() const
cbe::ItemId id() const
bool hasPublished() const
Holder of a set of data, can represent a table row.
Definition: Object.h:64
Managing the list of web shares.
Definition: PublishManager.h:21
Managing a published Item.
Definition: Publish.h:23
resultset of data retrieved.
Definition: QueryResult.h:51
For managing subscriptions.
Definition: SubscribeManager.h:30
Managing a subscribed Item.
Definition: Subscribe.h:24
std::shared_ptr< SubscribeDelegate > SubscribeDelegatePtr
Definition: SubscribeDelegate.h:60
std::shared_ptr< PublishDelegate > PublishDelegatePtr
Definition: PublishDelegate.h:66
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::map< cbe::AclGroupId, std::pair< cbe::Permissions, AclScope > > AclMap
ACL map (Access Control List) relating to users and groups.
Definition: Types.h:390
std::uint64_t ShareId
Uniquely identifies a sharing of a cbe::Container or cbe::Object.
Definition: Types.h:113
std::uint64_t UserId
Uniquely identifies the CBE user number.
Definition: Types.h:126
std::uint64_t ContainerId
Unique Id of a cbe::Container.
Definition: Types.h:60
DefaultCtor
Default constructor marker.
Definition: Types.h:204
ItemType
Definition: Types.h:242
std::uint64_t Date
A time-stamp in the unix epoch format.
Definition: Types.h:80
std::map< cbe::ShareId, std::vector< cbe::ShareData > > ShareIds
Map of cbe::ShareData for a specific cbe::ShareId.
Definition: Types.h:447