moved FilterMatch definition to its own file, so as to remove the circular dependency between filter.h and particle.h

This commit is contained in:
John Tramm 2020-01-14 02:56:27 +00:00
parent b05dedb179
commit 3c43cb7d79
4 changed files with 23 additions and 26 deletions

View file

@ -7,8 +7,6 @@
#include <vector>
#include "openmc/particle.h"
#include "openmc/tallies/filter.h"
namespace openmc {

View file

@ -14,16 +14,10 @@
#include "openmc/constants.h"
#include "openmc/position.h"
#include "openmc/random_lcg.h"
#include "openmc/tallies/filter_match.h"
namespace openmc {
// The FilterMatch class is declared here to avoid circular definition, as it will
// be defined later in filter.h. This issue arrises because the Particle object
// defined in this file contains a data member (filter_match_), which is a vector
// of type FilterMatch. Likewise, filter.h has a class that contains a Particle
// member.
class FilterMatch;
//==============================================================================
// Constants
//==============================================================================

View file

@ -12,26 +12,10 @@
#include "openmc/constants.h"
#include "openmc/hdf5_interface.h"
#include "openmc/particle.h"
#include "openmc/tallies/filter_match.h"
#include "pugixml.hpp"
namespace openmc {
//==============================================================================
//! Stores bins and weights for filtered tally events.
//==============================================================================
class FilterMatch
{
public:
std::vector<int> bins_;
std::vector<double> weights_;
int i_bin_;
bool bins_present_ {false};
};
} // namespace openmc
namespace openmc {
//==============================================================================

View file

@ -0,0 +1,21 @@
#ifndef OPENMC_TALLIES_FILTERMATCH_H
#define OPENMC_TALLIES_FILTERMATCH_H
namespace openmc {
//==============================================================================
//! Stores bins and weights for filtered tally events.
//==============================================================================
class FilterMatch
{
public:
std::vector<int> bins_;
std::vector<double> weights_;
int i_bin_;
bool bins_present_ {false};
};
} // namespace openmc
#endif // OPENMC_TALLIES_FILTERMATCH_H