mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Use dynamic_cast for filter type-checking
This commit is contained in:
parent
321b255aea
commit
91f4196f0f
11 changed files with 241 additions and 176 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue