Bincimap 2.0.16
Easy Imapping
Loading...
Searching...
No Matches
iofactory.h
Go to the documentation of this file.
1
7#ifndef IOFACTORY_H_INCLUDED
8#define IOFACTORY_H_INCLUDED
9#include <map>
10#include <string>
11
12#include "iodevice.h"
13
14namespace Binc {
15 class IOFactory {
16 public:
17 ~IOFactory(void);
18
19 static void addDevice(IODevice *dev);
20 static IOFactory &getInstance(void);
21 static IODevice &getClient(void);
22 static IODevice &getLogger(void);
23
24 private:
25 IOFactory(void);
26
27 std::map<std::string, IODevice *> devices;
28 };
29}
30
31#define bincClient \
32 IOFactory::getClient()
33
34#if defined (DEBUG)
35//#define bincError if (false) std::cout
36#define bincError std::cerr
37// #define bincWarning if (false) std::cout
38#define bincWarning std::cerr
39#define bincDebug std::cerr
40//#define bincDebug if (false) std::cout
41#else
42#define bincError \
43 IOFactory::getLogger().setOutputLevel(IODevice::ErrorLevel);IOFactory::getLogger()
44#define bincWarning \
45 IOFactory::getLogger().setOutputLevel(IODevice::WarningLevel);IOFactory::getLogger()
46#define bincDebug \
47 IOFactory::getLogger().setOutputLevel(IODevice::DebugLevel);IOFactory::getLogger()
48#endif
49
50#define bincLog \
51 IOFactory::getLogger().setOutputLevel(IODevice::InfoLevel);IOFactory::getLogger()
52
53#endif
The IODevice class provides a framework for reading and writing to device.
Definition: iodevice.h:31
~IOFactory(void)
Definition: iofactory.cc:19
static void addDevice(IODevice *dev)
Definition: iofactory.cc:31
static IODevice & getLogger(void)
Definition: iofactory.cc:57
static IODevice & getClient(void)
Definition: iofactory.cc:44
static IOFactory & getInstance(void)
Definition: iofactory.cc:24
Declaration of the IODevice class.
Definition: bincimapd.cc:9