Search code examples
omnet++inet

FifoQueue does not name a type


im new to OMNET++/INET and im trying to use the FifoQueue from the INET library. I included the header files but i can't use the class itself and says that FifoQueue does not name a type. I don't know what am i doing wrong.

    #ifndef SERVER_H_
#define SERVER_H_

#include <stdio.h>
#include <string.h>
#include <omnetpp.h>
#include "inet/common/INETDefs.h"
#include "inet/common/queue/FifoQueue.h"

using namespace omnetpp;
using namespace std;

class Server : public cSimpleModule
{
    private:
        cMessage *refillCapacity;
        cMessage *checkQueue;

        double checkTimer = 0.001;
        double refillTimer = 1.0;
        FifoQueue *Searchqueue;//    IPassiveQueue a;

    protected:
        virtual void initialize() override;
        virtual void handleMessage(cMessage *msg) override;
};

Define_Module(Server);

#endif /* SERVER_H_ */

Can anyone help me?


Solution

  • First of all remove the line

    Define_Module(Server);
    

    from the header file. This line is required but in source file.

    FifoQueue is the simple module. So one can use it by placing it in own module defined in NED. An example of using it may be found in INET: src\inet\networklayer\diffserv\AFxyQueue.ned