SubcloneSeeker
1.0.0
Subclone deconvolution software framework
|
Abstract class that defines the interface to handle archiving objects into sqlite3 database. More...
#include <Archivable.h>
Public Member Functions | |
Archivable () | |
sqlite3_int64 | getId () |
void | setId (sqlite3_int64 nid) |
bool | createTableInDB (sqlite3 *database) |
sqlite3_int64 | archiveObjectToDB (sqlite3 *database) |
bool | unarchiveObjectFromDB (sqlite3 *database, sqlite3_int64 id) |
DBObjectID_vec | vecAllObjectsID (sqlite3 *database) |
Protected Member Functions | |
virtual std::string | getTableName ()=0 |
virtual std::string | createTableStatementStr ()=0 |
virtual std::string | createObjectStatementStr ()=0 |
virtual std::string | updateObjectStatementStr ()=0 |
virtual std::string | selectObjectColumnListStr ()=0 |
virtual int | bindObjectToStatement (sqlite3_stmt *statement)=0 |
virtual void | updateObjectFromStatement (sqlite3_stmt *statement)=0 |
Protected Attributes | |
sqlite3_int64 | id |
Abstract class that defines the interface to handle archiving objects into sqlite3 database.
This abstract class defines the required behaviors when handling object archiving to and from a sqlite3 database, which will be used by the project to store computation results. As of now four methods are required for any class that wishes to support archiving:
The unarchiving procedure uses an integer id to determine which database record is to be used for unarchiving. This would require that an SERIAL column exists in the table.
|
inline |
Minimal constructor to reset all member variables
sqlite3_int64 Archivable::archiveObjectToDB | ( | sqlite3 * | database | ) |
Archive the object into the database
database | An open sqlite3 database connection handle |
|
protectedpure virtual |
Bind archivable properties to a prepared, unbound sqlite3 statement
statement | A prepared, unbound sqlite3 statement instance |
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, SubcloneSeeker::SegmentalMutation, and SubcloneSeeker::SNP.
|
protectedpure virtual |
return the unbound statement for record creation
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, SubcloneSeeker::SegmentalMutation, and SubcloneSeeker::SNP.
bool Archivable::createTableInDB | ( | sqlite3 * | database | ) |
Create the storage table in the database
database | An open sqlite3 database connection handle |
|
protectedpure virtual |
return the table definition when creating the table in a sqlite3 database
Imagine a generic SQL create statement: CREATE TABLE <tableName> (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT <other-columns>); Notice that the returned string must be prefixed with a comma ",", to separate any custom columns from the id column
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, and SubcloneSeeker::SomaticEvent.
|
inline |
get access function of id
|
protectedpure virtual |
returns the name of the table in which all object of a specific class are stored
Implemented in SubcloneSeeker::LOH, SubcloneSeeker::CNV, SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, and SubcloneSeeker::SNP.
|
protectedpure virtual |
return the list of columns to be used in select statement for getting data from the database
Imagine the generic SQL select statement: SELECT <col1>, <col2>, ... FROM <tableName> WHERE id=?; The method should return the <col1>,<col2>,... part
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, SubcloneSeeker::SegmentalMutation, and SubcloneSeeker::SNP.
|
inline |
Set the database id
nid | the new database id |
bool Archivable::unarchiveObjectFromDB | ( | sqlite3 * | database, |
sqlite3_int64 | id | ||
) |
Unarchive an object from the database
database | An open sqlite3 database connection handle |
id | The identifier with which the correct record is to be found |
|
protectedpure virtual |
Populate archivable properties from a prepared statement during unarchiving
statement | A prepared statement contains the retrieved row |
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, SubcloneSeeker::SegmentalMutation, and SubcloneSeeker::SNP.
|
protectedpure virtual |
return the unbound statement for record update
Implemented in SubcloneSeeker::Subclone, SubcloneSeeker::EventCluster, SubcloneSeeker::SegmentalMutation, and SubcloneSeeker::SNP.
std::vector< sqlite3_int64 > Archivable::vecAllObjectsID | ( | sqlite3 * | database | ) |
Return a std::vector of all ids of records of the current object's class
|
protected |
the database identifier for a specific record