walberla::sqlite::SQLiteDB Class Reference

#include <SQLite.h>

Public Member Functions

 SQLiteDB (const string &dbFile, const int busyTimeout=BUSY_TIMEOUT)
 
 ~SQLiteDB ()
 
uint_t storeRun (const map< string, int > &integerProperties, const map< string, string > &stringProperties, const map< string, double > &realProperties)
 Store information about a simulation run into a Sqlite3 Database. More...
 
uint_t storeRun (const map< string, int64_t > &integerProperties, const map< string, string > &stringProperties, const map< string, double > &realProperties)
 
void storeAdditionalRunInfo (uint_t runId, const std::string &tableName, const map< string, int > &integerProperties, const map< string, string > &stringProperties, const map< string, double > &realProperties)
 Stores information in another table, referencing the "run" table. More...
 
void storeAdditionalRunInfo (uint_t runId, const std::string &tableName, const map< string, int64_t > &integerProperties, const map< string, string > &stringProperties, const map< string, double > &realProperties)
 
void storeTimingPool (uint_t runId, const WcTimingPool &tp, const std::string &name)
 Stores a TimingPool in a Sqlite3 Database, and links it to a run. More...
 
void storeTimingTree (uint_t runId, const WcTimingTree &tt, const std::string &timingTreeName)
 Stores a TimingTree in a Sqlite3 Database, and links it to a run. More...
 

Private Member Functions

void storeTimingNode (const uint_t runId, const int parentId, const WcTimingNode &tn, const std::string &timingTreeName, const std::string &sweep, const double totalTime)
 Stores a TimingNode recursively in a Sqlite3 Database, and links it together. More...
 

Private Attributes

bool valid_
 
sqlite3 * dbHandle_
 
std::string file_
 

Constructor & Destructor Documentation

◆ SQLiteDB()

walberla::sqlite::SQLiteDB::SQLiteDB ( const string &  dbFile,
const int  busyTimeout = BUSY_TIMEOUT 
)

◆ ~SQLiteDB()

walberla::sqlite::SQLiteDB::~SQLiteDB ( )

Member Function Documentation

◆ storeAdditionalRunInfo() [1/2]

void walberla::sqlite::SQLiteDB::storeAdditionalRunInfo ( uint_t  runId,
const std::string &  tableName,
const map< string, int > &  integerProperties,
const map< string, string > &  stringProperties,
const map< string, double > &  realProperties 
)

Stores information in another table, referencing the "run" table.

Parameters
runIdresult of storeRun() member function, primary key of the run to store information for
tableNamename of the table where the information is stored in is created if it does not yet exist
integerProperties,stringProperties,realPropertiesMap of column names to value

◆ storeAdditionalRunInfo() [2/2]

void walberla::sqlite::SQLiteDB::storeAdditionalRunInfo ( uint_t  runId,
const std::string &  tableName,
const map< string, int64_t > &  integerProperties,
const map< string, string > &  stringProperties,
const map< string, double > &  realProperties 
)

◆ storeRun() [1/2]

uint_t walberla::sqlite::SQLiteDB::storeRun ( const map< string, int > &  integerProperties,
const map< string, string > &  stringProperties,
const map< string, double > &  realProperties 
)

Store information about a simulation run into a Sqlite3 Database.

The generated database is called "runs". The columns of the table are the keys of the given maps. If a column does not yet exist, it is appended to the database. The entries that have no value in this column are set to default value ( zero or empty string ). Additionally a column is created for each activated global state, and its value is set to 1

Parameters
integerProperties,stringProperties,realPropertiesMap of column names to value
Returns
The primary key of the inserted data set.

◆ storeRun() [2/2]

uint_t walberla::sqlite::SQLiteDB::storeRun ( const map< string, int64_t > &  integerProperties,
const map< string, string > &  stringProperties,
const map< string, double > &  realProperties 
)
See also
storeRun

◆ storeTimingNode()

void walberla::sqlite::SQLiteDB::storeTimingNode ( const uint_t  runId,
const int  parentId,
const WcTimingNode tn,
const std::string &  timingTreeName,
const std::string &  sweep,
const double  totalTime 
)
private

Stores a TimingNode recursively in a Sqlite3 Database, and links it together.

Parameters
runIdprimary key of the run, as returned by storeRun()
parentIdparent key of the node
tnthe TimingNode to store
timingTreeNamename of the timing tree ( as written to database column )

◆ storeTimingPool()

void walberla::sqlite::SQLiteDB::storeTimingPool ( uint_t  runId,
const WcTimingPool tp,
const std::string &  timingPoolName 
)

Stores a TimingPool in a Sqlite3 Database, and links it to a run.

The generated table is called "timingPools"

Parameters
runIdprimary key of the run, as returned by storeRun()
tpthe TimingPool to store
timingPoolNamename of the timing pool ( as written to database column )

◆ storeTimingTree()

void walberla::sqlite::SQLiteDB::storeTimingTree ( uint_t  runId,
const WcTimingTree tt,
const std::string &  timingTreeName 
)

Stores a TimingTree in a Sqlite3 Database, and links it to a run.

The generated table is called "timingTree"

Parameters
runIdprimary key of the run, as returned by storeRun()
ttthe TimingTree to store
timingTreeNamename of the timing tree ( as written to database column )

Member Data Documentation

◆ dbHandle_

sqlite3* walberla::sqlite::SQLiteDB::dbHandle_
private

◆ file_

std::string walberla::sqlite::SQLiteDB::file_
private

◆ valid_

bool walberla::sqlite::SQLiteDB::valid_
private

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