File: mmap_exception.h

package info (click to toggle)
libmmap-allocator 0.4.0%2Bgit20200122.adbfbe1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 152 kB
  • sloc: cpp: 946; ansic: 61; makefile: 44; sh: 11
file content (34 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
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
#ifndef _MMAP_EXCEPTION
#define _MMAP_EXCEPTION

#include "mmap_access_mode.h"
#include <stdexcept>

namespace mmap_allocator_namespace
{
	class mmap_allocator_exception: public std::runtime_error {
public:
		mmap_allocator_exception(const char *msg_param) throw(): 
			std::runtime_error(msg_param)
		{
			if (get_verbosity() > 0) {
				fprintf(stderr, "Throwing exception %s\n", msg_param);
			}
		}

		mmap_allocator_exception(std::string msg_param) throw(): 
			std::runtime_error(msg_param)
		{
			if (get_verbosity() > 0) {
				fprintf(stderr, "Throwing exception %s\n", msg_param.c_str());
			}
		}

		virtual ~mmap_allocator_exception(void) throw()
		{
		}
private:
	};
}

#endif