Hello, I am Quentin and I work on a project who should be modular. For that I designed a simple way to add more "database". Here a uml graphic of what I try to do: ____________ | Gtk::Widget| |----------------| |____________| /\ /\ /__\ /__\ ___________________| | | | _________ | _______|___ | Window| 1 | 0..* | Database | |----------- | --------------------------------- |---------------| |_________| | |___________| | /\ | /__\ ______|_____ | | Gtk::HBox | _________|__________ |----------------| | MYSQL::Database | |____________| |-------------------------| /\ |___________________| /__\ | |_______________________| My goal is to easily add different Database UI I tried to use resources from http://www.cprogramming.com/tutorial/virtual_inheritance.html and from http://www.cprogramming.com/tutorial/virtual_inheritance.html So in C++ I've got this MYSQL::Database namespace GUI {With MYSQL::Database::Database(std::string name) : Widget(), HBox(), GUI::Database(name), Database: namespace GUI {with Database::Database(std::string name) : Widget(), mName(name) { And I've this compilation error: In file included from /home/spartan-117/Documents/NSS/DBConceptor/GUI/src/main_window.cpp:5:0: /home/spartan-117/Documents/NSS/DBConceptor/GUI/include/mysql/database.h:12:7: warning: virtual base 'Gtk::Widget' inaccessible in 'NSS::DBConceptor::GUI::MYSQL::Database' due to ambiguity [-Wextra] class Database : public virtual Gtk::HBox, public GUI::Database { ^ /home/spartan-117/Documents/NSS/DBConceptor/GUI/src/main_window.cpp: In member function 'void NSS::DBConceptor::GUI::MainWindow::newDatabase()': /home/spartan-117/Documents/NSS/DBConceptor/GUI/src/main_window.cpp:73:33: error: 'Gtk::Widget' is an ambiguous base of 'NSS::DBConceptor::GUI::MYSQL::Database' this->mMainBox.pack_start(*dab);
If you could help me I'll be really happy.
Regards, Quentin Huot-Marchand |