EdbusList.h
/*
* $Id: EdbusList.h 2839 2009-09-28 11:36:20Z karijes $
*
* D-BUS stuff
* Copyright (c) 2008 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_EDBUSLIST_H__
#define __EDELIB_EDBUSLIST_H__
#include "EdbusData.h"
#include "EdbusContainer.h"
EDELIB_NS_BEGIN
class EDELIB_API EdbusList : public EdbusContainer<EdbusData> {
private:
bool array_mode;
EdbusList();
public:
typedef EdbusContainer<EdbusData>::const_iterator const_iterator;
explicit EdbusList(bool a);
void append(const EdbusData& val);
void clear(void);
void remove(const EdbusData& val);
void remove_all(const EdbusData& val);
bool operator==(const EdbusList& other) const;
bool operator!=(const EdbusList& other) const { return !operator==(other); }
EdbusDataType value_type(void);
bool value_type_is_container(void);
bool list_is_array(void) const { return array_mode; }
bool list_is_struct(void) const { return !array_mode; }
const_iterator begin(void) const;
const_iterator end(void) const;
unsigned int size(void) const;
static EdbusList create_array(void) { return EdbusList(true); }
static EdbusList create_struct(void) { return EdbusList(false); }
};
inline EdbusList& operator<<(EdbusList& lst, const EdbusData& val) {
lst.append(val);
return lst;
}
EDELIB_NS_END
#endif
edelib::EdbusList::list_is_struct
bool list_is_struct(void) const
Definition: EdbusList.h:181
edelib::EdbusList::operator!=
bool operator!=(const EdbusList &other) const
Definition: EdbusList.h:159
edelib::EdbusData
Class for representing D-Bus data types.
Definition: EdbusData.h:110
edelib::EdbusList
A class representing D-Bus struct and array.
Definition: EdbusList.h:114
edelib::EdbusList::create_array
static EdbusList create_array(void)
Definition: EdbusList.h:202
edelib::EdbusList::const_iterator
EdbusContainer< EdbusData >::const_iterator const_iterator
Definition: EdbusList.h:123
edelib::EdbusList::append
void append(const EdbusData &val)
edelib::EdbusContainer
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
edelib::operator<<
EdbusList & operator<<(EdbusList &lst, const EdbusData &val)
Definition: EdbusList.h:219
edelib::EdbusList::create_struct
static EdbusList create_struct(void)
Definition: EdbusList.h:207
edelib::EdbusList::list_is_array
bool list_is_array(void) const
Definition: EdbusList.h:176
edelib::EdbusDataType
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41