User Manual, Developers Guide and API Documentation

VersionInformation.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_VERSIONINFORMATION_HPP
00029 #define WNS_MODULE_VERSIONINFORMATION_HPP
00030 
00031 #include <WNS/module/DependencyList.hpp>
00032 
00033 namespace wns { namespace module {
00038     class VersionInformation
00039     {
00040     public:
00050         explicit
00051         VersionInformation(const Version ver, const DepList deps = DepList())
00052             : version(ver), dependencies(deps)
00053         {}
00054 
00071         explicit
00072         VersionInformation(const Release bRelease,
00073                    const DepList deps = DepList(),
00074                    const DateTime bTime = DateTime(),
00075                    const std::string bUser = "",
00076                    const std::string bHost = "",
00077                    const std::string bFlags = "",
00078                    const DateTime mTime = DateTime(),
00079                    const std::string mFile = "")
00080             : version(bRelease, bTime, bUser, bHost, bFlags, mTime, mFile),
00081               dependencies(deps)
00082         {}
00093         explicit
00094         VersionInformation(const std::string& s)
00095             : version(Syntax::extractVersion(s)),
00096               dependencies(Syntax::extractDependencies(s))
00097         {}
00098 
00102         Version getVersion() const
00103         {
00104             return version;
00105         }
00106 
00110         DepList getDependencies() const
00111         {
00112             return dependencies;
00113         }
00114 
00118         void setVersion(const Version ver)
00119         {
00120             version = ver;
00121         }
00122 
00126         void setDependencies(const DepList deps)
00127         {
00128             dependencies = deps;
00129         }
00130 
00134         std::string getString() const;
00139         std::string getNiceString() const;
00140 
00141     private:
00142         // nested namespaces workaround
00146         class Syntax
00147         {
00148         public:
00149             static std::string extractVersion(const std::string s);
00150             static std::string extractDependencies(const std::string s);
00151         };
00152 
00153         Version version;
00154         DepList dependencies;
00155     };
00156 } // module
00157 } // wns
00158 #endif // NOT defined WNS_MODULE_VERSIONINFORMATION_HPP

Generated on Sat May 26 03:31:45 2012 for openWNS by  doxygen 1.5.5