Q4Wine  2.0
Q4Wine is a Qt GUI for Wine.
Public Member Functions | Protected Attributes | List of all members
q4wine::lib::DBObject Class Referenceabstract

Describes an abstract interface of object to q4wine db. More...

#include <q4wine/src/lib/dbobject.hpp>

Inheritance diagram for q4wine::lib::DBObject:
q4wine::lib::Dir q4wine::lib::WineApplication q4wine::lib::WinePrefix q4wine::lib::WineVersion

Public Member Functions

 DBObject (std::string tableName, intptr_t id=0)
 
virtual ~DBObject ()
 
virtual bool save (void)=0
 
void setId (intptr_t id)
 
intptr_t getId (void) const
 

Protected Attributes

DBEnginedb_
 
std::string tableName_
 
intptr_t id_
 

Detailed Description

This class provides common methods like load(), save(), delete() to child objects.

It also store associated row id.

Author
Alexey S. Malakhov breze.nosp@m.rk@g.nosp@m.mail..nosp@m.com

Constructor & Destructor Documentation

q4wine::lib::DBObject::DBObject ( std::string  tableName,
intptr_t  id = 0 
)
explicit

Constructs an DBObject object.

Parameters
tableNameThe q4wine database table name where the object is stored.
idThe associated row id. If it set to 0, then the object is not associated with any database record. See also: setId getId
q4wine::lib::DBObject::~DBObject ( )
virtual

Destroys this DBObject object.

Member Function Documentation

intptr_t q4wine::lib::DBObject::getId ( void  ) const
virtual bool q4wine::lib::DBObject::save ( void  )
pure virtual
void q4wine::lib::DBObject::setId ( intptr_t  id)

Member Data Documentation

DBEngine* q4wine::lib::DBObject::db_
protected
intptr_t q4wine::lib::DBObject::id_
protected
std::string q4wine::lib::DBObject::tableName_
protected

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