OpenZWave Library  1.2
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  class Value;
40 
43  class ValueStore
44  {
45  public:
46 
47  typedef map<uint32,Value*>::const_iterator Iterator;
48 
49  Iterator Begin(){ return m_values.begin(); }
50  Iterator End(){ return m_values.end(); }
51 
53  ~ValueStore();
54 
55  bool AddValue( Value* _value );
56  bool RemoveValue( uint32 const& _key );
57  Value* GetValue( uint32 const& _key )const;
58 
59  void RemoveCommandClassValues( uint8 const _commandClassId ); // Remove all the values associated with a command class
60 
61  private:
62  map<uint32,Value*> m_values;
63  };
64 
65 } // namespace OpenZWave
66 
67 #endif
68 
69 
70 
Iterator End()
Definition: ValueStore.h:50
Definition: Bitfield.h:34
Container that holds all of the values associated with a given node.
Definition: ValueStore.h:43
map< uint32, Value * >::const_iterator Iterator
Definition: ValueStore.h:47
~ValueStore()
Definition: ValueStore.cpp:41
bool RemoveValue(uint32 const &_key)
Definition: ValueStore.cpp:94
bool AddValue(Value *_value)
Definition: ValueStore.cpp:58
Value * GetValue(uint32 const &_key) const
Definition: ValueStore.cpp:175
unsigned int uint32
Definition: Defs.h:69
void RemoveCommandClassValues(uint8 const _commandClassId)
Definition: ValueStore.cpp:138
ValueStore()
Definition: ValueStore.h:52
Base class for values associated with a node.
Definition: Value.h:44
Iterator Begin()
Definition: ValueStore.h:49
unsigned char uint8
Definition: Defs.h:63