egami
C++ Image Processing program
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions
Catalogue< Tab, Page > Class Template Reference

A Gtk::Notebook with tabs management facilities. More...

#include <catalogue.hpp>

Inheritance diagram for Catalogue< Tab, Page >:
Inheritance graph
[legend]
Collaboration diagram for Catalogue< Tab, Page >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Catalogue ()
unsigned append (std::shared_ptr< Tab > tab, std::shared_ptr< Page > page)
 Appends a Tab and a Page to the Catalogue.
void remove (unsigned id)
 Removes the Tab and the Page associated with a given id.

Protected Types

typedef std::map< unsigned,
std::pair< std::shared_ptr
< Tab >, std::shared_ptr< Page > > > 
Pages

Protected Attributes

Pages pages

Private Member Functions

 static_assert (std::is_base_of< Gtk::Widget, Tab >::value,"The Tab type of a Catalogue must have Gtk::Widget as a base class")
 static_assert (std::is_base_of< Gtk::Widget, Page >::value,"The Page type of a Catalogue must have Gtk::Widget as a base class")

Detailed Description

template<class Tab, class Page>
class Catalogue< Tab, Page >

A Gtk::Notebook with tabs management facilities.

After the insertion of a Tab/Page pair, they can be accessed by an id returned by the Catalogue::append function. A map is used instead of the facility to retrieve tabs and pages' widgets of Gtk::Notebook in order to ensure type safety.

Template Parameters:
Tabtab's widget type (must have Gtk::Widget as base class)
Pagepage's widget type (must have Gtk::Widget as base class)

Definition at line 39 of file catalogue.hpp.


Member Typedef Documentation

template<class Tab, class Page>
typedef std::map<unsigned, std::pair<std::shared_ptr<Tab>, std::shared_ptr<Page> > > Catalogue< Tab, Page >::Pages [protected]

Definition at line 44 of file catalogue.hpp.


Constructor & Destructor Documentation

template<class Tab , class Page >
Catalogue< Tab, Page >::Catalogue ( )

Definition at line 126 of file catalogue.hpp.


Member Function Documentation

template<class Tab, class Page>
unsigned Catalogue< Tab, Page >::append ( std::shared_ptr< Tab >  tab,
std::shared_ptr< Page >  page 
)

Appends a Tab and a Page to the Catalogue.

The two objects can now be accessed by their id (returned by the function).

Parameters:
tabthe widget to display in the tab
pagethe widget to display in the page
Returns:
the id assigned to the new tab/page

Definition at line 132 of file catalogue.hpp.

Here is the caller graph for this function:

template<class Tab , class Page >
void Catalogue< Tab, Page >::remove ( unsigned  id)

Removes the Tab and the Page associated with a given id.

The Tab and the Page are also removed from Catalogue::pages and so, are destructed.

Parameters:
idthe id of the page to be removed from the Catalogue

Definition at line 141 of file catalogue.hpp.

Here is the caller graph for this function:

template<class Tab, class Page>
Catalogue< Tab, Page >::static_assert ( std::is_base_of< Gtk::Widget, Tab >::value  ,
"The Tab type of a Catalogue< Tab, Page > must have Gtk::Widget as a base class"   
) [private]
template<class Tab, class Page>
Catalogue< Tab, Page >::static_assert ( std::is_base_of< Gtk::Widget, Page >::value  ,
"The Page type of a Catalogue< Tab, Page > must have Gtk::Widget as a base class"   
) [private]

Member Data Documentation

template<class Tab, class Page>
Pages Catalogue< Tab, Page >::pages [protected]

Page and Tab objects managed by the Catalogue

Definition at line 70 of file catalogue.hpp.


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