SensorRegistry.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2011, SRI International (R)
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #ifndef __OpenKarto_SensorRegistry_h__
21 #define __OpenKarto_SensorRegistry_h__
22 
23 #include <OpenKarto/Referenced.h>
24 #include <OpenKarto/Identifier.h>
25 
26 namespace karto
27 {
28 
30 
31 
35  class Sensor;
36 
37  struct SensorRegistryPrivate;
38 
44  {
45  friend class Sensor;
46 
47  public:
52 
56  virtual ~SensorRegistry();
57 
58  public:
62  static SensorRegistry* GetInstance();
63 
64  public:
70  Sensor* GetSensorByName(const Identifier& rName);
71 
77  template<class C>
78  C* GetSensorByName(const Identifier& rName)
79  {
80  Sensor* pSensor = GetSensorByName(rName);
81 
82  return dynamic_cast<C*>(pSensor);
83  }
84 
89  static void Validate(Sensor* pSensor);
90 
94  void Clear();
95 
96  private:
102  void RegisterSensor(Sensor* pSensor);
103 
108  void UnregisterSensor(Sensor* pSensor);
109 
110  private:
112  };
113 
115 
116 }
117 
118 #endif // __OpenKarto_SensorRegistry_h__
C * GetSensorByName(const Identifier &rName)
#define KARTO_EXPORT
Definition: Macros.h:78
Definition: Any.cpp:20
SensorRegistryPrivate * m_pSensorRegistryPrivate


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Thu Jun 6 2019 19:20:24