Use dynamic_cast for filter type-checking

This commit is contained in:
Sterling Harper 2018-10-25 12:58:09 -04:00
parent 321b255aea
commit 91f4196f0f
11 changed files with 241 additions and 176 deletions

View file

@ -43,7 +43,7 @@ public:
class Filter
{
public:
virtual ~Filter() = 0;
virtual ~Filter() = default;
virtual std::string type() const = 0;
@ -76,8 +76,6 @@ public:
int n_bins_;
};
inline Filter::~Filter() {}
//==============================================================================
extern "C" void free_memory_tally_c();

View file

@ -29,6 +29,11 @@ public:
std::string text_label(int bin) const override;
virtual int32_t mesh() const {return mesh_;}
virtual void set_mesh(int32_t mesh);
protected:
int32_t mesh_;
};

View file

@ -10,12 +10,12 @@ class MeshSurfaceFilter : public MeshFilter
public:
std::string type() const override {return "meshsurface";}
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;
void set_mesh(int32_t mesh) override;
};
} // namespace openmc