Commit 0a2160c3 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

create a file to export API in DLL for limacore instead of using Processlib's Compatibility file

parent f860f304
......@@ -6,7 +6,7 @@ SRCS = $(espia-objs:.o=.cpp)
include ../include/espia.inc
CXXFLAGS = -I../include -I../../../../third-party/Processlib/core/include \
CXXFLAGS = -I../include \
-I../../../../hardware/include -I../../../../common/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread -fPIC -g
......
......@@ -6,7 +6,7 @@ frelon-objs = FrelonBase.o FrelonSerialLine.o FrelonModel.o FrelonCamera.o \
SRCS = $(frelon-objs:.o=.cpp)
CXXFLAGS = -I../include -I../../common/espia/include -I../../../third-party/Processlib/core/include \
CXXFLAGS = -I../include -I../../common/espia/include \
-I../../../hardware/include -I../../../common/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread -fPIC -g
......
......@@ -5,7 +5,7 @@ SRCS = $(maxipix-objs:.o=.cpp)
include ../../common/espia/include/espia.inc
INCLUDES = -I../include -I../../../third-party/Processlib/core/include\
INCLUDES = -I../include \
-I../../../common/include \
-I../../../hardware/include \
-I../../common/espia/include \
......
......@@ -10,14 +10,14 @@
#define FRAMEBUILDER_H
#include <vector>
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "SizeUtils.h"
#include "Exceptions.h"
namespace lima {
struct DLL_EXPORT GaussPeak {
struct LIMACORE_API GaussPeak {
int x0, y0; /// The center of the peak
unsigned fwhm; /// Full Width at Half Maximum
double max; /// The maximum value
......@@ -30,7 +30,7 @@ struct DLL_EXPORT GaussPeak {
* @brief This class configures and generates frames for the Simulator
*
*******************************************************************/
class DLL_EXPORT FrameBuilder {
class LIMACORE_API FrameBuilder {
public:
FrameBuilder();
......
#ifndef SIMUHWINTERFACE_H
#define SIMUHWINTERFACE_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "HwInterface.h"
#include "Simulator.h"
......@@ -15,7 +15,7 @@ class SimuHwInterface;
* \brief Control object providing simulator detector info interface
*******************************************************************/
class DLL_EXPORT SimuDetInfoCtrlObj : public HwDetInfoCtrlObj
class LIMACORE_API SimuDetInfoCtrlObj : public HwDetInfoCtrlObj
{
public:
SimuDetInfoCtrlObj(Simulator& simu);
......@@ -54,7 +54,7 @@ class DLL_EXPORT SimuDetInfoCtrlObj : public HwDetInfoCtrlObj
* \brief Control object providing simulator buffering interface
*******************************************************************/
class DLL_EXPORT SimuBufferCtrlObj : public HwBufferCtrlObj
class LIMACORE_API SimuBufferCtrlObj : public HwBufferCtrlObj
{
public:
SimuBufferCtrlObj(Simulator& simu);
......@@ -91,7 +91,7 @@ class DLL_EXPORT SimuBufferCtrlObj : public HwBufferCtrlObj
* \brief Control object providing simulator synchronization interface
*******************************************************************/
class DLL_EXPORT SimuSyncCtrlObj : public HwSyncCtrlObj
class LIMACORE_API SimuSyncCtrlObj : public HwSyncCtrlObj
{
public:
SimuSyncCtrlObj(Simulator& simu, HwBufferCtrlObj& buffer_ctrl);
......@@ -122,7 +122,7 @@ class DLL_EXPORT SimuSyncCtrlObj : public HwSyncCtrlObj
* \brief Control object providing simulator binning interface
*******************************************************************/
class DLL_EXPORT SimuBinCtrlObj : public HwBinCtrlObj
class LIMACORE_API SimuBinCtrlObj : public HwBinCtrlObj
{
public:
SimuBinCtrlObj(Simulator& simu);
......@@ -142,7 +142,7 @@ class DLL_EXPORT SimuBinCtrlObj : public HwBinCtrlObj
* \brief Simulator hardware interface
*******************************************************************/
class DLL_EXPORT SimuHwInterface : public HwInterface
class LIMACORE_API SimuHwInterface : public HwInterface
{
public:
SimuHwInterface(Simulator& simu);
......
......@@ -10,7 +10,7 @@
namespace lima
{
class DLL_EXPORT Simulator
class LIMACORE_API Simulator
{
public:
enum Status {
......@@ -90,7 +90,7 @@ class DLL_EXPORT Simulator
SimuThread m_thread;
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, Simulator& simu);
LIMACORE_API std::ostream& operator <<(std::ostream& os, Simulator& simu);
} // namespace lima
......
......@@ -3,7 +3,7 @@ simu-objs = FrameBuilder.o Simulator.o SimuHwInterface.o
SRCS = $(simu-objs:.o=.cpp)
CXX = g++
INC = -I../include -I../../../common/include -I../../../hardware/include -I../../../third-party/Processlib/core/include
INC = -I../include -I../../../common/include -I../../../hardware/include
CXXFLAGS += $(INC) -Wall -pthread -fPIC -g
all: Simu.o
......
......@@ -14,7 +14,7 @@ testsimuhwinterface-ext-objs = $(simu-objs) $(std-objs)
SRCS = $(test-objs:.o=.cpp) $(testsimulator-objs:.o=.cpp) \
$(testsimuhwinterface-objs:.o=.cpp)
INC = -I../include -I../../../common/include -I../../../hardware/include -I../../../third-party/Processlib/core/include
INC = -I../include -I../../../common/include -I../../../hardware/include
CXXFLAGS += $(INC) -Wall -pthread -g
LDFLAGS = -pthread
......
#ifndef ACQSTATE_H
#define ACQSTATE_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "ThreadUtils.h"
#include <ostream>
......@@ -9,7 +9,7 @@
namespace lima
{
class DLL_EXPORT AcqState
class LIMACORE_API AcqState
{
public:
enum State {
......
......@@ -3,7 +3,7 @@
#include <stdio.h> // For NULL
#include "Compatibility.h"
#include "LimaCompatibility.h"
namespace lima
{
......@@ -12,7 +12,7 @@ namespace lima
* AutoCounter
********************************************************************/
class DLL_EXPORT AutoCounter
class LIMACORE_API AutoCounter
{
public:
AutoCounter() : r(1)
......@@ -37,7 +37,7 @@ private:
********************************************************************/
template <class M>
class DLL_EXPORT AutoLock
class LIMACORE_API AutoLock
{
public:
enum { UnLocked, Locked, TryLocked, PrevLocked };
......@@ -164,7 +164,7 @@ private:
********************************************************************/
template <class T, bool array=false>
class DLL_EXPORT AutoPtr
class LIMACORE_API AutoPtr
{
public:
AutoPtr()
......
......@@ -13,7 +13,7 @@
#include <string>
#include <fstream>
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "HwFrameInfo.h"
namespace lima {
......@@ -25,7 +25,7 @@ namespace lima {
* The main method is writeFrame(const HwFrameInfoType& finfo).
* The other methods configure the saving parameters.
*******************************************************************/
class DLL_EXPORT BufferSave {
class LIMACORE_API BufferSave {
public :
enum FileFormat {
Raw, EDF,
......
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include <ostream>
#include <vector>
......@@ -12,7 +12,7 @@ enum AlignDir {
Floor, Ceil,
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, AlignDir align_dir);
LIMACORE_API std::ostream& operator <<(std::ostream& os, AlignDir align_dir);
/**@brief ImageType is the depth of detectors images
* - Bpp8 means 8 bits unsigned
* - Bpp8S means 8 bits signed....
......@@ -22,13 +22,13 @@ enum ImageType {
Bpp16, Bpp16S, Bpp32, Bpp32S
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, ImageType image_type);
LIMACORE_API std::ostream& operator <<(std::ostream& os, ImageType image_type);
enum AcqMode {
Single, Concatenation, Accumulation,
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, AcqMode acq_mode);
LIMACORE_API std::ostream& operator <<(std::ostream& os, AcqMode acq_mode);
enum TrigMode {
IntTrig,
......@@ -36,13 +36,13 @@ enum TrigMode {
ExtGate, ExtStartStop,
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, TrigMode trig_mode);
LIMACORE_API std::ostream& operator <<(std::ostream& os, TrigMode trig_mode);
enum BufferMode {
Linear, Circular,
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, BufferMode buffer_mode);
LIMACORE_API std::ostream& operator <<(std::ostream& os, BufferMode buffer_mode);
enum ShutterMode {
ShutterManual, ShutterAutoFrame, ShutterAutoSequence
......@@ -50,13 +50,13 @@ enum ShutterMode {
typedef std::vector<ShutterMode> ShutterModeList;
DLL_EXPORT std::ostream& operator <<(std::ostream& os, ShutterMode shutter_mode);
LIMACORE_API std::ostream& operator <<(std::ostream& os, ShutterMode shutter_mode);
enum AcqStatus {
AcqReady, AcqRunning, AcqFault,
};
DLL_EXPORT std::ostream& operator <<(std::ostream& os, AcqStatus acq_status);
LIMACORE_API std::ostream& operator <<(std::ostream& os, AcqStatus acq_status);
enum DetStatus {
DetIdle = 0x00,
......@@ -70,10 +70,10 @@ enum DetStatus {
DetLatency = 0x80,
};
DLL_EXPORT DetStatus operator | (DetStatus s1, DetStatus s2);
DLL_EXPORT DetStatus& operator |=(DetStatus& s1, DetStatus s2);
LIMACORE_API DetStatus operator | (DetStatus s1, DetStatus s2);
LIMACORE_API DetStatus& operator |=(DetStatus& s1, DetStatus s2);
DLL_EXPORT std::ostream& operator <<(std::ostream& os, DetStatus det_status);
LIMACORE_API std::ostream& operator <<(std::ostream& os, DetStatus det_status);
} // namespace lima
......
......@@ -4,16 +4,7 @@
#ifndef DEBUG_H
#define DEBUG_H
#ifdef WIN32
#ifdef LIMACORE_EXPORTS
#define DEBUG_EXPORT __declspec(dllexport)
#else
#define DEBUG_EXPORT __declspec(dllimport)
#endif
#else /* Unix */
#define DEBUG_EXPORT
#endif
#include "LimaCompatibility.h"
#include "StreamUtils.h"
#include "ThreadUtils.h"
......@@ -71,7 +62,7 @@ typedef const char *ConstStr;
* class DebStream
*------------------------------------------------------------------*/
class DEBUG_EXPORT DebStream : public std::ostream
class LIMACORE_API DebStream : public std::ostream
{
public:
typedef OCopyStream::StreamList StreamList;
......@@ -121,7 +112,7 @@ inline DebStream& DebStream::SetStream(Selector new_selector)
class DebObj;
class DebProxy;
class DEBUG_EXPORT DebParams
class LIMACORE_API DebParams
{
public:
typedef long long Flags;
......@@ -220,7 +211,7 @@ std::ostream& operator <<(std::ostream& os,
* class DebProxy
*------------------------------------------------------------------*/
class DEBUG_EXPORT DebProxy
class LIMACORE_API DebProxy
{
public:
DebProxy();
......@@ -243,7 +234,7 @@ class DEBUG_EXPORT DebProxy
* class DebObj
*------------------------------------------------------------------*/
class DEBUG_EXPORT DebObj
class LIMACORE_API DebObj
{
public:
enum {
......@@ -289,7 +280,7 @@ class DEBUG_EXPORT DebObj
* class DebHex
*------------------------------------------------------------------*/
class DEBUG_EXPORT DebHex
class LIMACORE_API DebHex
{
public:
DebHex(unsigned long val) : m_val(val)
......
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "Debug.h"
......@@ -21,7 +21,7 @@ enum ErrorType {
};
class DLL_EXPORT ExcDebProxy
class LIMACORE_API ExcDebProxy
{
public:
ExcDebProxy(DebProxy *deb_proxy = NULL);
......@@ -44,7 +44,7 @@ class DLL_EXPORT ExcDebProxy
};
class DLL_EXPORT Exception
class LIMACORE_API Exception
{
public:
Exception(Layer layer, ErrorType err_type, const std::string& err_desc,
......
#ifndef LIMACOMPATIBILITY_H
#define LIMACOMPATIBILITY_H
#ifdef WIN32
#ifdef LIMACORE_EXPORTS
#define LIMACORE_API __declspec(dllexport)
#else
#define LIMACORE_API __declspec(dllimport)
#endif
#else /* Unix */
#define LIMACORE_API
#endif
#endif
#ifndef MEMUTILS_H
#define MEMUTILS_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "SizeUtils.h"
#include "Debug.h"
namespace lima
{
void DLL_EXPORT GetSystemMem(int& mem_unit, int& system_mem);
void LIMACORE_API GetSystemMem(int& mem_unit, int& system_mem);
void DLL_EXPORT GetPageSize(int& page_size);
void LIMACORE_API GetPageSize(int& page_size);
int DLL_EXPORT GetDefMaxNbBuffers(const FrameDim& frame_dim, double sys_mem_factor = 0);
int LIMACORE_API GetDefMaxNbBuffers(const FrameDim& frame_dim, double sys_mem_factor = 0);
void DLL_EXPORT ClearBuffer(void *ptr, int nb_concat_frames, const FrameDim& frame_dim);
void LIMACORE_API ClearBuffer(void *ptr, int nb_concat_frames, const FrameDim& frame_dim);
class DLL_EXPORT MemBuffer
class LIMACORE_API MemBuffer
{
public:
enum {
......
......@@ -4,7 +4,7 @@
#include <map>
#include <algorithm>
#include "Compatibility.h"
#include "LimaCompatibility.h"
namespace lima
{
......@@ -16,7 +16,7 @@ namespace lima
// Map search helpers
template <class V>
class DLL_EXPORT SecondIs
class LIMACORE_API SecondIs
{
public:
SecondIs(V v) : m_val(v)
......
#ifndef SIZEUTILS_H
#define SIZEUTILS_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "Constants.h"
#include "Exceptions.h"
#include <ostream>
......@@ -30,7 +30,7 @@ inline bool IsPowerOf2(int x)
* This utility class provides basic arithmetic in two dimensions
*******************************************************************/
class DLL_EXPORT Point
class LIMACORE_API Point
{
public:
int x, y;
......@@ -129,7 +129,7 @@ enum YBorder {
std::ostream& operator <<(std::ostream& os, XBorder xb);
std::ostream& operator <<(std::ostream& os, YBorder yb);
class DLL_EXPORT Corner
class LIMACORE_API Corner
{
public:
Corner();
......@@ -209,7 +209,7 @@ std::ostream& operator <<(std::ostream& os, const Corner& c);
* This class helps managing the size of rectangular objects
*******************************************************************/
class DLL_EXPORT Size
class LIMACORE_API Size
{
public:
Size() : m_xy() {}
......@@ -278,7 +278,7 @@ std::ostream& operator <<(std::ostream& os, const Size& s);
* Basic binning handling. The values must be power of 2
*******************************************************************/
class DLL_EXPORT Bin
class LIMACORE_API Bin
{
public:
Bin() : m_xy(1) {}
......@@ -338,7 +338,7 @@ std::ostream& operator <<(std::ostream& os, const Bin& bin);
*
*******************************************************************/
class DLL_EXPORT Flip
class LIMACORE_API Flip
{
public:
bool x, y;
......@@ -373,7 +373,7 @@ inline Flip operator &(const Flip& f1, const Flip& f2)
* The bottom_right corner \b belongs to the roi: top_left + size - 1
*******************************************************************/
class DLL_EXPORT Roi
class LIMACORE_API Roi
{
public:
Roi() {}
......@@ -564,7 +564,7 @@ std::ostream& operator <<(std::ostream& os, const Roi& roi);
* practical reasons, it also contains the depth in bytes.
*******************************************************************/
class DLL_EXPORT FrameDim
class LIMACORE_API FrameDim
{
public:
FrameDim();
......
......@@ -8,9 +8,9 @@
#include <sstream>
#include <vector>
#include "Compatibility.h"
#include "LimaCompatibility.h"
class DLL_EXPORT NullStreamBuf : public std::stringbuf
class LIMACORE_API NullStreamBuf : public std::stringbuf
{
protected:
int sync()
......@@ -22,7 +22,7 @@ class DLL_EXPORT NullStreamBuf : public std::stringbuf
};
class DLL_EXPORT CopyStreamBuf : public std::stringbuf
class LIMACORE_API CopyStreamBuf : public std::stringbuf
{
public:
typedef std::vector<std::ostream *> StreamList;
......@@ -62,7 +62,7 @@ class DLL_EXPORT CopyStreamBuf : public std::stringbuf
};
class DLL_EXPORT OCopyStream : public std::ostream
class LIMACORE_API OCopyStream : public std::ostream
{
public:
typedef CopyStreamBuf::StreamList StreamList;
......
#ifndef THREADUTILS_H
#define THREADUTILS_H
#include "Compatibility.h"
#include "LimaCompatibility.h"
#include "AutoObj.h"
#include <pthread.h>
......@@ -11,7 +11,7 @@ namespace lima
class Mutex;
class Cond;
class DLL_EXPORT MutexAttr
class LIMACORE_API MutexAttr
{
public:
enum Type {
......@@ -36,7 +36,7 @@ class DLL_EXPORT MutexAttr
};
class DLL_EXPORT Mutex
class LIMACORE_API Mutex
{
public:
Mutex(MutexAttr mutex_attr = MutexAttr::Recursive);
......@@ -58,7 +58,7 @@ class DLL_EXPORT Mutex
typedef AutoLock<Mutex> AutoMutex;
class DLL_EXPORT Cond
class LIMACORE_API Cond
{
public:
Cond();
......@@ -77,7 +77,7 @@ class DLL_EXPORT Cond
};
class DLL_EXPORT Thread
class LIMACORE_API Thread
{
public:
Thread();
......@@ -101,7 +101,7 @@ class DLL_EXPORT Thread
};
class DLL_EXPORT CmdThread
class LIMACORE_API CmdThread
{
public:
enum { // Status
......@@ -134,7 +134,7 @@ class DLL_EXPORT CmdThread
AutoMutex tryLock();
private:
class DLL_EXPORT AuxThread : public Thread
class LIMACORE_API AuxThread : public Thread
{
public:
AuxThread(CmdThread& master);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment