I have this problem while compiling, and I can't seem to figure out why... I created a class Stats, eventually brought it down to a constructor and destructor to check where the error is from:
Code:
#ifndef STATS_H
#define STATS_H
#include <iostream.h>
#include <iomanip>
#include <GRAPH/Map.h>
#include <GRAPH/List.h>
#include <GRAPH/String.h>
#include "LSPEdgeType.h"
#include "IPNodeType.h"
#include "StructTypeDef.h"
using namespace GRAPH;
using namespace std;
/**
*@author Johnny Ghibril
*/
class Stats {
private:
double valSimTime;
int numConReq;
List<LSPEdge> EdgeList;
List<LSPEdge> BlockedEdgeList;
List<int> ConnectionSignals;
List<int> BlockedSignals;
Map<int, String> SignalStrings;
public:
Stats();
~Stats();
};
#endif
and the cpp file contains nothing really...
But when I declare it in another class DMLRController in the header file I get this error:
DMLRControler.h:77: error: 'Stats' is used as a type, but is not defined as a type.
Although its fine in the cpp file of that class and in the main.
Any idea why this is happening?
Here's the code for the header file DMLRController.h:
Code:
#ifndef DMLRCONTROLER_H
#define DMLRCONTROLER_H
#include <CNCL/EventHandler.h>
#include <GRAPH/String.h>
#include <GRAPH/PriorityQueue.h>
#include <iostream>
#include <GRAPH/Map.h>
#include <GRAPH/List.h>
#include <GRAPH/String.h>
#include "IPNodeType.h"
#include "LSPNodeType.h"
#include "LSPEdgeType.h"
#include "FindPath.h"
#include "Stats.h"
class NetworkState;
#include "NetworkState.h"
#include "StructTypeDef.h"
/**
*@author Johnny Ghibril
*/
using namespace GRAPH;
using namespace std;
class DMLRControler : public CNEventHandler {
private:
NetworkState * NetSt;
IPNode IpNode;
LSPEdge EdgeToReroute;
LSPEdge waitingLspEdge;
List<LSPEdge> WaitForRerouteList;
static bool WithRerouting;
Map<int,String> DebugMap;
enum { ST_READY,
ST_WAITFORTARGET,
ST_WAITFORREROUTESOURCE,
ST_WAITFORREROUTETARGET
};
enum {DB_OK,DB_NOTOK};
public:
DMLRControler(){;};
DMLRControler(NetworkState * netst, IPNode ipnode, String name);
~DMLRControler();
virtual void event_handler(const CNEvent *ev);
List<LSPEdge> FindRerouteConnections(LSPEdge lspedge);
void SetRerouteFlag(bool flag);
void PrintDebugInfo(int state, int type, int debuginfo);
Stats statisticObject;
/// return statistics object
// statistics GetStatisticObject(){return statisticObject;};
};
#endif
Thanks.