MythTV  master
Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
SingleValueImp Class Reference
Collaboration diagram for SingleValueImp:
Collaboration graph
[legend]

Public Types

using entry = SingleValue::entry
 
using entry_list = std::vector< entry >
 

Public Member Functions

 SingleValueImp (QString table_name, QString id_name, QString value_name)
 
virtual ~SingleValueImp ()=default
 
void load_data ()
 
int add (const QString &name)
 
bool get (int id, QString &value)
 
void remove (int id)
 
bool exists (int id)
 
bool exists (const QString &name, int *id=nullptr)
 
const entry_listgetList ()
 
virtual bool sort (const entry &lhs, const entry &rhs)
 
void cleanup ()
 

Public Attributes

QMutex m_mutex
 

Private Types

using entry_map = std::map< int, QString >
 

Private Member Functions

entry_map::iterator find (const QString &name)
 
void fill_from_db ()
 

Private Attributes

QString m_tableName
 
QString m_idName
 
QString m_valueName
 
QString m_insertSql
 
QString m_fillSql
 
QString m_deleteSql
 
bool m_ready {false}
 
bool m_dirty {true}
 
entry_list m_retEntries
 
entry_map m_entries
 
SimpleCleanup< SingleValueImpm_cleanStub
 

Detailed Description

Definition at line 26 of file dbaccess.cpp.

Member Typedef Documentation

◆ entry

Definition at line 29 of file dbaccess.cpp.

◆ entry_list

using SingleValueImp::entry_list = std::vector<entry>

Definition at line 30 of file dbaccess.cpp.

◆ entry_map

using SingleValueImp::entry_map = std::map<int, QString>
private

Definition at line 33 of file dbaccess.cpp.

Constructor & Destructor Documentation

◆ SingleValueImp()

SingleValueImp::SingleValueImp ( QString  table_name,
QString  id_name,
QString  value_name 
)
inline

Definition at line 36 of file dbaccess.cpp.

◆ ~SingleValueImp()

virtual SingleValueImp::~SingleValueImp ( )
virtualdefault

Member Function Documentation

◆ load_data()

void SingleValueImp::load_data ( )
inline

Definition at line 52 of file dbaccess.cpp.

Referenced by SingleValue::load_data().

◆ add()

int SingleValueImp::add ( const QString &  name)
inline

Definition at line 62 of file dbaccess.cpp.

Referenced by SingleValue::add().

◆ get()

bool SingleValueImp::get ( int  id,
QString &  value 
)
inline

◆ remove()

void SingleValueImp::remove ( int  id)
inline

Definition at line 98 of file dbaccess.cpp.

Referenced by SingleValue::remove().

◆ exists() [1/2]

bool SingleValueImp::exists ( int  id)
inline

Definition at line 114 of file dbaccess.cpp.

Referenced by add(), and SingleValue::exists().

◆ exists() [2/2]

bool SingleValueImp::exists ( const QString &  name,
int *  id = nullptr 
)
inline

Definition at line 119 of file dbaccess.cpp.

◆ getList()

const entry_list& SingleValueImp::getList ( )
inline

Definition at line 131 of file dbaccess.cpp.

Referenced by SingleValue::getList().

◆ sort()

virtual bool SingleValueImp::sort ( const entry lhs,
const entry rhs 
)
inlinevirtual

Definition at line 151 of file dbaccess.cpp.

◆ cleanup()

void SingleValueImp::cleanup ( )
inline

Definition at line 156 of file dbaccess.cpp.

◆ find()

entry_map::iterator SingleValueImp::find ( const QString &  name)
inlineprivate

Definition at line 165 of file dbaccess.cpp.

Referenced by exists().

◆ fill_from_db()

void SingleValueImp::fill_from_db ( )
inlineprivate

Definition at line 175 of file dbaccess.cpp.

Referenced by load_data().

Member Data Documentation

◆ m_mutex

QMutex SingleValueImp::m_mutex
mutable

Definition at line 50 of file dbaccess.cpp.

Referenced by load_data().

◆ m_tableName

QString SingleValueImp::m_tableName
private

Definition at line 193 of file dbaccess.cpp.

Referenced by SingleValueImp().

◆ m_idName

QString SingleValueImp::m_idName
private

Definition at line 194 of file dbaccess.cpp.

Referenced by SingleValueImp().

◆ m_valueName

QString SingleValueImp::m_valueName
private

Definition at line 195 of file dbaccess.cpp.

Referenced by SingleValueImp().

◆ m_insertSql

QString SingleValueImp::m_insertSql
private

Definition at line 197 of file dbaccess.cpp.

Referenced by add(), and SingleValueImp().

◆ m_fillSql

QString SingleValueImp::m_fillSql
private

Definition at line 198 of file dbaccess.cpp.

Referenced by fill_from_db(), and SingleValueImp().

◆ m_deleteSql

QString SingleValueImp::m_deleteSql
private

Definition at line 199 of file dbaccess.cpp.

Referenced by remove(), and SingleValueImp().

◆ m_ready

bool SingleValueImp::m_ready {false}
private

Definition at line 201 of file dbaccess.cpp.

Referenced by cleanup(), and load_data().

◆ m_dirty

bool SingleValueImp::m_dirty {true}
private

Definition at line 202 of file dbaccess.cpp.

Referenced by add(), cleanup(), getList(), and remove().

◆ m_retEntries

entry_list SingleValueImp::m_retEntries
private

Definition at line 203 of file dbaccess.cpp.

Referenced by cleanup(), and getList().

◆ m_entries

entry_map SingleValueImp::m_entries
private

Definition at line 204 of file dbaccess.cpp.

Referenced by add(), cleanup(), exists(), fill_from_db(), find(), get(), getList(), and remove().

◆ m_cleanStub

SimpleCleanup<SingleValueImp> SingleValueImp::m_cleanStub
private

Definition at line 205 of file dbaccess.cpp.


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