VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtSensor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 
14 #include <boost/signals.hpp>
15 
16 #include <string>
17 #include <map>
18 
19 namespace makArchives { class DtSensorRecord; }
20 
21 namespace makVrv
22 {
23  class DtSensorController;
24 
31  {
32  public:
34  static const std::string theNullSensorName;
35 
37  DtSensor();
38 
40  virtual ~DtSensor();
41 
43  virtual std::string name() const;
44 
46  virtual std::string moduleName() const;
47 
49  virtual bool attributeExists(const std::string& attributeName);
50 
52 
53  virtual int attributeInt(const std::string& attributeName) const;
54  virtual float attributeFloat(const std::string& attributeName) const;
55  virtual bool attributeBool(const std::string& attributeName) const;
56  virtual const std::string& attributeString(const std::string& attributeName) const;
58 
60 
61  boost::signal<void (const std::string&, int)> signal_attributeChangedInt;
62  boost::signal<void (const std::string&, bool)> signal_attributeChangedBool;
63  boost::signal<void (const std::string&, const std::string&)> signal_attributeChangedString;
64  boost::signal<void (const std::string&, float)> signal_attributeChangedFloat;
66 
68  virtual void getRecord(makArchives::DtSensorRecord& record) const;
69 
71  virtual void setFromRecord(const makArchives::DtSensorRecord& record);
72 
73  protected:
74  friend class DtSensorController;
75 
77  virtual void setName(const std::string& name);
78 
80  virtual void setModuleName(const std::string& modName);
81 
83 
84  virtual void setAttribute(const std::string& attributeName, int val);
85  virtual void setAttribute(const std::string& attributeName, bool val);
86  virtual void setAttribute(const std::string& attributeName, float val);
87  virtual void setAttribute(const std::string& attributeName, const std::string& val);
89 
90  protected:
91  typedef std::map<std::string, int> AttributeMapInt;
92  typedef std::map<std::string, float> AttributeMapFloat;
93  typedef std::map<std::string, bool> AttributeMapBool;
94  typedef std::map<std::string, std::string> AttributeMapString;
95 
100 
101  std::string myName;
102  std::string myModuleName;
103  };
104 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)