FSimpleLeaf.hpp 1.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#ifndef FSIMPLELEAF_HPP
#define FSIMPLELEAF_HPP
// /!\ Please, you must read the license at the bottom of this page

#include "../Containers/FList.hpp"
#include "FAbstractLeaf.hpp"

/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FSimpleLeaf
* @brief
* Please read the license
* This class is used as a leaf in simple system (source AND target)
* here there is only one list that store all particles.
*/
template< class ParticleClass >
class FSimpleLeaf : public FAbstractLeaf<ParticleClass> {
    FList<ParticleClass*> particles;

public:
    /** Default destructor */
    virtual ~FSimpleLeaf(){
    }

    /**
        * To add a new particle in the leaf
        * @param particle the new particle
        */
    void push(ParticleClass* const particle){
        this->particles.pushFront(particle);
    }

    /**
        * To get all the sources in a leaf
        * @return a pointer to the list of particles that are sources
        */
    FList<ParticleClass*>* getSrc() {
        return &this->particles;
    }

    /**
        * To get all the target in a leaf
        * @return a pointer to the list of particles that are targets
        */
    FList<ParticleClass*>* getTargets() {
        return &this->particles;
    }

};


#endif //FSIMPLELEAF_HPP

// [--LICENSE--]