IInterfaceTable.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2008 Andras Varga
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this program; if not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef __INET_IINTERFACETABLE_H
00019 #define __INET_IINTERFACETABLE_H
00020 
00021 #include <omnetpp.h>
00022 #include "INETDefs.h"
00023 #include "InterfaceEntry.h"  // not strictly required, but clients will need it anyway
00024 
00025 
00034 class INET_API IInterfaceTable
00035 {
00036     friend class InterfaceEntry;  // so that it can call interfaceChanged()
00037 
00038   protected:
00039     // called from InterfaceEntry
00040     virtual void interfaceChanged(InterfaceEntry *entry, int category) = 0;
00041 
00042   public:
00043     virtual ~IInterfaceTable() {}
00044 
00048     virtual std::string getFullPath() const = 0;
00049 
00057     virtual void addInterface(InterfaceEntry *entry, cModule *ifmod) = 0;
00058 
00064     virtual void deleteInterface(InterfaceEntry *entry) = 0;
00065 
00069     virtual int getNumInterfaces() = 0;
00070 
00080     virtual InterfaceEntry *getInterface(int pos) = 0;
00081 
00087     virtual InterfaceEntry *getInterfaceById(int id) = 0;
00088 
00093     virtual InterfaceEntry *getInterfaceByNodeOutputGateId(int id) = 0;
00094 
00099     virtual InterfaceEntry *getInterfaceByNodeInputGateId(int id) = 0;
00100 
00105     virtual InterfaceEntry *getInterfaceByNetworkLayerGateIndex(int index) = 0;
00106 
00110     virtual InterfaceEntry *getInterfaceByName(const char *name) = 0;
00111 
00118     virtual InterfaceEntry *getFirstLoopbackInterface() = 0;
00119 };
00120 
00121 #endif
00122