Bunch of raw pointers replaced with smart pointers of references.
This commit is contained in:
parent
5a199c9138
commit
ea035f58c8
20 changed files with 67 additions and 79 deletions
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef PGCONTAINER_H
|
||||
#ifndef PGCONTAINER_H
|
||||
#define PGCONTAINER_H
|
||||
|
||||
#include <QString>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <libpq-fe.h>
|
||||
|
||||
|
|
@ -12,7 +13,7 @@ class PgContainer {
|
|||
public:
|
||||
using t_Container = std::vector<T>; ///< Do not assume it will stay a vector only expect bidirectional access
|
||||
|
||||
explicit PgContainer(PgDatabaseCatalogue *cat)
|
||||
explicit PgContainer(std::weak_ptr<PgDatabaseCatalogue> cat)
|
||||
: m_catalogue(cat)
|
||||
{}
|
||||
|
||||
|
|
@ -60,7 +61,7 @@ public:
|
|||
return m_container.at(idx);
|
||||
}
|
||||
protected:
|
||||
PgDatabaseCatalogue *m_catalogue;
|
||||
std::weak_ptr<PgDatabaseCatalogue> m_catalogue;
|
||||
t_Container m_container;
|
||||
private:
|
||||
T m_invalidInstance;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue