Ditto 5.0.0
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ditto Namespace Reference

Namespace for the Ditto C++ SDK types and functions. More...

Namespaces

namespace  internal
 Namespace for internal Ditto SDK functionality.
 

Classes

class  any
 Polyfill of std::any for C++11. More...
 
class  Attachment
 Represents an attachment and can be used to insert the associated attachment into a document at a specific key. More...
 
class  AttachmentFetcher
 These objects are returned by calls to Store::fetch_attachment. More...
 
struct  AttachmentFetcherEventHandler
 A thin wrapper around a function that will get called when there are updates relating to an attempt to fetch an attachment. More...
 
struct  AttachmentFetchEvent
 The different types of attachment fetch events that can be delivered. More...
 
struct  AttachmentFetchEventCompleted
 An attachment fetch event used when the attachment's download has completed. More...
 
struct  AttachmentFetchEventDeleted
 An attachment fetch event used when the attachment is deleted. More...
 
struct  AttachmentFetchEventProgress
 An attachment fetch event used when the attachment's download has progressed but is not yet complete. More...
 
class  AttachmentFileNotFoundError
 
class  AttachmentFilePermissionDeniedError
 
class  AttachmentNotFoundError
 
class  AttachmentToken
 Serves as a token for a specific attachment that you can pass to a call to Store::fetch_attachment. More...
 
class  AttachmentTokenInvalidError
 
class  AuthenticationCallback
 Provides feedback to the developer about Ditto authentication status. More...
 
struct  AuthenticationStatus
 Provides info about the authentication status. More...
 
class  AuthenticationStatusObserver
 
class  Authenticator
 Provides access to authentication information and methods for logging on to Ditto Cloud. Relevant when using an OnlineWithAuthentication or an Online identity. More...
 
class  AwdlConfig
 Part of the PeerToPeer config that relates to AWDL connections. More...
 
class  BluetoothLeConfig
 Part of the PeerToPeer config that relates to Bluetooth LE connections. More...
 
class  Connect
 Part of the TransportConfig that relates to outgoing connections. More...
 
class  Connection
 Represents a connection between two peers in a Ditto mesh network. More...
 
class  ConnectionRequest
 Contains information about a remote peer that has requested a connection. More...
 
struct  Diff
 Represents differences between two arrays of items. More...
 
class  Differ
 Calculates diffs between arrays of QueryResultItem elements. More...
 
class  DiskUsage
 Provides an interface to be able to monitor local files. More...
 
class  DiskUsageItem
 
class  DiskUsageObserver
 
class  Ditto
 The entrypoint to the Ditto SDK. More...
 
class  DittoAddress
 Information used to identify a peer. More...
 
struct  DittoConfig
 Configuration options for initializing a Ditto instance. More...
 
class  DittoError
 All errors that are thrown by the Ditto SDK are wrapped as a DittoError. More...
 
struct  DocumentId
 An identifier for a Document. More...
 
class  FailedToCreateAttachmentError
 
class  FailedToFetchAttachmentError
 
class  Global
 
class  HttpListenConfig
 Part of the Listen config that relates to incoming HTTP connections. More...
 
class  IOAlreadyExistsError
 
class  IONotFoundError
 
class  IOOperationFailedError
 
class  IOPermissionDeniedError
 
class  LanConfig
 Part of the PeerToPeer config that relates to LAN connections. More...
 
class  Listen
 Part of the TransportConfig that relates to incoming connections. More...
 
class  Logger
 Main singleton (global instance) to tweak the behavior of Ditto's logging infrastructure. More...
 
class  Observer
 An observation token returned by any observation API in the Ditto SDK. Retain this object to continue receiving updates. More...
 
class  Peer
 Represent a known peer in the Ditto network. More...
 
class  PeerToPeer
 Part of the TransportConfig that relates to peer-to-peer connections. More...
 
class  Presence
 
class  PresenceGraph
 Represents the Ditto mesh network of peers and their connections between each other. The localPeer is the entry point, all others are remote peers known by the local peer (either directly or via other remote peers). More...
 
class  QueryResult
 Represents the returned results when executing a DQL query, containing a QueryResultItem for each match. More...
 
class  QueryResultItem
 Represents a single match of a DQL query, similar to a "row" in SQL terms. It is a reference type serving as a "cursor", allowing for efficient access of the underlying data in various formats. More...
 
class  SmallPeerInfo
 The entrypoint for small peer user info collection. More...
 
class  Store
 Provides access to Collections and a transaction API. More...
 
class  StoreObserver
 
struct  StoreObserverEq
 Defines equality for shared_ptr-wrapped StoreObserver objects. More...
 
struct  StoreObserverHash
 Defines hashing for shared_ptr-wrapped StoreObserver objects. More...
 
class  Sync
 Provides access to sync related functionality of Ditto. More...
 
class  SyncSubscription
 A sync subscription configures Ditto to receive updates from remote peers about documents matching the subscription's query. More...
 
struct  SyncSubscriptionEq
 Defines equality for shared_ptr-wrapped SyncSubscription objects. More...
 
struct  SyncSubscriptionHash
 Defines hashing for shared_ptr-wrapped SyncSubscription objects. More...
 
class  TcpListenConfig
 Part of the Listen config that relates to incoming TCP connections. More...
 
class  Transaction
 Represents a transaction in the Ditto store. More...
 
struct  TransactionInfo
 Encapsulates information about a transaction. More...
 
class  TransactionOptions
 Options for configuring a transaction. More...
 
