C++  1.4.6
CloudBackend Software Development Kit - SDK API for C++
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CBE::CloudBackend Class Reference
Collaboration diagram for CBE::CloudBackend:
Collaboration graph
[legend]

Public Member Functions

void addListener (CBE::ItemDelegatePtr delegate)
 
void removeListener (CBE::ItemDelegatePtr delegate)
 
virtual QueryChainPtr query (uint64_t containerId, CBE::ItemDelegatePtr delegate)
 
virtual QueryChainPtr query (CBE::container_id_t containerId, CBE::Filter filter, CBE::ItemDelegatePtr delegate)
 
virtual CBE::QueryChainPtr queryWithPath (std::string relativePath, CBE::ItemDelegatePtr delegate, CBE::container_id_t queryRoot=0)
 
virtual QueryResultPtr search (std::string tags, CBE::container_id_t containerId, CBE::ItemDelegatePtr delegate)
 
virtual CBE::QueryResultPtr search (CBE::Filter filter, CBE::container_id_t containerId, CBE::ItemDelegatePtr delegate)
 
virtual bool clearCache ()
 
CBE::AccountPtr account ()
 
std::string version ()
 
CBE::GroupManagergroupManager ()
 
CBE::ShareManagershareManager ()
 

Static Public Member Functions

static CloudBackendPtr logIn (const std::string &username, const std::string &password, const std::string &source, CBE::AccountDelegatePtr delegate)
 
static CloudBackendPtr createAccount (const std::string &username, const std::string &password, const std::string &email, const std::string &firstName, const std::string &lastName, const std::string &source, CBE::AccountDelegatePtr delegate)
 
static CBE::ContainerPtr castContainer (CBE::ItemPtr item)
 
static CBE::ObjectPtr castObject (CBE::ItemPtr item)
 

Protected Member Functions

 CloudBackend (const CloudBackend &)=delete
 
CloudBackendoperator= (const CloudBackend &)=delete
 

Protected Attributes

CBE::ShareManager_shareManager
 
CBE::GroupManager_groupManager
 
CBE::AccountPtr _account
 
bool listening
 
std::vector< CBE::ItemDelegatePtr > _event_listeners
 

Member Function Documentation

◆ logIn()

static CloudBackendPtr CBE::CloudBackend::logIn ( const std::string &  username,
const std::string &  password,
const std::string &  source,
CBE::AccountDelegatePtr  delegate 
)
static

This should return an instance of cloudbackend giving the user access to the root container after succesful log in of the user

Parameters
usernameof the user to be signed in
passwordof the user to be signed in
sourceis the identifier for the tenant
delegateis a shared pointer to the class AccountEventProtocol that the user implements to recieve the callback on function completion. See Types.h for declaration.

◆ createAccount()

static CloudBackendPtr CBE::CloudBackend::createAccount ( const std::string &  username,
const std::string &  password,
const std::string &  email,
const std::string &  firstName,
const std::string &  lastName,
const std::string &  source,
CBE::AccountDelegatePtr  delegate 
)
static

Call to create an account. Implement onCreated to from CBE::AccountDelegatePtr to recieve the callback. currently disabled

Parameters
username
password
email
firstName
lastName
source
delegateis a shared pointer to the class in which you implement CBE::AccountDelegatePtr

◆ addListener()

void CBE::CloudBackend::addListener ( CBE::ItemDelegatePtr  delegate)

adds a listner that will receive updates as changes occur on the account.
removeListener should always be called when you stop using the delegate.

Parameters
delegateDelegate is a shared pointer to the class ItemEventProtocol that the user has implemented. The pointer is defined in Types.h.

◆ removeListener()

void CBE::CloudBackend::removeListener ( CBE::ItemDelegatePtr  delegate)

removes a listner that will recieve updates as changes occur on the account

Parameters
delegateDelegate is the previously passed in shared pointer to an ItemEventProtocol that the user has implemented to recieve the callback on function completion. The pointer is defined in Types.h.

◆ query() [1/2]

virtual QueryChainPtr CBE::CloudBackend::query ( uint64_t  containerId,
CBE::ItemDelegatePtr  delegate 
)
virtual

Call to get a list of items in the container. Implement onQueryLoaded to from CBE::ItemDelegatePtrto recieve the callback.
Requires you have already signedIn.

Parameters
containerIdis the numeric representation of the container id
delegateis a shared pointer to the class in which you implement CBE::ItemDelegatePtr to recieve the callback on function completion.

◆ query() [2/2]

virtual QueryChainPtr CBE::CloudBackend::query ( CBE::container_id_t  containerId,
CBE::Filter  filter,
CBE::ItemDelegatePtr  delegate 
)
virtual

Call to get a list of items in the container using a filter. Implement onQueryLoaded to from CBE::ItemEventProtocol to recieve the callback. Requires you have already signedIn. Does not require a containerId due to having the filter.

Parameters
containerIdis the numeric id of the container.
filterwith the limitations to put on the call
delegateis a shared pointer to the class in which you implement CBE::ItemEventProtocol to recieve the callback on function completion.

◆ queryWithPath()

virtual CBE::QueryChainPtr CBE::CloudBackend::queryWithPath ( std::string  relativePath,
CBE::ItemDelegatePtr  delegate,
CBE::container_id_t  queryRoot = 0 
)
virtual

Queries with a given path to a container. Note! no .. or . path option available, only top down search from start point (queryRoot id) to downwards path in container tree.

Parameters
relativePathis the relative path from the queryRoot, e.g.: /Documents/Pictures from a queryRoot that has the Documents and Pictures containers.
delegateis a shared pointer to the class in which you implement CBE::ItemEventProtocol to recieve the callback on function completion.
queryRootis the Container id that will be the top root of this query. Option to not add an id will resolve in account rootContainer beeing the starting point.

◆ search() [1/2]

virtual QueryResultPtr CBE::CloudBackend::search ( std::string  tags,
CBE::container_id_t  containerId,
CBE::ItemDelegatePtr  delegate 
)
virtual

Search the whole container for tags related to Objects in the container structure. E.g.: Key = Name, Value Contract/Object/Song => Name:Contract1.

Search handles tags in combination / conjunction of keys and/or key values seperated by |. E.g.: Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name but any value and where key Country is either Sweden or Norway.

Parameters
tagsis a string of key tags or key:value pairs that are seperated by |.
containerIdis the uint64_t id of the rootContainer to start the search of Objects in. E.g.: if starting in the rootContainer, the whole account will be searched for matching tags, key:value's.
delegateis the callback pointer to when the API returns from either cache or Server.

◆ search() [2/2]

virtual CBE::QueryResultPtr CBE::CloudBackend::search ( CBE::Filter  filter,
CBE::container_id_t  containerId,
CBE::ItemDelegatePtr  delegate 
)
virtual

Search the whole container for tags related to Objects in the container structure. E.g.: Key = Name, Value Contract/Object/Song => Name:Contract1.

Search handles tags in combination / conjunction of keys and/or key values seperated by |. E.g.: Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name but any value and where key Country is either Sweden or Norway.

Parameters
filteris a CBE::Filter on which you can set how you want data to be ordered when searching, remember to set the queryString to be keys/tags or key:value pairs that are seperated by |.
containerIdis the uint64_t id of the rootContainer to start the search of Objects in. E.g.: if starting in the rootContainer, the whole account will be searched for matching tags, key:value's.
delegateis the callback pointer to when the API returns from either cache or Server.

◆ castContainer()

static CBE::ContainerPtr CBE::CloudBackend::castContainer ( CBE::ItemPtr  item)
static

casts an item to a container

Parameters
itemfrom a previous queryResult

◆ castObject()

static CBE::ObjectPtr CBE::CloudBackend::castObject ( CBE::ItemPtr  item)
static

casts an item to an object

Parameters
itemfrom a previous queryResult

◆ clearCache()

virtual bool CBE::CloudBackend::clearCache ( )
virtual

Can be called to clear the cache of the SDK, if you are having memory issues.

Returns
bool

◆ account()

CBE::AccountPtr CBE::CloudBackend::account ( )

Returns an account object with information on the user.

Returns
CBE::AccountPtr

◆ version()

std::string CBE::CloudBackend::version ( )

Returns the version number of the SDK.

Returns
std::string

◆ groupManager()

CBE::GroupManager* CBE::CloudBackend::groupManager ( )

See the GroupManager description.

Returns
CBE::GroupManager*

◆ shareManager()

CBE::ShareManager* CBE::CloudBackend::shareManager ( )

See the ShareManager description.

Returns
CBE::ShareManager*

The documentation for this class was generated from the following file: