C++ API Library Reference  4.3.2-74-ge1d4cca
Public Functions | List of all members
IResourceManager Class Referenceabstract

The IResourceManager interface provides methods for publishing and managing resources (binary objects) that are addressable by path. The data, which is stored on the service machine, can be anything that the service can copy as a byte array. This feature is commonly used in collaborative sessions, when multiple users are connected to the same PureWeb session. IResourceManager is primarily intended to facilitate the transfer of service-side data to the client. Data storage and retrieval is based on the unique identifier (GUID) key, which the store function automatically assigns to each resource.

Public Functions

virtual void Clear ()=0
 
virtual bool Contains (Guid key)=0
 
virtual int GetCount ()=0
 
virtual bool Remove (Guid key)=0
 
virtual ContentInfo const & Retrieve (Guid key)=0
 
virtual Guid Store (ContentInfo const &resource)=0
 
virtual void Store (Guid key, ContentInfo const &resource)=0
 
virtual bool TryRetrieve (Guid key, ContentInfo &content)=0
 
Constructors and Destructors
virtual ~IResourceManager ()
 

Usage Description

virtual void Clear ( )
pure virtual

Clears all stored resources.

Implemented in ResourceManager.

virtual bool Contains ( Guid  key)
pure virtual

Indicates whether an item with the specifed key already exists. Returns true if it does, or false otherwise.

Implemented in ResourceManager.

virtual int GetCount ( )
pure virtual

Returns the count of items currently stored in the ResourceManager.

Implemented in ResourceManager.

virtual bool Remove ( Guid  key)
pure virtual

Attempts to remove the specified key. If the key exists, will return true and remove the resource. Otherwise, returns false.

Implemented in ResourceManager.

virtual ContentInfo const& Retrieve ( Guid  key)
pure virtual

Retrieves the resource currently stored at the specified key. If there are no resource at that key, will return an empty ContentInfo object.

Implemented in ResourceManager.

virtual Guid Store ( ContentInfo const &  resource)
pure virtual

Adds the specified resource, returning a key that can be used later to retrieve it. Before you can use this method, the resource must have already been saved as a ContentInfo object.

You can use this function to save the same data in several different formats. This would be useful, for instance, to handle operating system differences. Consider for example the case of a collaborative text editing application. Let's say that you need to save a Windows-targeted .docx file, and a .pages file for iOS-based clients. You would call the store method twice, once for each format, and this way each format of the file would be assigned its own GUID key.

Implemented in ResourceManager.

virtual void Store ( Guid  key,
ContentInfo const &  resource 
)
pure virtual

Stores the specified resource using the specified key. Any existing resource at that key will be replaced.

Parameters
keyThe key.
resourceThe resource.

Implemented in ResourceManager.

virtual bool TryRetrieve ( Guid  key,
ContentInfo content 
)
pure virtual

Attempts to retrieve the specified resource. If the resource exists, will return true and retrieve the resource. Otherwise, returns false.

Implemented in ResourceManager.