11#define WIN32_LEAN_AND_MEAN
12#define NOWINBASEINTERLOCK
18#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
32 if (!
dll_handle) { printf(
"Error while loading library %s. Error code %i\n", libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
33 typedef Reader* (__stdcall *f_funci)(std::istream & stream);
34 f_funci newReader = (f_funci)GetProcAddress((HINSTANCE)(
dll_handle), newreader.c_str());
35 if (!newReader) { printf(
"Error while loading function %s from library %s. Error code %i\n", newreader.c_str(), libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
39#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
41 dll_handle = dlopen(libname.c_str(), RTLD_LAZY | RTLD_GLOBAL);
42 if (!
dll_handle) { printf(
"Error while loading library %s: %s\n", libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
43 Reader* (*newReader)(std::istream & stream);
44 newReader = (
Reader* (*)(std::istream & stream))dlsym(
dll_handle, newreader.c_str());
45 if (!newReader) { printf(
"Error while loading function %s from library %s: %s\n", newreader.c_str(), libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
54 if (!
dll_handle) { printf(
"Error while loading library %s. Error code %i\n", libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
55 typedef Reader* (__stdcall *f_funci)(
const std::string&);
56 f_funci newReader = (f_funci)GetProcAddress((HINSTANCE)(
dll_handle), newreader.c_str());
57 if (!newReader) { printf(
"Error while loading function %s from library %s. Error code %i\n", newreader.c_str(), libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
61#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
63 dll_handle = dlopen(libname.c_str(), RTLD_LAZY | RTLD_GLOBAL);
64 if (!
dll_handle) { printf(
"Error while loading library %s: %s\n", libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
65 Reader* (*newReader)(
const std::string&);
66 newReader = (
Reader* (*)(
const std::string&))dlsym(
dll_handle, newreader.c_str());
67 if (!newReader) { printf(
"Error while loading function %s from library %s: %s\n", newreader.c_str(), libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
79#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
Definition of class GenEvent.
Definition of class ReaderPlugin.
ReaderPlugin(std::istream &stream, const std::string &libname, const std::string &newreader)
Constructor to read from stream.
~ReaderPlugin() override
Destructor.
Reader * m_reader
The actual reader.
void * dll_handle
library handler
Base class for all I/O readers.
virtual void close()=0
Close file and/or stream.