Confdump Agent  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Public Types | Public Member Functions | Private Attributes
Confdump::Result Class Reference

The result of a query (a dynamic table) More...

#include <Result.hpp>

List of all members.

Public Types

typedef boost::shared_ptr
< System::ManagedElement
Row
 The type used for rows in this container.
typedef std::vector< RowRowSequence
 A sequence of rows (mostly useful to define other types)
typedef RowSequence::iterator iterator
 Iterator for this container.
typedef RowSequence::const_iterator const_iterator
 Const iterator for this container.
typedef
RowSequence::const_reference 
const_reference
 Reference to the element type (support for STL algorithms)

Public Member Functions

 Result ()
 ~Result ()
const_iterator begin () const
 The first element of the sequence (STL compat)
const_iterator end () const
 The past-the-end element of the sequence (STL compat)
void addRow (Row row)
 Add a result row.
void push_back (Row row)
 Standard alias for addRow.
QStringList propertyNames () const
 A list of all properties which can be found in this Result ("table heading").
QList< QVariant > propertyValues (Row row) const
 Table row contents for a Row.

Private Attributes

RowSequence rows_
std::set< QString > properties_

Detailed Description

The result of a query (a dynamic table)

A Result is a container for row (System::ManagedElement) objects, a sort of table (in database speak). As each row (System::ManagedElement) may have different fields, the table structure is dynamic and may include new "columns" (properties) after new rows are added.

Definition at line 43 of file Result.hpp.


Member Typedef Documentation

typedef RowSequence::const_iterator Confdump::Result::const_iterator

Const iterator for this container.

Definition at line 56 of file Result.hpp.

typedef RowSequence::const_reference Confdump::Result::const_reference

Reference to the element type (support for STL algorithms)

Definition at line 58 of file Result.hpp.

typedef RowSequence::iterator Confdump::Result::iterator

Iterator for this container.

Definition at line 54 of file Result.hpp.

typedef boost::shared_ptr< System::ManagedElement > Confdump::Result::Row

The type used for rows in this container.

Definition at line 50 of file Result.hpp.

typedef std::vector< Row > Confdump::Result::RowSequence

A sequence of rows (mostly useful to define other types)

Definition at line 52 of file Result.hpp.


Constructor & Destructor Documentation

Definition at line 34 of file Result.cpp.

Definition at line 38 of file Result.cpp.


Member Function Documentation

Add a result row.

Definition at line 52 of file Result.cpp.

References properties_, and rows_.

Referenced by Confdump::System::WmiDumper::doQueryTable(), and push_back().

The first element of the sequence (STL compat)

Definition at line 42 of file Result.cpp.

References rows_.

Referenced by Confdump::System::WmiDumper::doComputerIdentifier().

The past-the-end element of the sequence (STL compat)

Definition at line 47 of file Result.cpp.

References rows_.

Referenced by Confdump::System::WmiDumper::doComputerIdentifier().

QStringList Confdump::Result::propertyNames ( ) const

A list of all properties which can be found in this Result ("table heading").

The list is not currently sorted in any meaningful order, and this order may change when new rows are added.

Definition at line 65 of file Result.cpp.

References properties_.

Referenced by Confdump::XmlFormatter::doPrintTable(), Confdump::TextFormatter::doPrintTable(), and propertyValues().

QList< QVariant > Confdump::Result::propertyValues ( Result::Row  row) const

Table row contents for a Row.

This returns, the "table row contents" matching the "table heading" of propertyNames(). In other words, the row properties are returned sorted according to the current propertyNames() order.

Each "cell" is stored in a QVariant, which can theoretically hold anything allowed by the Qt library. In practice, the dumpers make it contain :

  • QStrings and other values that can be converted to that type (ints, ...)
  • QByteArray for binary data
  • QList<QVariant> for recursion (on a single level though)
  • QVariant::Invalid

Definition at line 74 of file Result.cpp.

References propertyNames().

Referenced by Confdump::XmlFormatter::doPrintTable(), and Confdump::TextFormatter::doPrintTable().

void Confdump::Result::push_back ( Row  row) [inline]

Member Data Documentation

std::set<QString> Confdump::Result::properties_ [private]

Definition at line 93 of file Result.hpp.

Referenced by addRow(), and propertyNames().

Definition at line 92 of file Result.hpp.

Referenced by addRow(), begin(), and end().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends