CYCLUS
Public Member Functions | List of all members
cyclus::SqliteBack Class Reference

Detailed Description

An Recorder backend that writes data to an sqlite database.

Identically named Datum objects have their data placed as rows in a single table. Handles the following datum value types: int, float, double, std::string, cyclus::Blob. Unsupported value types are stored as an empty string.

Definition at line 17 of file sqlite_back.h.

#include <sqlite_back.h>

Inheritance diagram for cyclus::SqliteBack:
cyclus::FullBackend cyclus::QueryableBackend cyclus::RecBackend

Public Member Functions

void Close ()
 
virtual std::map< std::string, DbTypesColumnTypes (std::string table)
 
SqliteDbdb ()
 
void Flush ()
 
std::string Name ()
 
virtual void Notify (DatumList data)
 
virtual QueryResult Query (std::string table, std::vector< Cond > *conds)
 
 SqliteBack (std::string path)
 
virtual std::set< std::string > Tables ()
 
virtual ~SqliteBack ()
 
- Public Member Functions inherited from cyclus::FullBackend
virtual ~FullBackend ()
 
- Public Member Functions inherited from cyclus::QueryableBackend
virtual ~QueryableBackend ()
 
- Public Member Functions inherited from cyclus::RecBackend
virtual ~RecBackend ()
 

Constructor & Destructor Documentation

cyclus::SqliteBack::SqliteBack ( std::string  path)

Creates a new sqlite backend that will write to the database file specified by path.

If the file doesn't exist, a new one is created.

Parameters
paththe filepath (including name) to write the sqlite file.

Definition at line 47 of file sqlite_back.cc.

cyclus::SqliteBack::~SqliteBack ( )
virtual

Definition at line 38 of file sqlite_back.cc.

Member Function Documentation

void cyclus::SqliteBack::Close ( )
inlinevirtual

Closes the backend, if approriate.

Implements cyclus::RecBackend.

Definition at line 37 of file sqlite_back.h.

std::map< std::string, DbTypes > cyclus::SqliteBack::ColumnTypes ( std::string  table)
virtual

Return a map of column names of the specified table to the associated database type.

Implements cyclus::QueryableBackend.

Definition at line 129 of file sqlite_back.cc.

SqliteDb & cyclus::SqliteBack::db ( )

Returns the underlying sqlite database.

Only use this if you really know what you are doing.

Definition at line 150 of file sqlite_back.cc.

void cyclus::SqliteBack::Flush ( )
virtual

Executes all pending commands.

Implements cyclus::RecBackend.

Definition at line 91 of file sqlite_back.cc.

std::string cyclus::SqliteBack::Name ( )
virtual

Returns a unique name for this backend.

Implements cyclus::RecBackend.

Definition at line 172 of file sqlite_back.cc.

void cyclus::SqliteBack::Notify ( DatumList  data)
virtual

Writes Datum objects immediately to the database as a single transaction.

Parameters
datagroup of Datum objects to write to the database together.

Implements cyclus::RecBackend.

Definition at line 70 of file sqlite_back.cc.

QueryResult cyclus::SqliteBack::Query ( std::string  table,
std::vector< Cond > *  conds 
)
virtual

Return a set of rows from the specificed table that match all given conditions.

Conditions are AND'd together. conds may be NULL.

Implements cyclus::QueryableBackend.

Definition at line 93 of file sqlite_back.cc.

std::set< std::string > cyclus::SqliteBack::Tables ( )
virtual

Return a set of all table names currently in the database.

Implements cyclus::QueryableBackend.

Definition at line 137 of file sqlite_back.cc.


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