OpenZWave Library  1.6.986
ValueStore.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // ValueStore.h
4 //
5 // Container for Value objects
6 //
7 // Copyright (c) 2010 Mal Lansell <openzwave@lansell.org>
8 //
9 // SOFTWARE NOTICE AND LICENSE
10 //
11 // This file is part of OpenZWave.
12 //
13 // OpenZWave is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published
15 // by the Free Software Foundation, either version 3 of the License,
16 // or (at your option) any later version.
17 //
18 // OpenZWave is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25 //
26 //-----------------------------------------------------------------------------
27 
28 #ifndef _ValueStore_H
29 #define _ValueStore_H
30 
31 #include <map>
32 #include "Defs.h"
33 #include "value_classes/ValueID.h"
34 
35 class TiXmlElement;
36 
37 namespace OpenZWave
38 {
39  namespace Internal
40  {
41  namespace VC
42  {
43 
44  class Value;
45 
49  class ValueStore
50  {
51  public:
52 
53  typedef map<uint32, Value*>::const_iterator Iterator;
54 
56  {
57  return m_values.begin();
58  }
60  {
61  return m_values.end();
62  }
63 
65  {
66  }
67  ~ValueStore();
68 
69  bool AddValue(Value* _value);
70  bool RemoveValue(uint32 const& _key);
71  Value* GetValue(uint32 const& _key) const;
72 
73  void RemoveCommandClassValues(uint8 const _commandClassId); // Remove all the values associated with a command class
74 
75  private:
76  map<uint32, Value*> m_values;
77  };
78  } // namespace VC
79  } // namespace Internal
80 } // namespace OpenZWave
81 
82 #endif
83 
Definition: Bitfield.cpp:30
Iterator End()
Definition: ValueStore.h:59
ValueStore()
Definition: ValueStore.h:64
Iterator Begin()
Definition: ValueStore.h:55
Container that holds all of the values associated with a given node.
Definition: ValueStore.h:49
bool RemoveValue(uint32 const &_key)
Definition: ValueStore.cpp:104
unsigned int uint32
Definition: Defs.h:91
Value * GetValue(uint32 const &_key) const
Definition: ValueStore.cpp:182
~ValueStore()
Definition: ValueStore.cpp:46
Base class for values associated with a node.
Definition: Value.h:53
void RemoveCommandClassValues(uint8 const _commandClassId)
Definition: ValueStore.cpp:148
bool AddValue(Value *_value)
Definition: ValueStore.cpp:61
map< uint32, Value * >::const_iterator Iterator
Definition: ValueStore.h:53
unsigned char uint8
Definition: Defs.h:85