dbus-cxx logo

DBus::MessageIterator Class Reference
[DBus Messages]

Extraction iterator allowing values to be retrieved from a message. More...

#include <messageiterator.h>

List of all members.

Public Member Functions

 MessageIterator ()
 MessageIterator (const Message &message)
 MessageIterator (DBusCxxPointer< Message > message)
const Messagemessage () const
 Returns a pointer to the message associated with this iterator or NULL if no message is associated.
DBusMessageIter * cobj ()
 Returns a pointer to the underlying DBusMessageIter object.
bool init (const Message &message)
 Initializes the iterator for the specified message.
void invalidate ()
 Invalidates the iterator.
bool is_valid () const
 True if this is a valid iterator.
bool has_next () const
 True if there are any more fields left to iterate over.
bool next ()
 Moves the iterator to the next field and invalidates it if it moves beyond the last field.
MessageIteratoroperator++ ()
MessageIterator operator++ (int)
bool operator== (const MessageIterator &other)
Type arg_type () const
 Returns the argument type that the iterator points to.
Type element_type () const
 Returns the element type of the array that the iterator points to.
bool is_fixed () const
 True if the element type is a fixed type.
bool is_container () const
 True if the iterator points to a container.
bool is_array () const
 True if the iterator points to an array.
bool is_dict () const
 True if the iterator points to a dictionary.
MessageIterator recurse ()
 If the iterator points to a container recurses into the container returning a sub-iterator.
std::string signature () const
 Returns the current signature of the iterator.
 operator bool ()
 TODO.
 operator uint8_t ()
 operator uint16_t ()
 operator int16_t ()
 operator uint32_t ()
 operator int32_t ()
 operator uint64_t ()
 operator int64_t ()
 operator double ()
 operator const char * ()
 operator char ()
 operator int8_t ()
 operator float ()
 operator long int ()
 operator unsigned long int ()
template<typename T >
 operator std::vector< 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 ()
const char * get_string ()
template<typename T >
std::vector< T > get_array ()
template<typename T >
void get_array (std::vector< T > &array)
template<typename T >
MessageIteratoroperator>> (std::vector< T > &v)
template<typename T >
MessageIteratoroperator>> (T &v)
template<typename T >
void value (T &temp)

Protected Attributes

const Messagem_message
DBusMessageIter m_cobj

Detailed Description

Extraction iterator allowing values to be retrieved from a message.

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>
Examples:

caller_raw.cpp.


Constructor & Destructor Documentation

DBus::MessageIterator::MessageIterator (  ) 

References m_cobj.

DBus::MessageIterator::MessageIterator ( const Message message  ) 

References init(), and m_cobj.

DBus::MessageIterator::MessageIterator ( DBusCxxPointer< Message message  ) 

Member Function Documentation

Type DBus::MessageIterator::arg_type (  )  const
DBusMessageIter * DBus::MessageIterator::cobj (  ) 

Returns a pointer to the underlying DBusMessageIter object.

References m_cobj.

Referenced by get_array().

Type DBus::MessageIterator::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::checked_type_cast(), m_cobj, DBus::TYPE_ARRAY, and DBus::TYPE_INVALID.

Referenced by is_dict(), and is_fixed().

template<typename T >
void DBus::MessageIterator::get_array ( std::vector< T > &  array  )  [inline]

References cobj().

template<typename T >
std::vector<T> DBus::MessageIterator::get_array (  )  [inline]

References cobj().

bool DBus::MessageIterator::get_bool (  ) 

References arg_type(), m_cobj, and DBus::TYPE_BOOLEAN.

Referenced by operator bool().

double DBus::MessageIterator::get_double (  ) 

References arg_type(), m_cobj, and DBus::TYPE_DOUBLE.

Referenced by operator double(), and operator float().

int16_t DBus::MessageIterator::get_int16 (  ) 

References arg_type(), m_cobj, and DBus::TYPE_INT16.

Referenced by operator int16_t().

int32_t DBus::MessageIterator::get_int32 (  ) 
int64_t DBus::MessageIterator::get_int64 (  ) 

References arg_type(), m_cobj, and DBus::TYPE_INT64.

Referenced by operator int64_t().

const char * DBus::MessageIterator::get_string (  ) 
uint16_t DBus::MessageIterator::get_uint16 (  ) 

References arg_type(), m_cobj, and DBus::TYPE_UINT16.

Referenced by operator uint16_t().

uint32_t DBus::MessageIterator::get_uint32 (  ) 
uint64_t DBus::MessageIterator::get_uint64 (  ) 

