source: trunk/lib/Alias.h @ 1237

Last change on this file since 1237 was 1237, checked in by Peter Johansson, 11 years ago

remove unneeded include in Alias.h and missing includes (found after this removal).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#ifndef _theplu_svndigest_alias_
2#define _theplu_svndigest_alias_
3
4// $Id: Alias.h 1237 2010-10-23 21:41:40Z 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 <string>
26
27namespace theplu{
28namespace svndigest{
29
30  ///
31  /// @brief Class holding a copyright alias
32  ///
33  class Alias
34  {
35  public:
36    ///
37    /// @brief default constructor
38    ///
39    Alias(void); // to allow stl::container
40
41    ///
42    /// \brief Constructor
43    ///
44    Alias(std::string alias, size_t id);
45   
46    ///
47    /// @return name
48    ///
49    std::string name(void) const;
50
51    ///
52    /// @return id
53    ///
54    size_t id(void) const;
55
56  private:
57    //Alias& Alias(const Alias&) using compiler generated copy ctor
58    //Alias& operator=(const Alias&) using compiler generated operator
59   
60    std::string name_;
61    size_t id_;
62  };
63
64  bool operator<(const Alias& lhs, const Alias& rhs);
65  bool operator==(const Alias& lhs, const Alias& rhs);
66
67
68  ///
69  /// @brief Functor to compare using Id
70  ///
71  struct IdCompare
72  {
73    inline bool operator()(const Alias& lhs, const Alias& rhs) const
74    { return lhs.id()<rhs.id(); }
75  };
76
77}} // end of namespace svndigest and namespace theplu
78#endif
Note: See TracBrowser for help on using the repository browser.