Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

VirtualCircuitTable.h

Go to the documentation of this file.
00001 #ifndef __VIRTUALCIRCUITTABLE_H
00002 #define __VIRTUALCIRCUITTABLE_H
00003 
00004 #include <sys/types.h>
00005 #include <limits.h>
00006 #include "VirtualCircuitTableEntry.h"
00007 #include "Counter.h"
00008 #include "debug.h"
00009 #include "GlobalConstants.h"
00010 
00011 class NetworkLayer;
00012 
00013 class VirtualCircuitTable : public BasicObject {
00014 public:
00015     // create an empty list
00016     VirtualCircuitTable(Node* myself);
00017     
00018     virtual ~VirtualCircuitTable();
00019     
00020     // add an entry to the front of the table
00021     VirtualCircuitTableEntry* add(Node* srcNode, int srcVcn,
00022                Node* destNode, int destVcn);
00023     
00024     // find an entry in the table
00025     VirtualCircuitTableEntry* findBySrc(Node* srcNode, int srcVcn);
00026     
00027     // find an entry in the table
00028     VirtualCircuitTableEntry* findByDest(Node* destNode, int destVcn);
00029     
00030     VirtualCircuitTableEntry* findNode(Node* node);
00031     
00032     // remove an entry from the table
00033     bool remove(Node* srcNode, int srcVcn);
00034     
00035     //static int generateVcn();
00036     
00037     bool isThisPacketForMe(Node* fromNode, NpPacket* packet);
00038     
00039     virtual void toStream(std::ostream& out);
00040     
00041 #ifdef INFO
00042     void incrementControlPackets(Node* srcNode, int srcVcn);
00043     void incrementDataPackets(Node* srcNode, int srcVcn);
00044 #endif
00045     
00046 private:
00047     // Return the entry if it is found in the table
00048     VirtualCircuitTableEntry* lookUp(int srvVcn, Node* srcNode);
00049     
00050     vector<VirtualCircuitTableEntry*> m_table;
00051 
00052     Node* m_myself;
00053     
00054     Mutex m_tableLock;
00055 }; // class VirtualCircuitTable
00056 
00057 #endif

Generated at Thu Jul 11 13:31:53 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001