|
Last change
on this file since 181488 was 2e8296, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Started development of World Class
|
-
Property mode
set to
100644
|
|
File size:
1.0 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 |
|
|---|
| 20 | class World : public Observable
|
|---|
| 21 | {
|
|---|
| 22 | public:
|
|---|
| 23 |
|
|---|
| 24 | /***** getter and setter *****/
|
|---|
| 25 | periodentafel* getPeriode();
|
|---|
| 26 | private:
|
|---|
| 27 | periodentafel *periode;
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | /***** singleton Stuff *****/
|
|---|
| 31 | public:
|
|---|
| 32 | static World* get();
|
|---|
| 33 | static void destroy();
|
|---|
| 34 | static World* reset();
|
|---|
| 35 |
|
|---|
| 36 | private:
|
|---|
| 37 | World();
|
|---|
| 38 | virtual ~World();
|
|---|
| 39 |
|
|---|
| 40 | static World *theWorld;
|
|---|
| 41 | // this mutex only saves the singleton pattern...
|
|---|
| 42 | // use other mutexes to protect internal data as well
|
|---|
| 43 | // this mutex handles access to the pointer, not to the object!!!
|
|---|
| 44 | static boost::mutex worldLock;
|
|---|
| 45 |
|
|---|
| 46 | /*****
|
|---|
| 47 | * some legacy stuff that is include for now but will be removed later
|
|---|
| 48 | *****/
|
|---|
| 49 | public:
|
|---|
| 50 | MoleculeListClass *getMolecules();
|
|---|
| 51 | private:
|
|---|
| 52 | MoleculeListClass *molecules;
|
|---|
| 53 | };
|
|---|
| 54 |
|
|---|
| 55 | #endif /* WORLD_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.