Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102770466
system.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
Mon, Feb 24, 00:45
Size
973 B
Mime Type
text/x-c++
Expires
Wed, Feb 26, 00:45 (2 d)
Engine
blob
Format
Raw Data
Handle
24418807
Attached To
R7571 SP4E-TB-TL-FR
system.hh
View Options
#ifndef __SYSTEM__HH__
#define __SYSTEM__HH__
/* -------------------------------------------------------------------------- */
#include "my_types.hh"
#include "particle.hh"
#include <memory>
#include <vector>
/* -------------------------------------------------------------------------- */
//! Container for particles
class System {
/*
* No need for constructor/destructor with std::unique_ptr
*/
// List of particle pointers
using ParticleList = std::vector<std::shared_ptr<Particle>>;
// Methods
public:
//! Remove particle from vector
void removeParticle(UInt particle);
//! Get particle for specific id
Particle& getParticle(UInt i);
//! Add a particle to the system
void addParticle(const std::shared_ptr<Particle>& new_particle);
//! Get number of particles
UInt getNbParticles();
private:
ParticleList list_particles;
};
/* -------------------------------------------------------------------------- */
#endif //__SYSTEM__HH__
Event Timeline
Log In to Comment