Rework of catalog objects. Several of them are now inheriting from common
base classes that implement common functionality.
This commit is contained in:
parent
840af1e0a9
commit
73c4cf4790
45 changed files with 340 additions and 265 deletions
|
|
@ -1,25 +1,32 @@
|
|||
#ifndef PGOBJECT_H
|
||||
#define PGOBJECT_H
|
||||
|
||||
#include <libpq-fe.h>
|
||||
#include <QString>
|
||||
|
||||
class PgDatabaseCatalog;
|
||||
|
||||
class PgObject {
|
||||
public:
|
||||
explicit PgObject(PgDatabaseCatalog& cat);
|
||||
explicit PgObject(PgDatabaseCatalog& cat, Oid oid, const QString &name);
|
||||
virtual ~PgObject();
|
||||
|
||||
virtual QString objectName() const = 0;
|
||||
Oid oid() const;
|
||||
const QString& objectName() const;
|
||||
/// Default implementation uses objectName and add quotes when needed.
|
||||
virtual QString quotedObjectName() const;
|
||||
|
||||
bool operator==(Oid _oid) const { return m_oid == _oid; }
|
||||
bool operator==(const QString &n) const { return m_name == n; }
|
||||
bool operator<(Oid _oid) const { return m_oid < _oid; }
|
||||
bool operator<(const PgObject &rhs) const { return m_oid < rhs.m_oid; }
|
||||
protected:
|
||||
const PgDatabaseCatalog& catalog() const;
|
||||
|
||||
private:
|
||||
PgDatabaseCatalog* m_catalog;
|
||||
|
||||
Oid m_oid;
|
||||
QString m_name;
|
||||
};
|
||||
|
||||
#endif // PGOBJECT_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue