Cupt
package.hpp
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright (C) 2010 by Eugene V. Lyubimkin *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License *
6 * (version 3 or above) as published by the Free Software Foundation. *
7 * *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU GPL *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
17 **************************************************************************/
18 #ifndef CUPT_CACHE_PACKAGE_SEEN
19 #define CUPT_CACHE_PACKAGE_SEEN
20 
22 
23 #include <cupt/cache/version.hpp>
24 
25 namespace cupt {
26 namespace cache {
27 
29 class CUPT_API Package
30 {
31  mutable vector< Version::InitializationParameters > __unparsed_versions;
32  mutable vector< shared_ptr< Version > >* __parsed_versions;
33 
34  CUPT_LOCAL void __merge_version(shared_ptr< Version >&&, vector< shared_ptr< Version > >& result) const;
35 
36  Package(const Package&);
37  Package& operator=(const Package&);
38  protected:
40  shared_ptr< const string > _binary_architecture;
41 
42  CUPT_LOCAL vector< shared_ptr< Version > > _get_versions() const;
43  CUPT_LOCAL virtual shared_ptr< Version > _parse_version(const Version::InitializationParameters&) const = 0;
44  CUPT_LOCAL virtual bool _is_architecture_appropriate(const shared_ptr< const Version >&) const = 0;
46  public:
48 
51  Package(const shared_ptr< const string >& binaryArchitecture);
53  virtual ~Package();
55  void addEntry(const Version::InitializationParameters&);
57  vector< shared_ptr< const Version > > getVersions() const;
59 
63  shared_ptr< const Version > getSpecificVersion(const string& versionString) const;
64 
66  static bool memoize;
67 };
68 
69 }
70 }
71 
72 #endif
73