Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/state.h @ 4501

Last change on this file since 4501 was 4485, checked in by bensch, 19 years ago

orxonox/trunk: more documentation in util

File size: 1.1 KB
Line 
1/*!
2    \file state.h
3    \brief Definition of the States-singleton Class
4*/
5
6#ifndef _STATE_H
7#define _STATE_H
8
9#include "base_object.h"
10
11// FORWARD DEFINITION
12class PNode;
13
14//! A Singleton class, that handles some states about orxonox's objects
15class State : public BaseObject {
16
17 public:
18  /** \returns a Pointer to the only object of this Class */
19  inline static State* getInstance(void) { if (!singletonRef) singletonRef = new State();  return singletonRef; };
20
21  virtual ~State(void);
22
23  void setCamera(const PNode* camera, const PNode* cameraTarget);
24  /** \returns a Pointer to the PNode of the Camera */
25  const PNode* getCamera(void) const { return this->camera; };
26  /** \returns a Pointer to the CameraTarget */
27  const PNode* getCameraTarget(void) const { return this->cameraTarget; };
28
29 private:
30  State(void);
31  static State*       singletonRef;       //!< a reference to this class
32
33  const PNode*        camera;             //!< A reference to the camera
34  const PNode*        cameraTarget;       //!< a reference to the cameraTarget
35};
36
37#endif /* _STATE_H */
Note: See TracBrowser for help on using the repository browser.