Esempio n. 1
0
 friend
 void interact (const flowing_particle& particle1,
                const flowing_particle& particle2,
                interaction_type& state)
 {
     if (abs_1(particle1.position - particle2.position) <= 1)
         state.set_merge();
 }
Esempio n. 2
0
 friend interaction::result_type
     interact(const flowing_particle& particle1,
              const flowing_particle& particle2)
 {
     if (abs_1(particle1.position - particle2.position) <= 1)
         return interaction::MERGE;
     else
         return interaction::NONE;
 }
Esempio n. 3
0
File: main.cpp Progetto: yoloo/study
    void test_1() {
        boost::shared_ptr<Implementor> imp1(boost::make_shared<SubImplementor1>());
        assert(imp1);
        boost::shared_ptr<Abstractor> abs_1(boost::make_shared<SubAbstrator>(imp1)); 
        assert(abs_1);
        abs_1->operation();

        boost::shared_ptr<Implementor> imp2(boost::make_shared<SubImplementor2>());
        assert(imp2);
        boost::shared_ptr<Abstractor> abs_2(boost::make_shared<SubAbstrator>(imp2));
        assert(abs_2);
        abs_2->operation();
    }