Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Inheritance classes draw errors: cannot allocate objects of abstract type
Forum Updated to NodeBB v4.3 + New Features

Inheritance classes draw errors: cannot allocate objects of abstract type

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ad5xj
    wrote on last edited by
    #1

    I am attempting to create a wrapper for the many Jack Audio library functions that will be binary compatible. The structure is using the base / abstract class model with d_ptr references.

    The base class : jackport.h
    [code]
    class JackPortPrivate;
    class JackPort
    {

    public:
    JackPort(const QString &name, JackPortFlags type);
    virtual ~JackPort();

    protected:
    virtual void setData(void *data, quint32 nFrames) = 0;
    // this function is called by the jack thread
    // Implement it to implement your own port
    // param: data the buffer that jack provide. It is valid until the function returns
    // param: nFrames the number of frames in data
    //
    JackPortPrivate *const d_ptr;
    JackPort(JackPortPrivate &dd);

    private:
    friend class QJackClient;
    friend class QJackClientPrivate;
    Q_DECLARE_PRIVATE(JackPort)
    };
    [/code]

    The derived class is:
    [code]
    #include "jackport.h"

    namespace QJack
    {
    class JackInPort : public JackPort
    {
    // Inherit from this class if you want to create your own inport

    public:
    JackInPort(QString &name);
    };
    } // namespace
    [/code]

    used as : in_port = new QJack::JackInPort("inport", client->nFrames() * 2, client); (supplied code is not complete)

    Some of the background for this is in the KDE-technical article on Binary Compatibility Future Strategies found here: http://techbase.kde.org/Policies/Library_Code_Policy and here: http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++.

    What am I missing?

    Ken AD5XJ

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      <code>JackInPort</code> does not implement <code>void setData(void *data, quint32 nFrames)</code> and therefore is an abstract type due to the base <code>JackPort</code> beeing an abstract type as well.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ad5xj
        wrote on last edited by
        #3

        Thank you Lukas ... I have been able to proceed with it now.

        Ken AD5XJ

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved