Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XmlRpcTreeItem Class Reference

A wrapper around the XmlRpcValue including a parent pointer and convenience functions for the qt model interface. More...

#include <xmlRpcTreeItem.h>

Public Member Functions

XmlRpcTreeItemchild (unsigned int i)
 
unsigned int childCount () const
 
int childIndexOf (const XmlRpcTreeItem *child) const
 
QVariant data (int row, int column) const
 return the data in the map More...
 
bool isBool (int row, int column) const
 is the stored data a bool More...
 
XmlRpcTreeItemparent ()
 
int row () const
 Figure out which row/nth child we are for the parent. More...
 
bool setData (QVariant val)
 set data for this item More...
 
 XmlRpcTreeItem (XmlRpc::XmlRpcValue *data, XmlRpcTreeItem *parent, const std::string &path, ros::NodeHandle *nh)
 
 ~XmlRpcTreeItem ()
 

Protected Member Functions

void addChild (const std::string &name, XmlRpc::XmlRpcValue *childData)
 Create a child from its data. More...
 
void createChildren ()
 Create all children based on data. More...
 
void setParam ()
 write this XmlRpcValue to parameter server (for array childs). More...
 
QVariant xmlToVariant (XmlRpc::XmlRpcValue &val) const
 Convert a XmlRpcValue to QVariant - only leaf values are supported. More...
 

Protected Attributes

deque< XmlRpcTreeItem * > _children
 
XmlRpc::XmlRpcValue_data
 
ros::NodeHandle_nh
 
XmlRpcTreeItem_parent
 
std::string _path
 

Detailed Description

A wrapper around the XmlRpcValue including a parent pointer and convenience functions for the qt model interface.

There are two kinds of item: If the xmlrpcvalue is a map, this will be a real tree item with children. Otherwise it will be a leaf node only storing the value. The tree is build from the internal XmlRpcValue's maps.

Corresponding model indices should always refer to the parent item in its internal pointer.

A Model index consisting of an internal pointer (XmlRpcTreeItem) and index (row, col) refers to: The row'th child of the internal pointer. (col 0 = name, col 1 = value).

Definition at line 49 of file xmlRpcTreeItem.h.

Constructor & Destructor Documentation

◆ XmlRpcTreeItem()

XmlRpcTreeItem::XmlRpcTreeItem ( XmlRpc::XmlRpcValue data,
XmlRpcTreeItem parent,
const std::string &  path,
ros::NodeHandle nh 
)
Parameters
[in]paththe path in the parameter server to this item

Definition at line 35 of file xmlRpcTreeItem.cpp.

◆ ~XmlRpcTreeItem()

XmlRpcTreeItem::~XmlRpcTreeItem ( )

Definition at line 44 of file xmlRpcTreeItem.cpp.

Member Function Documentation

◆ addChild()

void XmlRpcTreeItem::addChild ( const std::string &  name,
XmlRpc::XmlRpcValue childData 
)
protected

Create a child from its data.

Definition at line 350 of file xmlRpcTreeItem.cpp.

◆ child()

XmlRpcTreeItem* XmlRpcTreeItem::child ( unsigned int  i)
inline

Definition at line 62 of file xmlRpcTreeItem.h.

◆ childCount()

unsigned int XmlRpcTreeItem::childCount ( ) const

Children are either from the struct and thus real children or from the array and thus contained in the array in _data.

Definition at line 55 of file xmlRpcTreeItem.cpp.

◆ childIndexOf()

int XmlRpcTreeItem::childIndexOf ( const XmlRpcTreeItem child) const

Definition at line 63 of file xmlRpcTreeItem.cpp.

◆ createChildren()

void XmlRpcTreeItem::createChildren ( )
protected

Create all children based on data.

Definition at line 335 of file xmlRpcTreeItem.cpp.

◆ data()

QVariant XmlRpcTreeItem::data ( int  row,
int  column 
) const

return the data in the map

Definition at line 140 of file xmlRpcTreeItem.cpp.

◆ isBool()

bool XmlRpcTreeItem::isBool ( int  row,
int  column 
) const

is the stored data a bool

Definition at line 175 of file xmlRpcTreeItem.cpp.

◆ parent()

XmlRpcTreeItem* XmlRpcTreeItem::parent ( )
inline

Definition at line 59 of file xmlRpcTreeItem.h.

◆ row()

int XmlRpcTreeItem::row ( ) const

Figure out which row/nth child we are for the parent.

Definition at line 75 of file xmlRpcTreeItem.cpp.

◆ setData()

bool XmlRpcTreeItem::setData ( QVariant  val)

set data for this item

Definition at line 207 of file xmlRpcTreeItem.cpp.

◆ setParam()

void XmlRpcTreeItem::setParam ( )
protected

write this XmlRpcValue to parameter server (for array childs).

Definition at line 326 of file xmlRpcTreeItem.cpp.

◆ xmlToVariant()

QVariant XmlRpcTreeItem::xmlToVariant ( XmlRpc::XmlRpcValue val) const
protected

Convert a XmlRpcValue to QVariant - only leaf values are supported.

Definition at line 85 of file xmlRpcTreeItem.cpp.

Member Data Documentation

◆ _children

deque<XmlRpcTreeItem*> XmlRpcTreeItem::_children
protected

Definition at line 102 of file xmlRpcTreeItem.h.

◆ _data

XmlRpc::XmlRpcValue* XmlRpcTreeItem::_data
protected

Definition at line 94 of file xmlRpcTreeItem.h.

◆ _nh

ros::NodeHandle* XmlRpcTreeItem::_nh
protected

Definition at line 100 of file xmlRpcTreeItem.h.

◆ _parent

XmlRpcTreeItem* XmlRpcTreeItem::_parent
protected

Definition at line 96 of file xmlRpcTreeItem.h.

◆ _path

std::string XmlRpcTreeItem::_path
protected

Definition at line 98 of file xmlRpcTreeItem.h.


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


qt_paramedit
Author(s): Christian Dornhege
autogenerated on Mon Feb 28 2022 23:37:51