User Manual, Developers Guide and API Documentation

Birthmark.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #include <WNS/Birthmark.hpp>
00029 #include <WNS/Assure.hpp>
00030 
00031 using namespace wns;
00032 
00033 
00034 long long int Birthmark::globalId = 0;
00035 
00036 
00037 Birthmark::Birthmark() :
00038     id(++globalId)
00039 {
00040     // This will flip after 9.223.372.036.854.775.807 birthmarks
00041     assure(id > 0, "If you can see this message please send an eCard to: [msg|pab]@comnets.rwth-aachen.de");
00042 }
00043 
00044 
00045 Birthmark::~Birthmark()
00046 {
00047 }
00048 
00049 
00050 std::string
00051 Birthmark::doToString() const
00052 {
00053     std::stringstream tmp;
00054     tmp << PythonicOutput::doToString();
00055     tmp << " with id: ";
00056     tmp << id;
00057     return tmp.str();
00058 }
00059 
00060 
00061 bool
00062 Birthmark::operator ==(const Birthmark& other) const
00063 {
00064     return id == other.id;
00065 }
00066 
00067 
00068 bool
00069 Birthmark::operator !=(const Birthmark& other) const
00070 {
00071     return !(*this == other);
00072 }
00073 
00074 bool
00075 Birthmark::operator <(const Birthmark& other) const
00076 {
00077     return (this->id < other.id);
00078 }
00079 
00080 
00081 HasBirthmark::HasBirthmark() :
00082     birthmark()
00083 {
00084 }
00085 
00086 
00087 HasBirthmark::~HasBirthmark()
00088 {
00089 }
00090 
00091 
00092 const Birthmark&
00093 HasBirthmark::getBirthmark() const
00094 {
00095     return birthmark;
00096 }
00097 
00098 
00099 void
00100 HasBirthmark::setBirthmark(const Birthmark& other)
00101 {
00102     birthmark = other;
00103 }
00104 
00105 
00106 

Generated on Wed Feb 8 03:31:38 2012 for openWNS by  doxygen 1.5.5