add placeholder skeleton for MCPL-input

This commit is contained in:
Erik B Knudsen 2022-06-22 22:50:07 +02:00
parent bab55c0b69
commit debc085cf6
2 changed files with 40 additions and 0 deletions

View file

@ -100,6 +100,25 @@ private:
vector<SourceSite> sites_; //!< Source sites from a file
};
//==============================================================================
// MCPL-file input source
//==============================================================================
class MCPLFileSource : public Source {
public:
// Constructors, destructors
MCPLFileSource(std::string path);
~MCPLFileSource();
// Defer implementation to custom source library
SourceSite sample(uint64_t* seed) const override
private:
vector <SourceSite> sites_; //!<source sites from an MCPL-file
};
//==============================================================================
//! Wrapper for custom sources that manages opening/closing shared library
//==============================================================================

View file

@ -332,6 +332,27 @@ CustomSourceWrapper::~CustomSourceWrapper()
#endif
}
//===========================================================================
// Read an MCPL-file
//===========================================================================
MCPLFileSource::MCPLFileSource(std::string path)
{
// Check if source file exists
if (!file_exists(path)) {
fatal_error(fmt::format("Source file '{}' does not exist.", path));
}
// Read the source from a binary file instead of sampling from some
// assumed source distribution
write_message(6, "Reading source file from {}...", path);
// Open the mcpl file
id_t file_id = mcpl_open(path.c_str)
}
//==============================================================================
// Non-member functions
//==============================================================================