I've got a little problem I've been dealing with for several days :((
Code is written in Qt.
I'll try to explain it:
I created an abstract class "VcaNode" with 4 virtual methods and 3 other members...it is in special header:
Expand|Select|Wrap|Line Numbers
- //ABSTRACT CLASS MEMBER:
- #ifndef _VCA_NODE
- #define _VCA_NODE
- #include <vca_net.h>
- #include <canmsg.h>
- #include <iostream>
- using namespace std;
- #include <QObject>
- class VcaNet;
- class VcaNode : public QObject
- {
- Q_OBJECT
- public:
- VcaNet *cannet;
- VcaNode(VcaNet *parent){
- this->cannet = parent;
- };
- virtual ~VcaNode() {cout <<"Node Has Been destroyed/disconnected"<<endl;};
- void emitSentSignal(int event_code, const canmsg_t *canmsg){
- emit sentMsg(event_code, canmsg);
- }
- virtual void connectNode() = 0;
- virtual int vcaSendMsgSeq(canmsg_t *messages, int count) = 0;
- virtual int vcaRecMsgSeq(canmsg_t *messages, int count) = 0;
- signals:
- void sentMsg(int event_code, const canmsg_t *canmsg);
- public slots:
- virtual void nodeReady() = 0;
- };
- #endif
Then I want to inherit it and override virtual methods ...So I created another class "VcaFdNode" that looks like this:
Expand|Select|Wrap|Line Numbers
- //INHERITED CLASS
- #ifndef _CAN_VCA_H
- #define _CAN_VCA_H
- #include <vca_net.h>
- #include <vca_node.h>
- #include <vca_net.h>
- #include <QObject>
- #include <QSocketNotifier>
- #include <stdarg.h>
- #ifndef __RTL__
- #include <sys/time.h>
- #else /*__RTL__*/
- #include <time.h>
- #endif /*__RTL__*/
- #include <can.h>
- class VcaNet;
- //class VcaNode;
- class VcaFdNode : public VcaNode
- {
- private:
- int vcah;
- int vcaWait(int wait_msec, int what);
- long vcaH2log();
- public:
- bool vca_ok;
- QSocketNotifier *sn;
- VcaFdNode(VcaNet *_cannet, const char *dev_name/*, const char *options, int flags*/);
- ~VcaFdNode();
- void connectNode();//OK
- int vcaSendMsgSeq(canmsg_t *messages, int count);//OK
- int vcaRecMsgSeq(canmsg_t *messages, int count);//OK
- int getVcaHandle();
- void setVcaHandle(int handle);
- int vcaH2fd();
- public slots:
- void nodeReady();//OK
- };
- #endif
./vca_fdnode.h:23: error: expected class-name before '{' token
vca_fdnode.cpp: In constructor 'VcaFdNode::VcaFdNode(VcaNet*, const char*)':
vca_fdnode.cpp:63: error: type 'VcaNode' is not a direct base of 'VcaFdNode'
and so on :(
ANYONE help ? :)
THANKS A LOT IN ADVANCE...