1 | #ifndef _theplu_svndigest_alias_ |
---|
2 | #define _theplu_svndigest_alias_ |
---|
3 | |
---|
4 | // $Id: Alias.h 978 2009-12-12 20:09:41Z peter $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
---|
8 | |
---|
9 | This file is part of svndigest, http://dev.thep.lu.se/svndigest |
---|
10 | |
---|
11 | svndigest is free software; you can redistribute it and/or modify it |
---|
12 | under the terms of the GNU General Public License as published by |
---|
13 | the Free Software Foundation; either version 3 of the License, or |
---|
14 | (at your option) any later version. |
---|
15 | |
---|
16 | svndigest is distributed in the hope that it will be useful, but |
---|
17 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | General Public License for more details. |
---|
20 | |
---|
21 | You should have received a copy of the GNU General Public License |
---|
22 | along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
---|
23 | */ |
---|
24 | |
---|
25 | #include "Node.h" |
---|
26 | |
---|
27 | #include <string> |
---|
28 | |
---|
29 | namespace theplu{ |
---|
30 | namespace svndigest{ |
---|
31 | |
---|
32 | /// |
---|
33 | /// @brief Class holding a copyright alias |
---|
34 | /// |
---|
35 | class Alias |
---|
36 | { |
---|
37 | public: |
---|
38 | /// |
---|
39 | /// @brief default constructor |
---|
40 | /// |
---|
41 | Alias(void); // to allow stl::container |
---|
42 | |
---|
43 | /// |
---|
44 | /// \brief Constructor |
---|
45 | /// |
---|
46 | Alias(std::string alias, size_t id); |
---|
47 | |
---|
48 | /// |
---|
49 | /// @return name |
---|
50 | /// |
---|
51 | std::string name(void) const; |
---|
52 | |
---|
53 | /// |
---|
54 | /// @return id |
---|
55 | /// |
---|
56 | size_t id(void) const; |
---|
57 | |
---|
58 | private: |
---|
59 | //Alias& Alias(const Alias&) using compiler generated copy ctor |
---|
60 | //Alias& operator=(const Alias&) using compiler generated operator |
---|
61 | |
---|
62 | std::string name_; |
---|
63 | size_t id_; |
---|
64 | }; |
---|
65 | |
---|
66 | bool operator<(const Alias& lhs, const Alias& rhs); |
---|
67 | bool operator==(const Alias& lhs, const Alias& rhs); |
---|
68 | |
---|
69 | |
---|
70 | /// |
---|
71 | /// @brief Functor to compare using Id |
---|
72 | /// |
---|
73 | struct IdCompare |
---|
74 | { |
---|
75 | inline bool operator()(const Alias& lhs, const Alias& rhs) const |
---|
76 | { return lhs.id()<rhs.id(); } |
---|
77 | }; |
---|
78 | |
---|
79 | |
---|
80 | }} // end of namespace svndigest and namespace theplu |
---|
81 | |
---|
82 | #endif |
---|
83 | |
---|
84 | |
---|