InterfaceToken.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2005 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_INTERFACETOKEN_H
00019 #define __INET_INTERFACETOKEN_H
00020 
00021 #include <vector>
00022 #include <omnetpp.h>
00023 #include "INETDefs.h"
00024 
00031 class INET_API InterfaceToken
00032 {
00033   private:
00034     uint32 _normal, _low;
00035     short _len; // in bits, 1..64
00036   public:
00037     InterfaceToken()  {_normal=_low=_len=0;}
00038     InterfaceToken(uint32 low, uint32 normal, int len)  {_normal=normal; _low=low; _len=len;}
00039     InterfaceToken(const InterfaceToken& t)  {operator=(t);}
00040     void operator=(const InterfaceToken& t)  {_normal=t._normal; _low=t._low; _len=t._len;}
00041     int length() const {return _len;}
00042     uint32 low() const {return _low;}
00043     uint32 normal() const {return _normal;}
00044 };
00045 
00046 #endif
00047