G
Gama Franco
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 - FolderManagerCommon : public IFolderManager
3 - FolderManager : public FolderManagerCommon
The properties of this relation are:
1 - IFolderManager has only abstract methods and no attributes.
2 - IFolderManagerCommon implements a small set of methods from the base
class.
3 - IFolderManagerCommon declares and implements some protected methods,
and as some private attributes.
4 - IFolderManagerCommon 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 FolderManagerCommon.
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 FolderManagerCommon 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/FolderManagerCommon.h:7: error: candidates are:
FolderManagerCommon::FolderManagerCommon(const FolderManagerCommon&)
This error points to the constructor of FolderManager, in
FolderManager.cxx. 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(const string& folderName,
const string& folderAttributes,
const string& folderDescription) const
throw (TIDB_Exception) =0;
virtual ITableManager* createTable(const string& tableName,
ICondDBTable& table,
const string& tableAttributes,
const string& tableDescription) const
throw(TIDB_Exception)=0;
virtual void deleteFolder(const string& folderName) const
throw (TIDB_Exception) = 0;
virtual void deleteTable(const string& tableName) const
throw (TIDB_Exception) = 0;
virtual IFolderManager* getFolderManager(const string& folderName)
const
throw(TIDB_Exception)= 0;
virtual vector < IFolderManager >* getFolderManagers() const
throw(TIDB_Exception) = 0;
virtual ITableManager* getTableManager(const string& tableName) const
throw(TIDB_Exception) = 0;
virtual vector < ITableManager >* getTableManagers() const
throw(TIDB_Exception)= 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
--------------------------------------------------------------
IFolderManagerCommon.h
--------------------------------------------------------------
#ifndef FOLDERMANAGERCOMMON_H
#define FOLDERMANAGERCOMMON_H
#include "IFolderManager.h"
#include "../common/IDatabase.h"
class FolderManagerCommon : public IFolderManager {
public:
virtual const string& getDescription() const;
virtual const string& getPath() const;
virtual const string& getVersion() const;
virtual ~FolderManagerCommon();
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/FolderManagerCommon.h"
/**
* @stereotype Oracle
*/
class FolderManager : public FolderManagerCommon {
public:
FolderManager(const string& path, const IDatabase& database);
virtual IFolderManager* createFolder(const string& folderName,
const string& folderAttributes,
const string& folderDescription) const
throw (TIDB_Exception);
virtual ITableManager* createTable(const string& tableName,
ICondDBTable& table,
const string& tableAttributes,
const string& tableDescription) const
throw (TIDB_Exception);
virtual void deleteFolder(const string& folderName) const
throw (TIDB_Exception);
virtual void deleteTable(const string& tableName) const
throw (TIDB_Exception);
virtual IFolderManager* getFolderManager(const string& folderName)
const
throw (TIDB_Exception);
virtual vector < IFolderManager >* getFolderManagers() const
throw (TIDB_Exception);
virtual ITableManager* getTableManager(const string& tableName) const
throw (TIDB_Exception);
virtual vector < ITableManager >* getTableManagers() const
throw (TIDB_Exception);
virtual ~FolderManager();
private:
/** @link dependency */
/*# P_Folder lnkFolder; */
/** @link dependency */
/*# P_Table lnkTable; */
};
#endif //FOLDERMANAGER_H
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 - FolderManagerCommon : public IFolderManager
3 - FolderManager : public FolderManagerCommon
The properties of this relation are:
1 - IFolderManager has only abstract methods and no attributes.
2 - IFolderManagerCommon implements a small set of methods from the base
class.
3 - IFolderManagerCommon declares and implements some protected methods,
and as some private attributes.
4 - IFolderManagerCommon 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 FolderManagerCommon.
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 FolderManagerCommon 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/FolderManagerCommon.h:7: error: candidates are:
FolderManagerCommon::FolderManagerCommon(const FolderManagerCommon&)
This error points to the constructor of FolderManager, in
FolderManager.cxx. 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(const string& folderName,
const string& folderAttributes,
const string& folderDescription) const
throw (TIDB_Exception) =0;
virtual ITableManager* createTable(const string& tableName,
ICondDBTable& table,
const string& tableAttributes,
const string& tableDescription) const
throw(TIDB_Exception)=0;
virtual void deleteFolder(const string& folderName) const
throw (TIDB_Exception) = 0;
virtual void deleteTable(const string& tableName) const
throw (TIDB_Exception) = 0;
virtual IFolderManager* getFolderManager(const string& folderName)
const
throw(TIDB_Exception)= 0;
virtual vector < IFolderManager >* getFolderManagers() const
throw(TIDB_Exception) = 0;
virtual ITableManager* getTableManager(const string& tableName) const
throw(TIDB_Exception) = 0;
virtual vector < ITableManager >* getTableManagers() const
throw(TIDB_Exception)= 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
--------------------------------------------------------------
IFolderManagerCommon.h
--------------------------------------------------------------
#ifndef FOLDERMANAGERCOMMON_H
#define FOLDERMANAGERCOMMON_H
#include "IFolderManager.h"
#include "../common/IDatabase.h"
class FolderManagerCommon : public IFolderManager {
public:
virtual const string& getDescription() const;
virtual const string& getPath() const;
virtual const string& getVersion() const;
virtual ~FolderManagerCommon();
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/FolderManagerCommon.h"
/**
* @stereotype Oracle
*/
class FolderManager : public FolderManagerCommon {
public:
FolderManager(const string& path, const IDatabase& database);
virtual IFolderManager* createFolder(const string& folderName,
const string& folderAttributes,
const string& folderDescription) const
throw (TIDB_Exception);
virtual ITableManager* createTable(const string& tableName,
ICondDBTable& table,
const string& tableAttributes,
const string& tableDescription) const
throw (TIDB_Exception);
virtual void deleteFolder(const string& folderName) const
throw (TIDB_Exception);
virtual void deleteTable(const string& tableName) const
throw (TIDB_Exception);
virtual IFolderManager* getFolderManager(const string& folderName)
const
throw (TIDB_Exception);
virtual vector < IFolderManager >* getFolderManagers() const
throw (TIDB_Exception);
virtual ITableManager* getTableManager(const string& tableName) const
throw (TIDB_Exception);
virtual vector < ITableManager >* getTableManagers() const
throw (TIDB_Exception);
virtual ~FolderManager();
private:
/** @link dependency */
/*# P_Folder lnkFolder; */
/** @link dependency */
/*# P_Table lnkTable; */
};
#endif //FOLDERMANAGER_H