#include <variantiterator.h>
Public Member Functions | |
VariantIterator () | |
VariantIterator (const Variant *variant) | |
VariantIterator & | operator>> (Variant &v) |
template<typename T > | |
VariantIterator & | operator>> (T &v) |
operator bool () | |
operator uint8_t () | |
operator uint16_t () | |
operator int16_t () | |
operator uint32_t () | |
operator int32_t () | |
operator uint64_t () | |
operator int64_t () | |
operator double () | |
operator std::string () | |
operator DBus::Variant () | |
template<typename T > | |
operator std::vector< T > () | |
template<typename Key , typename Data > | |
operator std::map< Key, Data > () | |
template<typename ... T> | |
operator std::tuple< T... > () | |
bool | get_bool () |
uint8_t | get_uint8 () |
uint16_t | get_uint16 () |
int16_t | get_int16 () |
uint32_t | get_uint32 () |
int32_t | get_int32 () |
uint64_t | get_uint64 () |
int64_t | get_int64 () |
double | get_double () |
std::string | get_string () |
Variant | get_variant () |
Signature | get_signature () |
void | invalidate () |
bool | is_valid () const |
True if this is a valid iterator. More... | |
bool | has_next () const |
True if there are any more fields left to iterate over. More... | |
bool | next () |
Moves the iterator to the next field and invalidates it if it moves beyond the last field. More... | |
DataType | arg_type () const |
Returns the argument type that the iterator points to. More... | |
DataType | element_type () const |
Returns the element type of the array that the iterator points to. More... | |
VariantIterator & | operator++ () |
VariantIterator | operator++ (int) |
VariantIterator | recurse () |
bool | is_fixed () const |
True if the element type is a fixed type. More... | |
bool | is_container () const |
True if the iterator points to a container. More... | |
bool | is_array () const |
True if the iterator points to an array. More... | |
bool | is_dict () const |
True if the iterator points to a dictionary. More... | |
Private Member Functions | |
VariantIterator (DataType d, SignatureIterator sig, const Variant *variant, std::shared_ptr< Demarshaling > demarshal) | |
Create a new sub-iterator. More... | |
Private Attributes | |
std::shared_ptr< priv_data > | m_priv |
|
private |
Create a new sub-iterator.
d | The data type we are iterating over |
sig | The signature within the data type |
variant | Our parent variant |
demarshal | The demarshaller |
References DBus::ARRAY, DBus::Signature::begin(), DBus::DICT_ENTRY, m_priv, DBus::STRUCT, and DBus::VARIANT.
VariantIterator::VariantIterator | ( | const Variant * | variant | ) |
DBus::DataType VariantIterator::arg_type | ( | ) | const |
Returns the argument type that the iterator points to.
References m_priv.
Referenced by element_type(), get_bool(), get_double(), get_int16(), get_int32(), get_int64(), get_string(), get_uint16(), get_uint32(), get_uint64(), get_uint8(), is_array(), is_container(), is_fixed(), is_valid(), and next().
DBus::DataType VariantIterator::element_type | ( | ) | const |
Returns the element type of the array that the iterator points to.
If the iterator does not point to an array TYPE_INVALID is returned.
References arg_type(), DBus::ARRAY, DBus::INVALID, and m_priv.
Referenced by is_dict().
bool VariantIterator::get_bool | ( | ) |
References arg_type(), DBus::BOOLEAN, and m_priv.
Referenced by DBus::Variant::to_bool().
double VariantIterator::get_double | ( | ) |
References arg_type(), DBus::DOUBLE, and m_priv.
Referenced by DBus::Variant::to_double().
int16_t VariantIterator::get_int16 | ( | ) |
References arg_type(), DBus::INT16, and m_priv.
Referenced by DBus::Variant::to_int16().
int32_t VariantIterator::get_int32 | ( | ) |
References arg_type(), DBus::INT32, and m_priv.
Referenced by DBus::Variant::to_int32().
int64_t VariantIterator::get_int64 | ( | ) |
References arg_type(), DBus::INT64, and m_priv.
Referenced by DBus::Variant::to_int64().
DBus::Signature VariantIterator::get_signature | ( | ) |
References m_priv.
Referenced by DBus::Variant::to_signature().
std::string VariantIterator::get_string | ( | ) |
References arg_type(), m_priv, DBus::OBJECT_PATH, DBus::SIGNATURE, and DBus::STRING.
Referenced by DBus::Variant::to_path(), and DBus::Variant::to_string().
uint16_t VariantIterator::get_uint16 | ( | ) |
References arg_type(), m_priv, and DBus::UINT16.
Referenced by DBus::Variant::to_uint16().
uint32_t VariantIterator::get_uint32 | ( | ) |
References arg_type(), m_priv, and DBus::UINT32.
Referenced by DBus::Variant::to_uint32().
uint64_t VariantIterator::get_uint64 | ( | ) |
References arg_type(), m_priv, and DBus::UINT64.
Referenced by DBus::Variant::to_uint64().
uint8_t VariantIterator::get_uint8 | ( | ) |
References arg_type(), DBus::BYTE, and m_priv.
Referenced by DBus::Variant::to_uint8().
DBus::Variant VariantIterator::get_variant | ( | ) |
References DBus::Variant::createFromDemarshal(), and m_priv.
bool VariantIterator::has_next | ( | ) | const |
True if there are any more fields left to iterate over.
References is_valid(), and m_priv.
bool VariantIterator::is_array | ( | ) | const |
True if the iterator points to an array.
References arg_type(), and DBus::ARRAY.
Referenced by is_dict(), and operator std::vector< T >().
bool VariantIterator::is_container | ( | ) | const |
True if the iterator points to a container.
References arg_type(), and DBus::TypeInfo::is_container().
Referenced by recurse().
bool VariantIterator::is_dict | ( | ) | const |
True if the iterator points to a dictionary.
References DBus::DICT_ENTRY, element_type(), and is_array().
Referenced by operator std::map< Key, Data >().
bool VariantIterator::is_fixed | ( | ) | const |
True if the element type is a fixed type.
References arg_type(), and DBus::TypeInfo::is_fixed().
bool VariantIterator::is_valid | ( | ) | const |
True if this is a valid iterator.
References arg_type(), DBus::ARRAY, DBus::INVALID, and m_priv.
Referenced by has_next(), next(), operator std::map< Key, Data >(), and operator std::vector< T >().
bool VariantIterator::next | ( | ) |
Moves the iterator to the next field and invalidates it if it moves beyond the last field.
It is an error to call this function more than once in a row without a corresponding call to get_XXX/operator XXX.
References arg_type(), DBus::ARRAY, DBus::INVALID, invalidate(), is_valid(), and m_priv.
Referenced by operator std::map< Key, Data >(), operator++(), and operator>>().
VariantIterator::operator bool | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator DBus::Variant | ( | ) |
References DBus::VARIANT.
VariantIterator::operator double | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator int16_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator int32_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator int64_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
|
inline |
References is_dict(), is_valid(), next(), and recurse().
VariantIterator::operator std::string | ( | ) |
References DBus::OBJECT_PATH, DBus::SIGNATURE, and DBus::STRING.
|
inline |
References recurse().
|
inline |
References is_array(), is_valid(), and recurse().
VariantIterator::operator uint16_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator uint32_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator uint64_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator::operator uint8_t | ( | ) |
References DBus::BOOLEAN, DBus::BYTE, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::UINT16, DBus::UINT32, and DBus::UINT64.
VariantIterator & VariantIterator::operator++ | ( | ) |
References next().
VariantIterator VariantIterator::operator++ | ( | int | ) |
|
inline |
References next().
VariantIterator & VariantIterator::operator>> | ( | Variant & | v | ) |
References next().
VariantIterator VariantIterator::recurse | ( | ) |
References is_container(), m_priv, and VariantIterator().
Referenced by operator std::map< Key, Data >(), operator std::tuple< T... >(), and operator std::vector< T >().
|
private |