I recently stumbled upon a interesting problem. The problem is, in the clas Filter, i don't have any problem calling getKriterium().ohodnot(). But when I want to call it in for example Filter_FI(), it doesn't work.
class Filter
{
public:
Filter() {};
SortedSequenceTable<H, O> vyfiltruj(SortedSequenceTable<H, O> pVstup) {
for (TableItem<H, O> *prem : pVstup) {
if (splnaKriterium(O)) {
table.insert(O);
}
}
return table;
}
virtual ~Filter() {};
void setKriterium(Kriterium<O, T>* pKriterium) { aKriterium = pKriterium; };
Kriterium<O, T>* getKriterium() { return aKriterium; };
protected:
virtual bool splnaFilter(const O& pObject, Kriterium<O, T>& pKrit) = 0;
private:
Kriterium<O, T>* aKriterium;
SortedSequenceTable<T, O>* table;
};
template<typename O, typename T, typename H>
class Filter_fi : public Filter<O, T, H>
{
public:
Filter_fi() {};
void setAlpha(T pAlpha) { alphaPARAM = pAlpha; };
T getAlpha() { return alphaPARAM; };
void test() {
getKriterium().ohodnot()// Here I want to call the function .ohodnot(), But it will not let me...
}
virtual ~Filter_fi() {};
protected:
virtual bool splnaFilter(const O& pObject) override { return (alphaPARAM); };
private:
T alphaPARAM;
};
I would be very glad if you could help me fix the problem.