References arg_type(), m_cobj, and DBus::TYPE_UINT64.

Referenced by operator uint64_t().

uint8_t DBus::MessageIterator::get_uint8 (  ) 
bool DBus::MessageIterator::has_next (  )  const

True if there are any more fields left to iterate over.

References is_valid(), and m_cobj.

bool DBus::MessageIterator::init ( const Message message  ) 

Initializes the iterator for the specified message.

References DBus::Message::cobj(), m_cobj, and m_message.

Referenced by MessageIterator().

void DBus::MessageIterator::invalidate (  ) 

Invalidates the iterator.

References m_cobj, and m_message.

Referenced by next().

bool DBus::MessageIterator::is_array (  )  const

True if the iterator points to an array.

References arg_type(), and DBus::TYPE_ARRAY.

Referenced by is_dict().

bool DBus::MessageIterator::is_container (  )  const

True if the iterator points to a container.

References arg_type().

Referenced by recurse().

bool DBus::MessageIterator::is_dict (  )  const

True if the iterator points to a dictionary.

References element_type(), is_array(), and DBus::TYPE_DICT_ENTRY.

bool DBus::MessageIterator::is_fixed (  )  const

True if the element type is a fixed type.

References element_type().

bool DBus::MessageIterator::is_valid (  )  const

True if this is a valid iterator.

References arg_type(), DBus::Message::is_valid(), m_message, and DBus::TYPE_INVALID.

Referenced by has_next(), and next().

const Message * DBus::MessageIterator::message (  )  const

Returns a pointer to the message associated with this iterator or NULL if no message is associated.

References m_message.

bool DBus::MessageIterator::next (  ) 

Moves the iterator to the next field and invalidates it if it moves beyond the last field.

Returns:
true if the iterator moves forward, false if there is no next field and the iterator has been invalidated

References arg_type(), invalidate(), is_valid(), m_cobj, and DBus::TYPE_INVALID.

Referenced by operator++().

DBus::MessageIterator::operator bool (  ) 

TODO.

Add support for:

  • dbus_message_iter_get_fixed_array
  • dbus_message_iter_get_array_len

References arg_type(), get_bool(), DBus::TYPE_BOOLEAN, DBus::TYPE_BYTE, DBus::TYPE_DOUBLE, DBus::TYPE_INT16, DBus::TYPE_INT32, DBus::TYPE_INT64, DBus::TYPE_UINT16, DBus::TYPE_UINT32, and DBus::TYPE_UINT64.

DBus::MessageIterator::operator char (  ) 
DBus::MessageIterator::operator const char * (  ) 
DBus::MessageIterator::operator double (  ) 
DBus::MessageIterator::operator float (  ) 
DBus::MessageIterator::operator int16_t (  ) 
DBus::MessageIterator::operator int32_t (  ) 
DBus::MessageIterator::operator int64_t (  ) 
DBus::MessageIterator::operator int8_t (  ) 
DBus::MessageIterator::operator long int (  ) 
template<typename T >
DBus::MessageIterator::operator std::vector< T > (  )  [inline]
DBus::MessageIterator::operator uint16_t (  ) 
DBus::MessageIterator::operator uint32_t (  ) 
DBus::MessageIterator::operator uint64_t (  ) 
DBus::MessageIterator::operator uint8_t (  ) 
DBus::MessageIterator::operator unsigned long int (  ) 
MessageIterator DBus::MessageIterator::operator++ ( int   ) 
MessageIterator & DBus::MessageIterator::operator++ (  ) 

References next().

bool DBus::MessageIterator::operator== ( const MessageIterator other  ) 

References m_cobj, and m_message.

template<typename T >
MessageIterator& DBus::MessageIterator::operator>> ( T &  v  )  [inline]
template<typename T >
MessageIterator& DBus::MessageIterator::operator>> ( std::vector< T > &  v  )  [inline]
MessageIterator DBus::MessageIterator::recurse (  ) 

If the iterator points to a container recurses into the container returning a sub-iterator.

If the iterator does not point to a container returns an empty (invalid) iterator.

References is_container(), m_cobj, and m_message.

std::string DBus::MessageIterator::signature (  )  const

Returns the current signature of the iterator.

References m_cobj.

template<typename T >
void DBus::MessageIterator::value ( T &  temp  )  [inline]

Member Data Documentation

DBusMessageIter DBus::MessageIterator::m_cobj [protected]

The documentation for this class was generated from the following files:

Generated on Thu Mar 18 09:31:33 2010 for dbus-cxx by doxygen 1.6.1