class  TransactionReadOnlyError
 
class  TransportConfig
 A configuration object specifying which network transports Ditto should use to sync data. More...
 
class  ValidationNotAMapError
 
class  ValidationNotJSONCompatibleError
 
class  ValidationSizeLimitExceededError
 
class  WiFiAwareConfig
 Part of the PeerToPeer transport config that applies to WiFi Aware connections. More...
 

Typedefs

using AuthenticationExpirationHandler = std::function< void(Ditto &ditto, uint32_t sec_remaining)>
 Callback function type used with Authenticator::set_expiration_handler.
 
using ConnectionRequestHandler = std::function< ConnectionRequestAuthorization(ConnectionRequest)>
 
using IndexSet = std::set< std::size_t >
 A set of indexes into a vector.
 
using DiskUsageCallback = std::function< void(DiskUsageItem)>
 A function that will get called when there are updates relating to a live query associated with a single document.
 
using PresenceCallback = std::function< void(const PresenceGraph &)>
 A type representing a callback that will get called when there are updates relating to presence.
 
using PresenceObserver = std::shared_ptr< PresenceCallback >
 
using Pubkey = std::vector< uint8_t >
 
using ValueMap = std::unordered_map< std::string, any >
 
using StoreObservationHandler = std::function< void(QueryResult)>
 A function that will get called when there are updates relating to a store observer.
 
using SignalNext = std::function< void()>
 
using StoreObservationHandlerWithSignalNext = std::function< void(QueryResult, SignalNext)>
 A function that will get called when there are updates relating to a store observer, that also has an associated function to call when the next event is ready to be delivered.
 
using SyncSubscriptionSet = std::unordered_set< std::shared_ptr< SyncSubscription >, SyncSubscriptionHash, SyncSubscriptionEq >
 

Enumerations

enum class  AttachmentFetchEventType { Completed , Progress , Deleted }
 The different types of attachment fetch events that can be delivered.
 
enum class  ConnectionRequestAuthorization { deny , allow }
 Indicates whether a connection request should be authorized. More...
 
enum class  ConnectionType {
  bluetooth = 1 , accessPoint , p2pWiFi , webSocket ,
  unknown
}
 The type of connection between two peers signaling what transport is being used for it.
 
enum  FileSystemType { Directory , File , SymLink }
 
enum  LogLevel {
  error = 1 , warning , info , debug ,
  verbose
}
 The log levels that the Ditto SDK supports.
 
enum class  TransactionCompletionAction { commit , rollback }
 Represents an action that completes a transaction, by either committing it or rolling it back. More...
 

Functions

template<typename T >
any_cast (ditto::any const &operand)
 
void to_json (nlohmann::json &j, const Attachment &a)
 
bool operator== (const AuthenticationStatus &lhs, const AuthenticationStatus &rhs)
 
bool operator!= (const AuthenticationStatus &lhs, const AuthenticationStatus &rhs)
 
void to_json (nlohmann::json &j, const DittoConfig &c)
 
void from_json (const nlohmann::json &j, DittoConfig &c)
 
void to_json (nlohmann::json &j, const DocumentId &d_id)
 
std::vector< uint8_t > validate_id_cbor (nlohmann::json &input_val)
 
std::size_t fnv_1a_hash (const std::vector< std::uint8_t > &data) noexcept
 Computes a 64-bit FNV-1a hash of a byte vector.
 
void from_json (const nlohmann::json &j, TransactionInfo &c)
 Deserialize a JSON/CBOR object into a TransactionInfo object.
 
void to_json (nlohmann::json &j, const TransactionInfo &c)
 Serialize a TransactionInfo object into a JSON/CBOR object.
 
void from_json (const nlohmann::json &j, HttpListenConfig &c)
 
void to_json (nlohmann::json &j, const HttpListenConfig &c)
 
void from_json (const nlohmann::json &j, LanConfig &c)
 
void to_json (nlohmann::json &j, const LanConfig &c)
 
void from_json (const nlohmann::json &j, Connect &c)
 
void to_json (nlohmann::json &j, const Connect &c)
 

Variables

const uint32_t NO_PREFERRED_ROUTE_HINT = 0
 

Detailed Description

Namespace for the Ditto C++ SDK types and functions.

Typedef Documentation

◆ ConnectionRequestHandler

A handler for connection requests from other peers.

Set a ConnectionRequestHandler on Presence::connection_request_handler to allow or deny connection requests from other peers.

Parameters
connection_requestcontains information about the remote peer that can be used to make an authorization decision.
Returns
ConnectionRequestAuthorization::allow if the request should be authorized, ConnectionRequestAuthorization::deny otherwise

Enumeration Type Documentation

◆ ConnectionRequestAuthorization

Indicates whether a connection request should be authorized.

Enumerator
deny 

The connection request will be denied.

allow 

The connection request will be allowed.

◆ TransactionCompletionAction

Represents an action that completes a transaction, by either committing it or rolling it back.

Enumerator
commit 

Represents the action of committing a transaction.

rollback 

Represents the action of rolling back a transaction.

Function Documentation

◆ fnv_1a_hash()

std::size_t ditto::fnv_1a_hash ( const std::vector< std::uint8_t > &  data)
inlinenoexcept

Computes a 64-bit FNV-1a hash of a byte vector.

FNV-1a is a non-cryptographic hash function that provides good distribution properties and is suitable for hash table implementations.

Parameters
dataThe byte vector to hash
Returns
The 64-bit FNV-1a hash value