Upstream | cc2ee17 | 1970-01-12 13:46:40 +0000 | [diff] [blame^] | 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 | |
| 19 | struct 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 | |
| 28 | class abi { |
| 29 | public: |
| 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 | |
| 39 | private: |
| 40 | std::map<std::string, int> slots; |
| 41 | }; |
| 42 | |
| 43 | #endif // OPROF_ABI_H |