VR-Forces 4.5 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;
65  boost::signal<void (const DtSensor*)> signal_setFromRecord;
66 
68 
70  virtual void getRecord(makArchives::DtSensorRecord& record) const;
71 
73  virtual void setFromRecord(const makArchives::DtSensorRecord& record);
74 
75  protected:
76  friend class DtSensorController;
77 
79  virtual void setName(const std::string& name);
80 
82  virtual void setModuleName(const std::string& modName);
83 
85 
86  virtual void setAttribute(const std::string& attributeName, int val);
87  virtual void setAttribute(const std::string& attributeName, bool val);
88  virtual void setAttribute(const std::string& attributeName, float val);
89  virtual void setAttribute(const std::string& attributeName, const std::string& val);
91 
92  protected:
93  typedef std::map<std::string, int> AttributeMapInt;
94  typedef std::map<std::string, float> AttributeMapFloat;
95  typedef std::map<std::string, bool> AttributeMapBool;
96  typedef std::map<std::string, std::string> AttributeMapString;
97 
102 
103  std::string myName;
104  std::string myModuleName;
105  };
106 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)