[odb-users] reuse inheritance with abstract base

Paul Harrison paul.harrison at manchester.ac.uk
Tue Mar 19 18:02:42 EDT 2013


Hi,

I am trying to use reuse inheritance with an abstract base


#pragma db object abstract
class Local_Oscillator_P: public Persist
{

    friend class odb::access;

  protected:

//Data members

#pragma db  id
    uint32 _id; //!<  added key
// - other data members omitted for clarity...

};

and 

#pragma db object table("BT_Local_Oscillator")
class BT_Local_Oscillator_P: public Local_Oscillator_P
{

  friend class odb::access;


  public:
//Constructors & Destructors
    BT_Local_Oscillator_P();
    BT_Local_Oscillator_P(sint32 id, sint32 id_number, std::string &id_name, IEEE_double lo_freq,
                          IEEE_double delta_freq, IEEE_double power, uint32 multiplier,
                          sint32 sense, uint32 options);
    ~BT_Local_Oscillator_P();
};


and on compilation I get 

band_table_entry_p.h:67:56: error: pointed-to class '::BT_Local_Oscillator_P' is abstract


for a class  that is trying to use a pointer to the concrete class thus

   std::list< lazy_shared_ptr<BT_Local_Oscillator_P> > _los;//!<  LO settings


is this expected behaviour? - I note that the documentation says that the abstract class cannot be pointed to, but I am clearly pointing to the concrete class.

Regards,
	Paul.



Dr. Paul Harrison
JBCA, Manchester University
http://www.manchester.ac.uk/jodrellbank






More information about the odb-users mailing list