Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65190497
particles_factory_interface.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 1, 16:57
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Jun 3, 16:57 (2 d)
Engine
blob
Format
Raw Data
Handle
17975279
Attached To
R9482 SP4E_Homework_Ashtari_Sieber
particles_factory_interface.hh
View Options
#ifndef __PARTICLES_FACTORY_INTERFACE__HH__
#define __PARTICLES_FACTORY_INTERFACE__HH__
/* -------------------------------------------------------------------------- */
#include "system_evolution.hh"
/* -------------------------------------------------------------------------- */
//! Abstract factory defining interface
class ParticlesFactoryInterface {
// Constructors/Destructors
protected:
//! Instance constructor (protected)
ParticlesFactoryInterface() = default;
public:
virtual ~ParticlesFactoryInterface() = default;
// Methods
public:
//! Create a whole simulation from file
virtual SystemEvolution& createSimulation(const std::string& fname,
Real timestep,
int argc, char** argv) = 0;
//! Create a new particle
virtual std::unique_ptr<Particle> createParticle() = 0;
//! Get singleton instance
static ParticlesFactoryInterface& getInstance();
// Members
protected:
std::vector<Particle*> list_particles;
std::unique_ptr<SystemEvolution> system_evolution = nullptr;
// Standard pointer because constructor is protected (cannot use make_unique)
static ParticlesFactoryInterface* factory;
};
/* -------------------------------------------------------------------------- */
#endif //__PARTICLES_FACTORY_INTERFACE__HH__
Event Timeline
Log In to Comment