abi.h revision cc2ee177dbb3befca43e36cfc56778b006c3d050
1/**
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
44