Probably null change: make sure that all classes with destructors also have copy constructors and assignment operators

This commit is contained in:
Jean-Francois Dockes
2021-11-23 16:38:11 +01:00
parent f813c1356e
commit 756a944ef3
75 changed files with 282 additions and 165 deletions
+4
View File
@@ -78,6 +78,8 @@ class DocSequence {
public:
DocSequence(const std::string &t) : m_title(t) {}
virtual ~DocSequence() {}
DocSequence(const DocSequence&) = delete;
DocSequence& operator=(const DocSequence&) = delete;
/** Get document at given rank.
*
@@ -181,6 +183,8 @@ public:
: DocSequence(""), m_seq(iseq)
{}
virtual ~DocSeqModifier() {}
DocSeqModifier(const DocSeqModifier&) = delete;
DocSeqModifier& operator=(const DocSeqModifier&) = delete;
virtual bool getAbstract(Rcl::Doc& doc, std::vector<std::string>& abs)
override{
+2
View File
@@ -30,6 +30,8 @@ public:
std::shared_ptr<Rcl::Query> q, const std::string &t,
std::shared_ptr<Rcl::SearchData> sdata);
virtual ~DocSequenceDb() {}
DocSequenceDb(const DocSequenceDb&) = delete;
DocSequenceDb& operator=(const DocSequenceDb&) = delete;
virtual bool getDoc(int num, Rcl::Doc &doc, std::string * = 0) override;
virtual int getResCnt() override;
virtual void getTerms(HighlightData& hld) override;
+4 -4
View File
@@ -31,10 +31,10 @@ class DocSequenceDocs : public DocSequence {
public:
DocSequenceDocs(std::shared_ptr<Rcl::Db> d,
const std::vector<Rcl::Doc> docs, const string &t)
: DocSequence(t), m_db(d), m_docs(docs) {
}
virtual ~DocSequenceDocs() {
}
: DocSequence(t), m_db(d), m_docs(docs) {}
virtual ~DocSequenceDocs() {}
DocSequenceDocs(const DocSequenceDocs&) = delete;
DocSequenceDocs& operator=(const DocSequenceDocs&) = delete;
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0) {
if (sh)
*sh = string();
+4
View File
@@ -35,6 +35,8 @@ class RclDHistoryEntry : public DynConfEntry {
RclDHistoryEntry(time_t t, const std::string& u, const std::string& d)
: unixtime(t), udi(u), dbdir(d) {}
virtual ~RclDHistoryEntry() {}
RclDHistoryEntry(const RclDHistoryEntry&) = default;
RclDHistoryEntry& operator=(const RclDHistoryEntry&) = default;
virtual bool decode(const std::string &value);
virtual bool encode(std::string& value);
virtual bool equal(const DynConfEntry& other);
@@ -52,6 +54,8 @@ class DocSequenceHistory : public DocSequence {
const std::string &t)
: DocSequence(t), m_db(db), m_hist(h) {}
virtual ~DocSequenceHistory() {}
DocSequenceHistory(const DocSequenceHistory&) = delete;
DocSequenceHistory& operator=(const DocSequenceHistory&) = delete;
virtual bool getDoc(int num, Rcl::Doc &doc, std::string *sh = 0);
virtual int getResCnt();
+5
View File
@@ -49,7 +49,10 @@
/** Interface for a stored object. */
class DynConfEntry {
public:
DynConfEntry() {}
virtual ~DynConfEntry() {}
DynConfEntry(const DynConfEntry&) = default;
DynConfEntry& operator=(const DynConfEntry&) = default;
/** Decode object-as-string coming out from storage */
virtual bool decode(const std::string &value) = 0;
/** Encode object state into state for storing */
@@ -63,6 +66,8 @@ class RclSListEntry : public DynConfEntry {
public:
RclSListEntry() {}
virtual ~RclSListEntry() {}
RclSListEntry(const RclSListEntry&) = default;
RclSListEntry& operator=(const RclSListEntry&) = default;
RclSListEntry(const std::string& v)
: value(v) {
}
+2
View File
@@ -37,6 +37,8 @@ class DocSeqFiltered : public DocSeqModifier {
public:
DocSeqFiltered(RclConfig *conf, std::shared_ptr<DocSequence> iseq, DocSeqFiltSpec &filtspec);
virtual ~DocSeqFiltered() {}
DocSeqFiltered(const DocSeqFiltered&) = delete;
DocSeqFiltered& operator=(const DocSeqFiltered&) = delete;
virtual bool canFilter() {return true;}
virtual bool setFiltSpec(const DocSeqFiltSpec &filtspec);
virtual bool getDoc(int num, Rcl::Doc &doc, std::string *sh = 0);
+3
View File
@@ -31,7 +31,10 @@
*/
class PlainToRich {
public:
PlainToRich() {}
virtual ~PlainToRich() {}
PlainToRich(const PlainToRich&) = delete;
PlainToRich& operator=(const PlainToRich&) = delete;
void set_inputhtml(bool v) {
m_inputhtml = v;
+3 -5
View File
@@ -37,6 +37,8 @@ class QResultStore {
public:
QResultStore();
~QResultStore();
QResultStore(const QResultStore&) = delete;
QResultStore& operator=(const QResultStore&) = delete;
/**
* Fetch and store the results of the input query.
@@ -46,8 +48,7 @@ public:
* @param isinc if true, the field list defines the fields to be stored,
* else, those to be excluded.
*/
bool storeQuery(Rcl::Query& q, std::set<std::string> fldspec = {},
bool isinc = false);
bool storeQuery(Rcl::Query& q, std::set<std::string> fldspec = {}, bool isinc = false);
/** Retrieve count of stored results */
int getCount();
@@ -60,9 +61,6 @@ public:
*/
const char *fieldValue(int docindex, const std::string& fldname);
QResultStore(const QResultStore&) = delete;
QResultStore& operator=(const QResultStore&) = delete;
class Internal;
private:
Internal *m{nullptr};
+2
View File
@@ -35,6 +35,8 @@ class ResListPager {
public:
ResListPager(int pagesize=10, bool alwaysSnippets = false);
virtual ~ResListPager() {}
ResListPager(const ResListPager&) = delete;
ResListPager& operator=(const ResListPager&) = delete;
void setHighLighter(PlainToRich *ptr) {
m_hiliter = ptr;
+4 -3
View File
@@ -31,11 +31,12 @@
class DocSeqSorted : public DocSeqModifier {
public:
DocSeqSorted(std::shared_ptr<DocSequence> iseq, DocSeqSortSpec &sortspec)
: DocSeqModifier(iseq)
{
setSortSpec(sortspec);
: DocSeqModifier(iseq) {
setSortSpec(sortspec);
}
virtual ~DocSeqSorted() {}
DocSeqSorted(const DocSeqSorted&) = delete;
DocSeqSorted& operator=(const DocSeqSorted&) = delete;
virtual bool canSort() {return true;}
virtual bool setSortSpec(const DocSeqSortSpec &sortspec);
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
+2
View File
@@ -39,6 +39,8 @@ public:
: m_stemlang(sl), m_autosuffs(as), m_config(c) {}
~WasaParserDriver() {}
WasaParserDriver(const WasaParserDriver&) = delete;
WasaParserDriver& operator=(const WasaParserDriver&) = delete;
Rcl::SearchData *parse(const std::string&);
bool addClause(Rcl::SearchData *sd, Rcl::SearchDataClauseSimple* cl);