Murl::ICloudControl Interface Referenceabstract

The ICloudControl interface. More...

#include "murl_i_cloud_control.h"

Inheritance diagram for Murl::ICloudControl:

Public Types

enum  AccountStatus { ACCOUNT_UNKNOWN, ACCOUNT_NOT_AUTHENTICATED, ACCOUNT_AUTHENTICATED }
 The account states. More...
 
enum  KeyValueStatus { KEYVALUE_STATUS_IDLE, KEYVALUE_STATUS_INITIAL_SYNC, KEYVALUE_STATUS_SERVER_CHANGE, KEYVALUE_STATUS_QUOTA_VIOLATION }
 The key-value store states. More...
 

Public Member Functions

virtual AccountStatus GetAccountStatus ()=0
 Get the user's cloud account status. More...
 
virtual IPreferencesControlGetKeyValueStore ()=0
 Get the key-value store preference control. More...
 
virtual KeyValueStatus GetKeyValueStatus () const =0
 Get the key-value store status. More...
 
virtual const StringArrayGetChangedKeys () const =0
 Get the key-value store changed keys. More...
 
virtual Bool ClearKeyValueStatus ()=0
 Clear the key-value store status. More...
 
virtual ICloudRecordOpenPrivateRecord (const String &recordName, const String &recordType)=0
 Open a record in the private database from the default container with a given record type name. More...
 
virtual ICloudRecordOpenPrivateRecord (const String &recordName, const String &recordType, const String &containerName)=0
 Open a record in the private database from a specified container with a given record type name. More...
 
virtual ICloudRecordOpenPublicRecord (const String &recordName, const String &recordType)=0
 Open a record in the public database from the default container with a given record type name. More...
 
virtual ICloudRecordOpenPublicRecord (const String &recordName, const String &recordType, const String &containerName)=0
 Open a record in the public database from a specified container with a given record type name. More...
 
virtual Bool CloseRecord (ICloudRecord *&record, Bool autoSave=false)=0
 Close a record. More...
 
- Public Member Functions inherited from Murl::IControlable
virtual const StringGetName () const =0
 Get the controlable's name. More...
 
virtual void FrameUpdate ()=0
 Is executed in the platform thread context each frame tick.
 
virtual void LogicUpdate ()=0
 Is executed in the logic thread context each logic tick.
 
virtual void ConfigChanged (const IAppConfiguration *appConfig)=0
 Notification of changed configuration. More...
 

Detailed Description

The ICloudControl interface.

The cloud control must be enabled during IApp::Configure() by setting IEngineConfiguration::SetCloudControlEnable().
On iOS/OSX/tvOS this control follows the iCloud guides:
An app has access to both a public and private database in each container. The public database is for storing user and app data that is shared between all instances of the app. By default, all users can read the public database, but they need to enter iCloud credentials to write to the public database. There’s a private database for each user of your app, but the app only has access to the private database of the current user. The user has to enter iCloud credentials for the app to read and write to the private database.

See also
CloudKit Framework Reference.

Member Enumeration Documentation

◆ AccountStatus

The account states.

Enumerator
ACCOUNT_UNKNOWN 

Unknown account status, call GetAccountStatus() again next tick.

ACCOUNT_NOT_AUTHENTICATED 

The user is not authenticated.

ACCOUNT_AUTHENTICATED 

The user is authenticated.

◆ KeyValueStatus

The key-value store states.

Enumerator
KEYVALUE_STATUS_IDLE 

The idle state.

KEYVALUE_STATUS_INITIAL_SYNC 

Your attempt to write to key-value storage was discarded because an initial download from iCloud has not yet happened.

That is, before you can first write key-value data, the system must ensure that your app’s local, on-disk cache matches the truth in iCloud.

KEYVALUE_STATUS_SERVER_CHANGE 

A value changed in iCloud.

This occurs when another device, running another instance of your app and attached to the same iCloud account, uploads a new value.

KEYVALUE_STATUS_QUOTA_VIOLATION 

Your app’s key-value store has exceeded its space quota on the iCloud server.

Member Function Documentation

◆ GetAccountStatus()

virtual AccountStatus Murl::ICloudControl::GetAccountStatus ( )
pure virtual

Get the user's cloud account status.

On iOS/OSX/tvOS follow the iCloud guides:
Before saving records, verify that the user is signed in to their iCloud account. If the user is not signed in, present an alert instructing the user how to enter their iCloud credentials and enable iCloud Drive.

See also
CloudKit Framework Reference.
Returns
true if the user is signed in.

◆ GetKeyValueStore()

virtual IPreferencesControl* Murl::ICloudControl::GetKeyValueStore ( )
pure virtual

Get the key-value store preference control.

Returns
The key-value store preference control.

◆ GetKeyValueStatus()

virtual KeyValueStatus Murl::ICloudControl::GetKeyValueStatus ( ) const
pure virtual

Get the key-value store status.

If the status changes to KeyValueStatus::KEYVALUE_STATUS_INITIAL_SYNC or KeyValueStatus::KEYVALUE_STATUS_SERVER_CHANGE the changed keys can be evaluated by GetChangedKeys(). To receive further changes, the status must be cleared by calling ClearKeyValueStatus().

Returns
The key-value store status.

◆ GetChangedKeys()

virtual const StringArray& Murl::ICloudControl::GetChangedKeys ( ) const
pure virtual

Get the key-value store changed keys.

Returns
The key-value store changed keys.

◆ ClearKeyValueStatus()

virtual Bool Murl::ICloudControl::ClearKeyValueStatus ( )
pure virtual

Clear the key-value store status.

Set the key-value store status to KeyValueStatus::KEYVALUE_STATUS_IDLE and clears the changed keys.

Returns
true if successful.

◆ OpenPrivateRecord() [1/2]

virtual ICloudRecord* Murl::ICloudControl::OpenPrivateRecord ( const String recordName,
const String recordType 
)
pure virtual

Open a record in the private database from the default container with a given record type name.

Parameters
recordNameThe record name.
recordTypeThe record type name.
Returns
The record object.

◆ OpenPrivateRecord() [2/2]

virtual ICloudRecord* Murl::ICloudControl::OpenPrivateRecord ( const String recordName,
const String recordType,
const String containerName 
)
pure virtual

Open a record in the private database from a specified container with a given record type name.

Parameters
recordNameThe record name.
recordTypeThe record type name.
containerNameThe container name.
Returns
The record object.

◆ OpenPublicRecord() [1/2]

virtual ICloudRecord* Murl::ICloudControl::OpenPublicRecord ( const String recordName,
const String recordType 
)
pure virtual

Open a record in the public database from the default container with a given record type name.

Parameters
recordNameThe record name.
recordTypeThe record type name.
Returns
The record object.

◆ OpenPublicRecord() [2/2]

virtual ICloudRecord* Murl::ICloudControl::OpenPublicRecord ( const String recordName,
const String recordType,
const String containerName 
)
pure virtual

Open a record in the public database from a specified container with a given record type name.

Parameters
recordNameThe record name.
recordTypeThe record type name.
containerNameThe container name.
Returns
The record object.

◆ CloseRecord()

virtual Bool Murl::ICloudControl::CloseRecord ( ICloudRecord *&  record,
Bool  autoSave = false 
)
pure virtual

Close a record.

Parameters
recordA reference to the record object to destroy. After destruction the pointer is set to null.
autoSaveIf true the record's ICloudRecord::SaveRecord() method is executed before closing the record.
Returns
true if successful.

The documentation for this interface was generated from the following file:
  • murl_i_cloud_control.h


Copyright © 2011-2018 Spraylight GmbH.