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)
00027 {
00028     bootstrapped = false;
00029     malicious = false;
00030     this->moduleId = moduleId;
00031     this->type = type;
00032     this->npsLayer = -1;   // layer not determined yet
00033 }
00034 
00035 void PeerInfo::dummy() {}
00036 
00037 //public
00038 
00039 std::ostream& operator<<(std::ostream& os, const PeerInfo info)
00040 {
00041     os  << "ModuleId: " << info.moduleId << "Bootstrapped: "
00042         << (info.bootstrapped ? "true" : "false");
00043 
00044     if (info.npsLayer >= 0) os << "; NPS Layer: " << info.npsLayer;
00045     return os;
00046 }
00047 

Generated on Tue Sep 8 17:26:54 2009 for OverSim by  doxygen 1.5.8