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