blob: ce439e08728f9df11175976e9109c86ac23cea54 [file] [log] [blame]
Upstreamcc2ee171970-01-12 13:46:40 +00001/**
2 * @file abi.h
3 *
4 * Contains internal ABI management class
5 *
6 * @remark Copyright 2002 OProfile authors
7 * @remark Read the file COPYING
8 *
9 * @author Graydon Hoare
10 */
11
12#ifndef OPROF_ABI_H
13#define OPROF_ABI_H
14
15#include <string>
16#include <map>
17#include <iosfwd>
18
19struct abi_exception : std::exception {
20 std::string const desc;
21
22 explicit abi_exception(std::string const d);
23
24 ~abi_exception() throw() {}
25};
26
27
28class abi {
29public:
30 abi();
31 abi(abi const & other);
32
33 int need(std::string const key) const throw (abi_exception);
34
35 bool operator==(abi const & other) const;
36 friend std::ostream & operator<<(std::ostream & o, abi const & abi);
37 friend std::istream & operator>>(std::istream & i, abi & abi);
38
39private:
40 std::map<std::string, int> slots;
41};
42
43#endif // OPROF_ABI_H