M
Marco Nef
Hi there,
I'm trying to do something like the following:
template<class TYPE> class CFlags
{
public:
VOID AddFlag(TYPE eFlag);
VOID RemoveFlag(TYPE eFlag);
};
class CClass1 : public CFlags<CClass1::EFlags>
{
public:
typedef enum EFlags
{
...
} EFlags;
};
class CClass2 : public CClass1,public CFlags<CClass2::EFlags>
{
public:
typedef enum EFlags
{
...
} EFlags;
};
I know that this cannot work because the EFlags are not known where needed.
I've tried many things, but none was a nice solution or worked at all (I
prefer a real C++ solution, which means there should be no macros).
Does anyone have an idea how to solve the following problems in a nice C++
way?
- EFlags should not be in global space
- Each class in a hierarchy may have its own flags
- The flags must be type specific
Thanks,
Marco
_____________________________
()() Marco Nef
( '.')
(")_(") http://www.shima.ch/marco/
I'm trying to do something like the following:
template<class TYPE> class CFlags
{
public:
VOID AddFlag(TYPE eFlag);
VOID RemoveFlag(TYPE eFlag);
};
class CClass1 : public CFlags<CClass1::EFlags>
{
public:
typedef enum EFlags
{
...
} EFlags;
};
class CClass2 : public CClass1,public CFlags<CClass2::EFlags>
{
public:
typedef enum EFlags
{
...
} EFlags;
};
I know that this cannot work because the EFlags are not known where needed.
I've tried many things, but none was a nice solution or worked at all (I
prefer a real C++ solution, which means there should be no macros).
Does anyone have an idea how to solve the following problems in a nice C++
way?
- EFlags should not be in global space
- Each class in a hierarchy may have its own flags
- The flags must be type specific
Thanks,
Marco
_____________________________
()() Marco Nef
( '.')
(")_(") http://www.shima.ch/marco/