Ardour  9.0-pre0-582-g084a23a80d
Gtk::TreeModelColumnRecord Class Reference

#include <treemodelcolumn.h>

Inheritance diagram for Gtk::TreeModelColumnRecord:
[legend]

Public Member Functions

 TreeModelColumnRecord ()
 
virtual ~TreeModelColumnRecord ()
 
void add (TreeModelColumnBase &column)
 
unsigned int size () const
 
const GType * types () const
 

Private Member Functions

 TreeModelColumnRecord (const TreeModelColumnRecord &)
 
TreeModelColumnRecordoperator= (const TreeModelColumnRecord &)
 

Private Attributes

std::vector< GType > column_types_
 

Detailed Description

Typedefed as TreeModel::ColumnRecord. Keeps a record of TreeModelColumns.

ColumnRecord objects are used to setup a new instance of a TreeModel (or rather, a new instance of an implementation of the model, such as Gtk::ListStore or Gtk::TreeStore). It is convenient to do that by deriving from TreeModel::ColumnRecord:

class MyModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
MyModelColumns() { add(filename); add(description); add(thumbnail); }
};
void add(TreeModelColumnBase &column)

Whether or not you derive your own ColumnRecord, you need to add the TreeModelColumns to the ColumnRecord with the add() method.

A ColumnRecord instance, such as an instance of MyModelColumns should then be passed to ListStore::create() or TreeStore::create(). The TreeModelColumns, such as the members filename, description and thumbnail can then be used with Gtk::TreeRow::operator[]() to specify the column you're interested in.

Neither TreeModel::ColumnRecord nor the TreeModelColumns contain any real data – they merely describe what C++ type is stored in which column of a TreeModel, and save you from having to repeat that type information in several places.

Thus TreeModel::ColumnRecord can be made a singleton (as long as you make sure it's instantiated after Gtk::Main), even when creating multiple models from it.

Definition at line 70 of file treemodelcolumn.h.

Constructor & Destructor Documentation

◆ TreeModelColumnRecord() [1/2]

Gtk::TreeModelColumnRecord::TreeModelColumnRecord ( )

◆ ~TreeModelColumnRecord()

virtual Gtk::TreeModelColumnRecord::~TreeModelColumnRecord ( )
virtual

◆ TreeModelColumnRecord() [2/2]

Gtk::TreeModelColumnRecord::TreeModelColumnRecord ( const TreeModelColumnRecord )
private

Member Function Documentation

◆ add()

void Gtk::TreeModelColumnRecord::add ( TreeModelColumnBase column)

Adds a TreeModelColumn to this record. add() not only registers the column, but also assigns a column index to it. Once registered, the TreeModelColumn is final, and you're free to pass it around by value.

◆ operator=()

TreeModelColumnRecord& Gtk::TreeModelColumnRecord::operator= ( const TreeModelColumnRecord )
private

◆ size()

unsigned int Gtk::TreeModelColumnRecord::size ( ) const

◆ types()

const GType* Gtk::TreeModelColumnRecord::types ( ) const

Member Data Documentation

◆ column_types_

std::vector<GType> Gtk::TreeModelColumnRecord::column_types_
private

Definition at line 87 of file treemodelcolumn.h.


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