Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Friends | List of all members
datatools::configuration::ui::tree_item Class Reference

Node/item of the tree model wrapping a variant registry record. More...

#include <bayeux/datatools/configuration/ui/variant_registry_tree_model.h>

Inheritance diagram for datatools::configuration::ui::tree_item:
datatools::i_tree_dumpable

Public Types

enum  column_index { CI_KEY = 0, CI_TYPE = 1, CI_VALUE = 2, CI_DESCRIPTION = 3 }
 Index of the column for record rendering. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

 tree_item (variant_record &vr_, tree_item *parent_=0)
 Default constructor. More...
 
virtual ~tree_item ()
 Destructor. More...
 
void append_child (tree_item *child_)
 Append a child item. More...
 
tree_itemgrab_child (int row_)
 Return a mutable child per row. More...
 
const tree_itemget_child (int row_) const
 Return a non mutable child per row. More...
 
int get_child_count () const
 Return the number of children. More...
 
int get_column_count () const
 Return the number of column. More...
 
variant_recordgrab_record ()
 Return the mutable handled variant record. More...
 
const variant_recordget_record () const
 Return the non mutable handled variant record. More...
 
int get_row () const
 Return the current row for this item. More...
 
bool has_parent () const
 Check if the node has a parent. More...
 
tree_itemgrab_parent ()
 Return the mutable parent item. More...
 
const tree_itemget_parent () const
 Return the non mutable parent item. More...
 
QVariant data (int column_) const
 Return the data stored at a given column. More...
 
bool setData (int column_, const QVariant &value_)
 Set the data stored at a given column. More...
 
bool unsetData (int column_)
 Unset the data stored at a given column. More...
 
void set_parent (tree_item *parent_)
 Set the parent tree item. More...
 
void set_logging (datatools::logger::priority p_)
 Set the logging priority. More...
 
datatools::logger::priority get_logging () const
 Return the logging priority. More...
 
QList< tree_item * > & grab_children ()
 Return the mutable list of children. More...
 
const QList< tree_item * > & get_children () const
 Return the non mutable list of children. More...
 
virtual void tree_dump (std::ostream &out=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Friends

class variant_registry_tree_model
 

Additional Inherited Members

- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Detailed Description

Node/item of the tree model wrapping a variant registry record.

Member Enumeration Documentation

◆ column_index

Index of the column for record rendering.

Enumerator
CI_KEY 

The index of the 'Key' column.

CI_TYPE 

The index of the 'Type' column.

CI_VALUE 

The index of the 'Value' column.

CI_DESCRIPTION 

The index of the 'Description' column.

Constructor & Destructor Documentation

◆ tree_item()

datatools::configuration::ui::tree_item::tree_item ( variant_record vr_,
tree_item parent_ = 0 
)

Default constructor.

◆ ~tree_item()

virtual datatools::configuration::ui::tree_item::~tree_item ( )
virtual

Destructor.

Member Function Documentation

◆ append_child()

void datatools::configuration::ui::tree_item::append_child ( tree_item child_)

Append a child item.

◆ data()

QVariant datatools::configuration::ui::tree_item::data ( int  column_) const

Return the data stored at a given column.

column_ the column index (0: key, 1: type, 2: value)
Returns
a QVariant hosting the value

◆ get_child()

const tree_item* datatools::configuration::ui::tree_item::get_child ( int  row_) const

Return a non mutable child per row.

◆ get_child_count()

int datatools::configuration::ui::tree_item::get_child_count ( ) const

Return the number of children.

◆ get_children()

const QList<tree_item *>& datatools::configuration::ui::tree_item::get_children ( ) const

Return the non mutable list of children.

◆ get_column_count()

int datatools::configuration::ui::tree_item::get_column_count ( ) const

Return the number of column.

◆ get_logging()

datatools::logger::priority datatools::configuration::ui::tree_item::get_logging ( ) const

Return the logging priority.

◆ get_parent()

const tree_item* datatools::configuration::ui::tree_item::get_parent ( ) const

Return the non mutable parent item.

◆ get_record()

const variant_record& datatools::configuration::ui::tree_item::get_record ( ) const

Return the non mutable handled variant record.

◆ get_row()

int datatools::configuration::ui::tree_item::get_row ( ) const

Return the current row for this item.

◆ grab_child()

tree_item* datatools::configuration::ui::tree_item::grab_child ( int  row_)

Return a mutable child per row.

◆ grab_children()

QList<tree_item *>& datatools::configuration::ui::tree_item::grab_children ( )

Return the mutable list of children.

◆ grab_parent()

tree_item* datatools::configuration::ui::tree_item::grab_parent ( )

Return the mutable parent item.

◆ grab_record()

variant_record& datatools::configuration::ui::tree_item::grab_record ( )

Return the mutable handled variant record.

◆ has_parent()

bool datatools::configuration::ui::tree_item::has_parent ( ) const

Check if the node has a parent.

◆ set_logging()

void datatools::configuration::ui::tree_item::set_logging ( datatools::logger::priority  p_)

Set the logging priority.

◆ set_parent()

void datatools::configuration::ui::tree_item::set_parent ( tree_item parent_)

Set the parent tree item.

◆ setData()

bool datatools::configuration::ui::tree_item::setData ( int  column_,
const QVariant &  value_ 
)

Set the data stored at a given column.

◆ tree_dump()

virtual void datatools::configuration::ui::tree_item::tree_dump ( std::ostream &  out = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

◆ unsetData()

bool datatools::configuration::ui::tree_item::unsetData ( int  column_)

Unset the data stored at a given column.

Friends And Related Function Documentation

◆ variant_registry_tree_model

friend class variant_registry_tree_model
friend

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