Ignore:
Timestamp:
Mar 10, 2010, 5:51:48 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
4fc41a
Parents:
025ca2
Message:

Added generic singleton Pattern that can be inherited to any class making that class a singleton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/listofbondsunittest.cpp

    r025ca2 r4c60ef  
    5151
    5252  // construct periodentafel
    53   tafel = World::get()->getPeriode();
     53  tafel = World::getInstance().getPeriode();
    5454  tafel->AddElement(hydrogen);
    5555
    5656  // construct molecule (tetraeder of hydrogens)
    57   TestMolecule = World::get()->createMolecule();
    58   Walker = World::get()->createAtom();
     57  TestMolecule = World::getInstance().createMolecule();
     58  Walker = World::getInstance().createAtom();
    5959  Walker->type = hydrogen;
    6060  Walker->node->Init(1., 0., 1. );
    6161  TestMolecule->AddAtom(Walker);
    62   Walker = World::get()->createAtom();
     62  Walker = World::getInstance().createAtom();
    6363  Walker->type = hydrogen;
    6464  Walker->node->Init(0., 1., 1. );
    6565  TestMolecule->AddAtom(Walker);
    66   Walker = World::get()->createAtom();
     66  Walker = World::getInstance().createAtom();
    6767  Walker->type = hydrogen;
    6868  Walker->node->Init(1., 1., 0. );
    6969  TestMolecule->AddAtom(Walker);
    70   Walker = World::get()->createAtom();
     70  Walker = World::getInstance().createAtom();
    7171  Walker->type = hydrogen;
    7272  Walker->node->Init(0., 0., 0. );
     
    8282{
    8383  // remove
    84   World::get()->destroyMolecule(TestMolecule);
     84  World::getInstance().destroyMolecule(TestMolecule);
    8585  // note that all the atoms, molecules, the tafel and the elements
    8686  // are all cleaned when the world is destroyed
    87   World::destroy();
     87  World::purgeInstance();
    8888  MemoryUsageObserver::purgeInstance();
    8989  logger::purgeInstance();
     
    250250
    251251  // remove atom2
    252   World::get()->destroyAtom(atom2);
     252  World::getInstance().destroyAtom(atom2);
    253253
    254254  // check bond if removed from other atom
Note: See TracChangeset for help on using the changeset viewer.