pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Static Public Member Functions | List of all members
UserData::DataStore Class Referenceabstract

Storage mechanism for user data. More...

#include <datastore.h>

Inheritance diagram for UserData::DataStore:
Inheritance graph
[legend]

Public Member Functions

virtual ~DataStore (void)
 
virtual const std::string & origin (void) const =0
 Retrieve the origin (type of data) stored in this storage unit. More...
 
virtual const std::string & identity (void) const =0
 Retrieve the identity (primary identifier) of the data in this storage unit. More...
 
virtual bool reconstitute (const Parsnip::Data &data)=0
 Restore data from a JSON source. More...
 
virtual Parsnip::Data persist () const =0
 Persist data using Parsnip. More...
 
bool isSourceData (void) const
 

Static Public Member Functions

static bool isSourceData (const std::string &origin)
 

Detailed Description

Storage mechanism for user data.

A user may have multiple containers. Each container is identified by an origin-identity pair, such as pandora-perette@deviousfish.com or localfiles-/Users/perette/Music; thus, there may be multiple data containers for different kinds of data ("origin"), each with a unique identity.

Constructor & Destructor Documentation

◆ ~DataStore()

virtual UserData::DataStore::~DataStore ( void  )
inlinevirtual

Member Function Documentation

◆ identity()

virtual const std::string& UserData::DataStore::identity ( void  ) const
pure virtual

Retrieve the identity (primary identifier) of the data in this storage unit.

Implemented in UserData::Dictionary< TKey, TValue, TStorage >, UserData::Dictionary< std::string, time_t >, UserData::Dictionary< std::string, Rating, std::string >, and UserData::JSONData.

Here is the caller graph for this function:

◆ isSourceData() [1/2]

bool UserData::DataStore::isSourceData ( const std::string &  origin)
static
Here is the call graph for this function:

◆ isSourceData() [2/2]

bool UserData::DataStore::isSourceData ( void  ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ origin()

virtual const std::string& UserData::DataStore::origin ( void  ) const
pure virtual

Retrieve the origin (type of data) stored in this storage unit.

Implemented in UserData::Dictionary< TKey, TValue, TStorage >, UserData::Dictionary< std::string, time_t >, UserData::Dictionary< std::string, Rating, std::string >, and UserData::JSONData.

Here is the caller graph for this function:

◆ persist()

virtual Parsnip::Data UserData::DataStore::persist ( ) const
pure virtual

◆ reconstitute()

virtual bool UserData::DataStore::reconstitute ( const Parsnip::Data data)
pure virtual

Restore data from a JSON source.

Parameters
dataData to restore from.
Returns
True on success, false otherwise.

Implemented in UserData::Dictionary< TKey, TValue, TStorage >, UserData::Dictionary< std::string, time_t >, UserData::Dictionary< std::string, Rating, std::string >, and UserData::JSONData.


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