NicEntryDebug.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        NicEntryDebug.h
00003  *
00004  * author:      Daniel Willkomm
00005  *
00006  * copyright:   (C) 2005 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it
00010  *              and/or modify it under the terms of the GNU General Public
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later
00013  *              version.
00014  *              For further information see file COPYING
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  * description: Class to store information about a nic for the
00019  *              ConnectionManager module
00020  **************************************************************************/
00021 
00022 #ifndef NICENTRYDEBUG_H
00023 #define NICENTRYDEBUG_H
00024 
00025 #include "NicEntry.h"
00026 
00027 #include <map>
00028 #include <vector>
00029 
00038 class NicEntryDebug: public NicEntry
00039 {
00040   protected:
00042     int inCnt;
00043 
00045     int outCnt;
00046 
00054     bool checkFreeGates;
00055 
00056     typedef std::vector<cGate* > GateStack;
00058     GateStack freeInGates;
00059 
00061     GateStack freeOutGates;
00062 
00063   protected:
00070     cGate* requestInGate(void);
00071 
00078     cGate* requestOutGate(void);
00079 
00090     int collectGates(const char* pattern, GateStack& gates);
00091 
00102     void collectFreeGates();
00103 
00104   public:
00108     NicEntryDebug(bool debug) :
00109       NicEntry(debug),
00110       inCnt(0),
00111       outCnt(0),
00112       checkFreeGates(true)
00113     {};
00114 
00118     virtual ~NicEntryDebug() {}
00119 
00131     virtual void connectTo(NicEntry* other);
00132 
00140     virtual void disconnectFrom(NicEntry* other);
00141 };
00142 
00143 #endif