|
Last change
on this file since 42918b was 42918b, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Fixed some problems with the usage of Boost::threads
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * World.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Feb 3, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef WORLD_HPP_
|
|---|
| 9 | #define WORLD_HPP_
|
|---|
| 10 |
|
|---|
| 11 | #include <boost/thread.hpp>
|
|---|
| 12 |
|
|---|
| 13 | #include "Patterns/Observer.hpp"
|
|---|
| 14 | #include "Patterns/Cacheable.hpp"
|
|---|
| 15 |
|
|---|
| 16 | // forward declarations
|
|---|
| 17 | class periodentafel;
|
|---|
| 18 | class MoleculeListClass;
|
|---|
| 19 | class atom;
|
|---|
| 20 |
|
|---|
| 21 | class World : public Observable
|
|---|
| 22 | {
|
|---|
| 23 | public:
|
|---|
| 24 |
|
|---|
| 25 | /***** getter and setter *****/
|
|---|
| 26 | periodentafel* getPeriode();
|
|---|
| 27 | private:
|
|---|
| 28 | periodentafel *periode;
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | /***** singleton Stuff *****/
|
|---|
| 32 | public:
|
|---|
| 33 | static World* get();
|
|---|
| 34 | static void destroy();
|
|---|
| 35 | static World* reset();
|
|---|
| 36 |
|
|---|
| 37 | private:
|
|---|
| 38 | World();
|
|---|
| 39 | virtual ~World();
|
|---|
| 40 |
|
|---|
| 41 | static World *theWorld;
|
|---|
| 42 | // this mutex only saves the singleton pattern...
|
|---|
| 43 | // use other mutexes to protect internal data as well
|
|---|
| 44 | // this mutex handles access to the pointer, not to the object!!!
|
|---|
| 45 | static boost::mutex worldLock;
|
|---|
| 46 |
|
|---|
| 47 | /*****
|
|---|
| 48 | * some legacy stuff that is include for now but will be removed later
|
|---|
| 49 | *****/
|
|---|
| 50 | public:
|
|---|
| 51 | MoleculeListClass *getMolecules();
|
|---|
| 52 |
|
|---|
| 53 | // functions used for the WorldContent template mechanism
|
|---|
| 54 | void registerContent(atom *theAtom);
|
|---|
| 55 | private:
|
|---|
| 56 | MoleculeListClass *molecules;
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | #endif /* WORLD_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.