User Manual, Developers Guide and API Documentation

Release.hpp

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. 16, 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 #ifndef WNS_MODULE_RELEASE_HPP
00029 #define WNS_MODULE_RELEASE_HPP
00030 
00031 #include <string>
00032 
00033 namespace wns { namespace module {
00038     class ReleaseError
00039     {
00040     public:
00041         virtual
00042         ~ReleaseError()
00043         {}
00044     };
00045 
00053     class CategoryMatchError : public ReleaseError { };
00054 
00062     class BranchMatchError : public ReleaseError { };
00063 
00076     class Release
00077     {
00078     public:
00085         Release() :
00086             empty(true),
00087             archive(""),
00088             category(""),
00089             branch(""),
00090             version(""),
00091             revision("")
00092         {}
00093 
00107         Release(const std::string s);
00121         Release(const std::string archive, const std::string category,
00122             const std::string branch, const std::string version,
00123             const std::string revision);
00124 
00128         std::string getArchive() const { return archive; }
00129 
00133         std::string getCategory() const { return category; }
00134 
00138         std::string getBranch() const { return branch; }
00139 
00143         std::string getVersion() const { return version; }
00144 
00148         std::string getRevision() const { return revision; }
00149 
00153         bool operator==(const Release b) const;
00157         bool operator!=(const Release b) const;
00162         bool operator<(const Release b) const
00163             throw (CategoryMatchError, BranchMatchError);
00168         bool operator>(const Release b) const;
00173         bool operator<=(const Release b) const;
00178         bool operator>=(const Release b) const;
00179 
00184         std::string getString() const;
00190         std::string getNiceString() const;
00191     private:
00192         // Private attributes
00193         bool empty;
00194         std::string archive;
00195         std::string category;
00196         std::string branch;
00197         std::string version;
00198         std::string revision;
00199 
00203         bool versionLowerThan(std::string s) const;
00207         bool revisionLowerThan(std::string s) const;
00208     };
00209 } // module
00210 } // wns
00211 #endif // NOT defined WNS_MODULE_RELEASE_HPP
00212 

Generated on Fri May 25 03:31:48 2012 for openWNS by  doxygen 1.5.5