SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
Database.h
1 /*
2  Copyright © CloudBackend AB 2022-2023.
3 */
4 
5 #ifndef _CBE_DATABASE_H_
6 #define _CBE_DATABASE_H_
7 
8 #include "cbe/Types.h"
9 
10 #include <string>
11 
12  namespace CBI {
13 class Database;
14 using DatabasePtr = std::shared_ptr<CBI::Database>;
15  } // namespace CBI
16 
17 namespace cbe {
18 
27 class Database {
28 public:
34  std::string name() const;
35 
42 
51 
58 
66  cbe::Date created() const;
67 
74  bool readLocked() const;
75 
82  bool writeLocked() const;
83 
92 
94  ~Database();
95 
96  explicit operator bool() const;
97 private:
98  struct Impl;
99  std::shared_ptr<Impl> pImpl{};
100 
101  friend Account;
102  Database(CBI::DatabasePtr cbiPeerPtr);
103  CBI::Database& getCbiPeer() const;
104 }; // class Database
105 
106 } // namespace cbe
107 
108 #endif // _CBE_DATABASE_H_
Login account information.
Definition: Account.h:26
A collection of Item, can also represent a table or folder.
Definition: Container.h:63
A database.
Definition: Database.h:27
cbe::UserId ownerId() const
The userId number of the owner.
cbe::ContainerId containerId() const
The containerId number.
cbe::DatabaseId databaseId() const
The databaseId number.
cbe::Date created() const
Timestamp of when it was created.
bool writeLocked() const
Checks if it has a write lock.
bool readLocked() const
Checks if it has a read lock.
cbe::Container rootContainer() const
The top container of the database.
std::string name() const
The database name.
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
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
std::uint64_t DatabaseId
The id of a Database.
Definition: Types.h:64
std::uint64_t Date
A time-stamp in the unix epoch format.
Definition: Types.h:80