edelib 2.1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

EdbusDict.h
1 /*
2 * $Id: EdbusDict.h 3295 2012-05-15 12:52:41Z karijes $
3 *
4 * D-BUS stuff
5 * Copyright (c) 2008 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_EDBUSDICT_H__
22 #define __EDELIB_EDBUSDICT_H__
23
24 #include "EdbusData.h"
25 #include "EdbusContainer.h"
26
27 EDELIB_NS_BEGIN
28
34 struct EDELIB_API EdbusDictEntry {
36 EdbusData key;
38 EdbusData value;
39
43 bool operator==(const EdbusDictEntry& other) const {
44 if(key == other.key && value == other.value)
45 return true;
46 return false;
47 }
48
52 bool operator!=(const EdbusDictEntry& other) const { return !operator==(other); }
53 };
54
121 struct EDELIB_API EdbusDict : public EdbusContainer<EdbusDictEntry> {
125 typedef EdbusContainer<EdbusDictEntry>::const_iterator const_iterator;
126
134 void append(const EdbusData& key, const EdbusData& value);
135
139 void clear(void);
140
147 void remove(const EdbusData& key);
148
156 EdbusData find(const EdbusData& key);
157
161 bool operator==(const EdbusDict& other);
162
166 bool operator!=(const EdbusDict& other) { return !operator==(other); }
167
171 EdbusDataType key_type(void);
172
176 EdbusDataType value_type(void);
177
181 bool value_type_is_container(void);
182
186 const_iterator begin(void) const;
187
192 const_iterator end(void) const;
193
197 unsigned int size(void) const;
198 };
199
200 EDELIB_NS_END
201 #endif
edelib::EdbusDictEntry::operator==
bool operator==(const EdbusDictEntry &other) const
Definition: EdbusDict.h:43
edelib::EdbusData
Class for representing D-Bus data types.
Definition: EdbusData.h:110
edelib::EdbusDictEntry::operator!=
bool operator!=(const EdbusDictEntry &other) const
Definition: EdbusDict.h:52
edelib::EdbusDictEntry::value
EdbusData value
Definition: EdbusDict.h:38
edelib::EdbusDict::operator!=
bool operator!=(const EdbusDict &other)
Definition: EdbusDict.h:166
edelib::EdbusDict
Dictionary container for D-Bus types.
Definition: EdbusDict.h:121
edelib::EdbusContainer
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
edelib::EdbusDictEntry
An entry in EdbusDict.
Definition: EdbusDict.h:34
edelib::EdbusDictEntry::key
EdbusData key
Definition: EdbusDict.h:36
edelib::EdbusDict::const_iterator
EdbusContainer< EdbusDictEntry >::const_iterator const_iterator
Definition: EdbusDict.h:125
edelib::EdbusDataType
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41