Cupt
package.hpp
Go to the documentation of this file.
00001 /**************************************************************************
00002 *   Copyright (C) 2010 by Eugene V. Lyubimkin                             *
00003 *                                                                         *
00004 *   This program is free software; you can redistribute it and/or modify  *
00005 *   it under the terms of the GNU General Public License                  *
00006 *   (version 3 or above) as published by the Free Software Foundation.    *
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 GPL                        *
00014 *   along with this program; if not, write to the                         *
00015 *   Free Software Foundation, Inc.,                                       *
00016 *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA               *
00017 **************************************************************************/
00018 #ifndef CUPT_CACHE_PACKAGE_SEEN
00019 #define CUPT_CACHE_PACKAGE_SEEN
00020 
00022 
00023 #include <cupt/cache/version.hpp>
00024 
00025 namespace cupt {
00026 namespace cache {
00027 
00029 class CUPT_API Package
00030 {
00031     mutable vector< Version::InitializationParameters > __unparsed_versions;
00032     mutable vector< shared_ptr< Version > >* __parsed_versions;
00033 
00034     CUPT_LOCAL void __merge_version(shared_ptr< Version >&&, vector< shared_ptr< Version > >& result) const;
00035 
00036     Package(const Package&);
00037     Package& operator=(const Package&);
00038  protected:
00040     shared_ptr< const string > _binary_architecture;
00041 
00042     CUPT_LOCAL vector< shared_ptr< Version > > _get_versions() const;
00043     CUPT_LOCAL virtual shared_ptr< Version > _parse_version(const Version::InitializationParameters&) const = 0;
00044     CUPT_LOCAL virtual bool _is_architecture_appropriate(const shared_ptr< const Version >&) const = 0;
00046  public:
00048 
00051     Package(const shared_ptr< const string >& binaryArchitecture);
00053     virtual ~Package();
00055     void addEntry(const Version::InitializationParameters&);
00057     vector< shared_ptr< const Version > > getVersions() const;
00059 
00063     shared_ptr< const Version > getSpecificVersion(const string& versionString) const;
00064 
00066     static bool memoize;
00067 };
00068 
00069 }
00070 }
00071 
00072 #endif
00073