Hi,
I've been developing this API, but now I get stuck in a compiling error
and I'm out of ideas. Some comments are welcome.
The hierarchy is bases in three classes, and I will explain it bellow in
detail.
The three classes are:
1 - IFolderManager -> abstract base class
2 - FolderManagerCo mmon : public IFolderManager
3 - FolderManager : public FolderManagerCo mmon
The properties of this relation are:
1 - IFolderManager has only abstract methods and no attributes.
2 - IFolderManagerC ommon implements a small set of methods from the base
class.
3 - IFolderManagerC ommon declares and implements some protected methods,
and as some private attributes.
4 - IFolderManagerC ommon has no constructors, since it is also an
abstract class (doesn't implement all the methods from the base class).
5 - FolderManager implements all the methods from the base class that
are not implemented by FolderManagerCo mmon.
6 - All the three classes have virtual destructors.
7 - All methods are virtual.
8 - Only FolderManager has constructors.
From this description we see that the union of FolderManagerCo mmon and
FolderManager implement all the methods declared by the interface (base
class).
The problem is that when I compile the code I get the following error:
.../src/common/FolderManagerCo mmon.h:7: error: candidates are:
FolderManagerCo mmon::FolderMan agerCommon(cons t FolderManagerCo mmon&)
This error points to the constructor of FolderManager, in
FolderManager.c xx. And I have no ideia of what is going on.
I've tried to explain to resume the error, so that there was no need to
look at the code. But I will place the code here also, in case I
couldn't explain myself:
--------------------------------------------------------------
IFolderManager. h
--------------------------------------------------------------
#ifndef IFOLDERMANAGER_ H
#define IFOLDERMANAGER_ H
#include "ITableManager. h"
#include <vector>
#include <string>
using namespace std;
/** @interface
* @stereotype base_class */
class IFolderManager {
public:
virtual IFolderManager* createFolder(co nst string& folderName,
const string& folderAttribute s,
const string& folderDescripti on) const
throw (TIDB_Exception ) =0;
virtual ITableManager* createTable(con st string& tableName,
ICondDBTable& table,
const string& tableAttributes ,
const string& tableDescriptio n) const
throw(TIDB_Exce ption)=0;
virtual void deleteFolder(co nst string& folderName) const
throw (TIDB_Exception ) = 0;
virtual void deleteTable(con st string& tableName) const
throw (TIDB_Exception ) = 0;
virtual IFolderManager* getFolderManage r(const string& folderName)
const
throw(TIDB_Exce ption)= 0;
virtual vector < IFolderManager >* getFolderManage rs() const
throw(TIDB_Exce ption) = 0;
virtual ITableManager* getTableManager (const string& tableName) const
throw(TIDB_Exce ption) = 0;
virtual vector < ITableManager >* getTableManager s() const
throw(TIDB_Exce ption)= 0;
virtual const string& getDescription( ) const =0;
virtual const string& getPath() const =0;
virtual const string& getVersion() const=0;
virtual ~IFolderManager () {} //dummy destructor
};
#endif //IFOLDERMANAGER_ H
--------------------------------------------------------------
IFolderManagerC ommon.h
--------------------------------------------------------------
#ifndef FOLDERMANAGERCO MMON_H
#define FOLDERMANAGERCO MMON_H
#include "IFolderManager .h"
#include "../common/IDatabase.h"
class FolderManagerCo mmon : public IFolderManager {
public:
virtual const string& getDescription( ) const;
virtual const string& getPath() const;
virtual const string& getVersion() const;
virtual ~FolderManagerC ommon();
protected:
virtual const IDatabase& getDatabase() const;
private:
string path;
string version;
string description;
IDatabase& database;
};
#endif // FOLDERCOMMON_H
--------------------------------------------------------------
FolderManager.h
--------------------------------------------------------------
#ifndef FOLDERMANAGER_H
#define FOLDERMANAGER_H
#include "../common/FolderManagerCo mmon.h"
/**
* @stereotype Oracle
*/
class FolderManager : public FolderManagerCo mmon {
public:
FolderManager(c onst string& path, const IDatabase& database);
virtual IFolderManager* createFolder(co nst string& folderName,
const string& folderAttribute s,
const string& folderDescripti on) const
throw (TIDB_Exception );
virtual ITableManager* createTable(con st string& tableName,
ICondDBTable& table,
const string& tableAttributes ,
const string& tableDescriptio n) const
throw (TIDB_Exception );
virtual void deleteFolder(co nst string& folderName) const
throw (TIDB_Exception );
virtual void deleteTable(con st string& tableName) const
throw (TIDB_Exception );
virtual IFolderManager* getFolderManage r(const string& folderName)
const
throw (TIDB_Exception );
virtual vector < IFolderManager >* getFolderManage rs() const
throw (TIDB_Exception );
virtual ITableManager* getTableManager (const string& tableName) const
throw (TIDB_Exception );
virtual vector < ITableManager >* getTableManager s() const
throw (TIDB_Exception );
virtual ~FolderManager( );
private:
/** @link dependency */
/*# P_Folder lnkFolder; */
/** @link dependency */
/*# P_Table lnkTable; */
};
#endif //FOLDERMANAGER_H