Minnal C++ Servlet Container  1.7.0
Developed by Sans Pareil Technologies, Inc. (SPT)
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
spt::servlet::templating::Datastore Class Referenceabstract

Factory class for interacting with backend systems used to store/retrieve data used to fill templates. More...

#include <Datastore.h>

Public Types

typedef Poco::Util::JSONObject::Ptr Configuration
 Configuration used to initialise a datastore implementation. More...
 
typedef Poco::SharedPtr
< Datastore
Ptr
 Shared pointer to a datastore implementation. More...
 
typedef Poco::SharedPtr
< ctemplate::TemplateDictionary > 
Dictionary
 Shared pointer to a template dictionary. More...
 

Public Member Functions

virtual Dictionary load (const std::string &path)=0
 Load a dictionary from data stored at the specified path. More...
 
virtual Poco::Timestamp getLastModified (const std::string &path)=0
 Return the last modification timestamp value for the data at the specified virtual path in the datastore implementation. More...
 

Static Public Member Functions

static Ptr getDatastore (const std::string &type, Configuration configuration)
 Initialise a datastore of the specified type using the specified configuration. More...
 

Protected Member Functions

 Datastore ()
 

Detailed Description

Factory class for interacting with backend systems used to store/retrieve data used to fill templates.

Date
Created 2014/10/04 21:38
Author
Rakesh
Version
Id
Datastore.h 5632 2014-10-06 22:04:21Z rakesh
Since
1.7

Member Typedef Documentation

Configuration used to initialise a datastore implementation.

typedef Poco::SharedPtr<ctemplate::TemplateDictionary> spt::servlet::templating::Datastore::Dictionary

Shared pointer to a template dictionary.

Shared pointer to a datastore implementation.

Constructor & Destructor Documentation

spt::servlet::templating::Datastore::Datastore ( )
inlineprotected

Member Function Documentation

static Ptr spt::servlet::templating::Datastore::getDatastore ( const std::string &  type,
Configuration  configuration 
)
static

Initialise a datastore of the specified type using the specified configuration.

Configuration may include location on filesystem, datastore connection etc.

Parameters
typeThe type of datastore to initialise (file, xapian, mongodb, leveldb, hamsterdb ...)
configurationConfiguration necessary to properly initialise the datastore
virtual Poco::Timestamp spt::servlet::templating::Datastore::getLastModified ( const std::string &  path)
pure virtual

Return the last modification timestamp value for the data at the specified virtual path in the datastore implementation.

Parameters
pathThe virtual path representing the data in the datastore.
Returns
The last modification timestamp for the data at virtual path.
virtual Dictionary spt::servlet::templating::Datastore::load ( const std::string &  path)
pure virtual

Load a dictionary from data stored at the specified path.

Note: A path is a virtual construct which may indicate the location on filesystem, a key/property used to retrieve from a datastore such as leveldb, mongodb etc.

Parameters
pathThe abstract path representing the data to be laoded.
Returns
The dictionary instance with contents of the data at the specified path

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