summaryrefslogtreecommitdiff
path: root/dwarflint/check_registrar.hh
blob: b254b018e0e1b3f4f27ae0dce6939f1a697fcbde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Pedantic checking of DWARF files
   Copyright (C) 2011 Red Hat, Inc.
   This file is part of elfutils.

   This file is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   elfutils is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#ifndef _CHECK_REGISTRAR_H_
#define _CHECK_REGISTRAR_H_

#include "checkdescriptor_i.hh"

#include <vector>
#include <set>
#include <iostream>

namespace check_registrar_aux
{
  bool be_verbose ();
  void list_one_check (checkdescriptor const &cd);
}

template <class Item>
class check_registrar_T
  : protected std::vector<Item *>
{
  typedef std::vector<Item *> _super_t;
public:

  using _super_t::push_back;
  using _super_t::const_iterator;
  using _super_t::begin;
  using _super_t::end;

  typedef std::vector<checkdescriptor const *> checkdescriptors_t;

  checkdescriptors_t
  get_descriptors () const
  {
    checkdescriptors_t ret;
    for (typename _super_t::const_iterator it = begin (); it != end (); ++it)
      ret.push_back ((*it)->descriptor ());
    return ret;
  }
};

#endif /* _CHECK_REGISTRAR_H_ */