PeerInfo.cc

Go to the documentation of this file.
00001 // Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
00002 //
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation; either version 2
00006 // of the License, or (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00016 //
00017 
00024 #include "PeerInfo.h"
00025 
00026 PeerInfo::PeerInfo(uint32_t type, int moduleId, cObject** context)
00027 {
00028     bootstrapped = false;
00029     malicious = false;
00030     this->moduleId = moduleId;
00031     this->type = type;
00032     this->npsLayer = -1;   // layer not determined yet
00033     this->context = context;
00034 }
00035 
00036 void PeerInfo::dummy() {}
00037 
00038 //public
00039 
00040 std::ostream& operator<<(std::ostream& os, const PeerInfo info)
00041 {
00042     os  << "ModuleId: " << info.moduleId << "Bootstrapped: "
00043         << (info.bootstrapped ? "true" : "false");
00044 
00045     if (info.npsLayer >= 0) os << "; NPS Layer: " << info.npsLayer;
00046     return os;
00047 }
00048 
Generated on Wed May 26 16:21:14 2010 for OverSim by  doxygen 1.6.3