I want to make a very generic pure virtual class i_BIS_Data that will be inherited by unique BIS_Data classes.
class i_BIS_Data
{
public:
i_BIS_Data(void) { }
virtual ~i_BIS_Data( void ) { }
virtual void setData(bis_data data) = 0;
};
I want all my children of i_BIS_Data to define the bis_data struct as they all will be different. I expect my child class to look similar to the following:
class BIS_0192_Aircraft_ID_Data : i_BIS_Data
{
public:
struct bis_data
{
UInt16 acid;
UInt16 parity;
};
void setData(bis_data data){ m_data.parity = data.parity;
m_data.acid = data.acid; }
}
When I try to compile a class that uses BIS_0192_Aircraft_ID_Data, I get the following error: error C2061: syntax error: identifier ‘bis_data’. I believe its because I haven’t defined bis_data within the parent class.
So is it possible to “overload” the structure and allow multiple children classes to define what bis_data is?
This should work, however subclasses of
i_BIS_Data<XX>with different types for XX are incompatible.