NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgDataManager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 #ifndef TG_DATA_MANAGER_H
20 #define TG_DATA_MANAGER_H
21 
29 // This application
30 #include "core/tgSenseable.h" //not sure why this needs to be included vs. just declared...
31 // The C++ Standard Library
32 #include <string>
33 #include <sstream>
34 #include <iostream>
35 #include <vector>
36 
37 // Forward declarations
38 class tgSensor;
39 class tgSensorInfo;
40 
48 {
49 public:
50 
56  tgDataManager();
57 
62  virtual ~tgDataManager();
63 
68  virtual void setup();
69 
73  virtual void teardown();
74 
81  virtual void step(double dt);
82 
90  virtual void addSenseable(tgSenseable* pSenseable);
91 
96  virtual void addSensorInfo(tgSensorInfo* pSensorInfo);
97 
104  virtual std::string toString() const;
105 
106  private:
107 
113  void addSensorsHelper(tgSenseable* pSenseable);
114 
115 protected:
116 
117  // Integrity predicate.
118  bool invariant() const;
119 
124  std::vector<tgSensor*> m_sensors;
125 
131  std::vector<tgSensorInfo*> m_sensorInfos;
132 
137  std::vector<tgSenseable*> m_senseables;
138 
139 };
140 
148 std::ostream&
149 operator<<(std::ostream& os, const tgDataManager& obj);
150 
151 #endif // TG_DATA_MANAGER_H
std::vector< tgSensor * > m_sensors
virtual void addSenseable(tgSenseable *pSenseable)
virtual void teardown()
virtual ~tgDataManager()
std::vector< tgSensorInfo * > m_sensorInfos
virtual void step(double dt)
virtual void addSensorInfo(tgSensorInfo *pSensorInfo)
std::ostream & operator<<(std::ostream &os, const tgDataManager &obj)
std::vector< tgSenseable * > m_senseables
virtual void setup()
virtual std::string toString() const
Constains the implementation of mixin class tgSenseable.