Commit bcd33a11 authored by Julien Wintz's avatar Julien Wintz
Browse files

Adding x-platform export rules for non support layers.

parent 980162e1
......@@ -206,6 +206,24 @@ target_link_libraries(${PROJECT_NAME} dtkLog)
target_link_libraries(${PROJECT_NAME} dtkCore)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
## #################################################################
## Export header file
## #################################################################
add_compiler_export_flags()
generate_export_header(${PROJECT_NAME}
EXPORT_FILE_NAME "${PROJECT_NAME}Export.h")
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export")
set(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS}
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export.h")
## ###################################################################
## Install rules - files
## ###################################################################
......
......@@ -62,6 +62,24 @@ qt5_use_modules(${PROJECT_NAME} Core)
target_link_libraries(${PROJECT_NAME} dtkMeta)
## #################################################################
## Export header file
## #################################################################
add_compiler_export_flags()
generate_export_header(${PROJECT_NAME}
EXPORT_FILE_NAME "${PROJECT_NAME}Export.h")
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export")
set(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS}
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export.h")
## ###################################################################
## Install rules - files
## ###################################################################
......
// Version: $Id$
//
//
//
//
// Commentary:
//
//
// Commentary:
//
//
// Change Log:
//
//
//
//
// Code:
......@@ -16,8 +16,10 @@
#include <QtCore>
#include <dtkCoreExport>
// /////////////////////////////////////////////////////////////////
//
//
// /////////////////////////////////////////////////////////////////
template <typename T> struct dtkArrayDataTemplate;
......@@ -26,7 +28,7 @@ template <> struct dtkArrayDataTemplate<qint32>
{
public:
dtkArrayDataTemplate(void) {}
dtkArrayDataTemplate(int r, qint32 s, quint32 a, quint32 c, qptrdiff o) : size(s), alloc(a), capacityReserved(c), offset(o)
dtkArrayDataTemplate(int r, qint32 s, quint32 a, quint32 c, qptrdiff o) : size(s), alloc(a), capacityReserved(c), offset(o)
{
ref.atomic.store(r);
}
......@@ -57,12 +59,12 @@ public:
};
// /////////////////////////////////////////////////////////////////
//
//
// /////////////////////////////////////////////////////////////////
typedef dtkArrayDataTemplate<qintptr> dtkArrayDataBase;
struct dtkArrayData : public dtkArrayDataBase
struct DTKCORE_EXPORT dtkArrayData : public dtkArrayDataBase
{
public:
using dtkArrayDataBase::ref;
......@@ -100,7 +102,7 @@ public:
AllocationOptions detachFlags(void) const;
AllocationOptions cloneFlags(void) const;
public:
static dtkArrayData *allocate(size_t objectSize, size_t alignment, size_t capacity, AllocationOptions options = Default);
static void deallocate(dtkArrayData *data, size_t objectSize, size_t alignment);
......@@ -115,15 +117,15 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(dtkArrayData::AllocationOptions)
// /////////////////////////////////////////////////////////////////
inline size_t dtkArrayData::detachCapacity(size_t newSize) const
{
if (capacityReserved && newSize < alloc)
{
if (capacityReserved && newSize < alloc)
return alloc;
return newSize;
return newSize;
}
inline dtkArrayData::AllocationOptions dtkArrayData::detachFlags(void) const
{
AllocationOptions result;
{
AllocationOptions result;
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (!ref.isSharable())
result |= Unsharable;
......@@ -142,7 +144,7 @@ inline dtkArrayData::AllocationOptions dtkArrayData::cloneFlags(void) const
}
// /////////////////////////////////////////////////////////////////
//
//
// /////////////////////////////////////////////////////////////////
template <typename T> struct dtkTypedArrayData : dtkArrayData
......@@ -184,7 +186,7 @@ public:
iterator operator + (qintptr j) const { return iterator(i+j); }
iterator operator - (qintptr j) const { return iterator(i-j); }
qintptr operator - (const iterator& j) const { return i - j.i; }
operator T* (void) const { return i; }
operator T* (void) const { return i; }
};
friend class iterator;
......@@ -260,7 +262,7 @@ template <typename T> inline dtkTypedArrayData<T> *dtkTypedArrayData<T>::allocat
}
template <typename T> inline void dtkTypedArrayData<T>::deallocate(dtkArrayData *data)
{
{
Q_STATIC_ASSERT(sizeof(dtkTypedArrayData) == sizeof(dtkArrayData));
dtkArrayData::deallocate(data, sizeof(T), Q_ALIGNOF(AlignmentDummy));
......@@ -301,5 +303,5 @@ template <typename T> inline dtkTypedArrayData<T> *dtkTypedArrayData<T>::unshara
return allocate(/* capacity */ 0, Unsharable);
}
//
//
// dtkArrayData.h ends here
/* dtkCorePlugin.h ---
*
* Author: Julien Wintz
* Created: Thu Feb 28 16:15:02 2013 (+0100)
* Version:
* Last-Updated: Wed Apr 10 16:30:25 2013 (+0200)
* By: Thibaud Kloczko
* Update #: 117
*/
/* Change Log:
*
*/
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#pragma once
......@@ -21,7 +22,7 @@
// DTK_DECLARE_OBJECT
// ///////////////////////////////////////////////////////////////////
#define DTK_DECLARE_OBJECT(type) \
#define DTK_DECLARE_OBJECT(type) \
Q_DECLARE_METATYPE(type)
// ///////////////////////////////////////////////////////////////////
......@@ -34,23 +35,23 @@
#define DTK_DECLARE_PLUGIN_INTERFACE_NAME(type) \
fr.inria.type
#define DTK_DECLARE_PLUGIN_INTERFACE(type) \
#define DTK_DECLARE_PLUGIN_INTERFACE(type) \
DTK_DECLARE_PLUGIN_INTERFACE_NAME_STRINGIFIED(DTK_DECLARE_PLUGIN_INTERFACE_NAME(type))
#define DTK_DECLARE_PLUGIN(type) \
class type##Plugin : public QObject \
{ \
Q_OBJECT \
\
public: \
type##Plugin(void) {} \
virtual ~type##Plugin(void) {} \
\
public: \
virtual void initialize(void) = 0; \
virtual void uninitialize(void) = 0; \
}; \
\
#define DTK_DECLARE_PLUGIN(type) \
class type##Plugin : public QObject \
{ \
Q_OBJECT \
\
public: \
type##Plugin(void) {} \
virtual ~type##Plugin(void) {} \
\
public: \
virtual void initialize(void) = 0; \
virtual void uninitialize(void) = 0; \
}; \
\
Q_DECLARE_INTERFACE(type##Plugin, DTK_DECLARE_PLUGIN_INTERFACE(type))
// ///////////////////////////////////////////////////////////////////
......@@ -74,3 +75,6 @@
#define DTK_DEFINE_PLUGIN(type) \
Q_PLUGIN_METADATA(IID DTK_DECLARE_PLUGIN_INTERFACE(type))
//
// dtkCorePlugin.h ends here
### CMakeLists.txt ---
##
### CMakeLists.txt ---
##
## Author: Julien Wintz
## Copyright (C) 2008 - Julien Wintz, Inria.
## Created: Mon Jul 20 18:39:20 2009 (+0200)
......@@ -8,13 +8,13 @@
## By: Nicolas Niclausse
## Update #: 409
######################################################################
##
### Commentary:
##
##
### Commentary:
##
######################################################################
##
##
### Change log:
##
##
######################################################################
project(dtkCoreSupport)
......@@ -110,15 +110,15 @@ set(${PROJECT_NAME}_SOURCES_WRAP)
if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
set(${PROJECT_NAME}_WRAP_DEPENDS ${${PROJECT_NAME}_HEADERS})
if(PYTHONLIBS_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP core python ${PROJECT_SOURCE_DIR}/dtkCore.i ${${PROJECT_NAME}_WRAP_DEPENDS})
endif()
if(TCL_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP core tcl ${PROJECT_SOURCE_DIR}/dtkCore.i ${${PROJECT_NAME}_WRAP_DEPENDS})
endif()
if(TRUE)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP core csharp ${PROJECT_SOURCE_DIR}/dtkCore.i ${${PROJECT_NAME}_WRAP_DEPENDS})
endif()
......@@ -164,8 +164,6 @@ add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export")
## #################################################################
## Installation
## #################################################################
......
......@@ -103,6 +103,24 @@ qt5_use_modules(${PROJECT_NAME} Xml)
target_link_libraries(${PROJECT_NAME} dtkCore)
target_link_libraries(${PROJECT_NAME} dtkLog)
## #################################################################
## Export header file
## #################################################################
add_compiler_export_flags()
generate_export_header(${PROJECT_NAME}
EXPORT_FILE_NAME "${PROJECT_NAME}Export.h")
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export")
set(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS}
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export.h")
## ###################################################################
## Install rules - files
## ###################################################################
......
......@@ -14,6 +14,8 @@
#pragma once
#include <dtkDistributedExport>
class dtkDistributedCommunicatorPlugin;
class dtkDistributedCommunicatorPluginFactory;
class dtkDistributedCommunicatorPluginManager;
......@@ -35,19 +37,19 @@ namespace dtkDistributed
#pragma mark -
#pragma mark Setting distribution mode
void setMode(dtkDistributed::Mode);
DTKDISTRIBUTED_EXPORT void setMode(dtkDistributed::Mode);
#pragma mark -
#pragma mark Querying distribution mode
dtkDistributed::Mode mode(void);
DTKDISTRIBUTED_EXPORT dtkDistributed::Mode mode(void);
#pragma mark -
#pragma mark Modular concepts
namespace communicator {
dtkDistributedCommunicatorPluginFactory& pluginFactory(void);
dtkDistributedCommunicatorPluginManager& pluginManager(void);
DTKDISTRIBUTED_EXPORT dtkDistributedCommunicatorPluginFactory& pluginFactory(void);
DTKDISTRIBUTED_EXPORT dtkDistributedCommunicatorPluginManager& pluginManager(void);
}
}
......
......@@ -15,6 +15,7 @@
#pragma once
#include "dtkDistributedMessage.h"
#include <dtkDistributedExport>
#include <QtCore>
#include <QtNetwork>
......@@ -23,7 +24,7 @@ class dtkDistributedControllerPrivate;
class dtkDistributedJob;
class dtkDistributedNode;
class dtkDistributedController : public QObject
class DTKDISTRIBUTED_EXPORT dtkDistributedController : public QObject
{
Q_OBJECT
......@@ -86,4 +87,3 @@ private:
private:
dtkDistributedControllerPrivate *d;
};
......@@ -14,11 +14,13 @@
#pragma once
#include <dtkDistributedExport>
#include <QTcpSocket>
class dtkDistributedMessagePrivate;
class dtkDistributedMessage
class DTKDISTRIBUTED_EXPORT dtkDistributedMessage
{
public:
typedef QHash<QString, QString> dtkDistributedHeaders;
......
......@@ -15,12 +15,14 @@
#pragma once
#include <dtkDistributedExport>
#include <QtCore>
class dtkDistributedPolicyPrivate;
class dtkDistributedCommunicator;
class dtkDistributedPolicy : public QObject
class DTKDISTRIBUTED_EXPORT dtkDistributedPolicy : public QObject
{
Q_OBJECT
......@@ -50,6 +52,3 @@ public:
public:
dtkDistributedPolicyPrivate *d;
};
/* dtkDistributedServerDaemon.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Wed Jun 1 11:27:42 2011 (+0200)
*/
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#pragma once
#include "dtkDistributedResourceManager.h"
#include <dtkDistributedExport>
#include <QtCore>
#include <QtNetwork>
class dtkDistributedServerDaemonPrivate;
class DTKDISTRIBUTED_EXPORT dtkDistributedServerDaemonPrivate;
class dtkDistributedServerDaemon : public QTcpServer
class DTKDISTRIBUTED_EXPORT dtkDistributedServerDaemon : public QTcpServer
{
Q_OBJECT
......@@ -41,3 +48,5 @@ private:
dtkDistributedServerDaemonPrivate *d;
};
//
// dtkDistributedServerDaemon.h ends here
/* dtkDistributedSettings.h ---
*
* Author: Julien Wintz
* Created: Mon Feb 11 14:50:18 2013 (+0100)
* Version:
* Last-Updated: Mon Feb 11 14:52:11 2013 (+0100)
* By: Julien Wintz
* Update #: 5
*/
/* Change Log:
*
*/
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#pragma once
#include <dtkDistributedExport>
#include <QtCore>
class dtkDistributedSettings : public QSettings
class DTKDISTRIBUTED_EXPORT dtkDistributedSettings : public QSettings
{
public:
explicit dtkDistributedSettings(void);
virtual ~dtkDistributedSettings(void);
};
//
// dtkDistributedSettings.h ends here
......@@ -15,12 +15,14 @@
#pragma once
#include <dtkDistributedExport>
#include <QtCore>
#include <QtNetwork>
class dtkDistributedSlavePrivate;
class dtkDistributedSlave : public QObject
class DTKDISTRIBUTED_EXPORT dtkDistributedSlave : public QObject
{
Q_OBJECT
......@@ -53,4 +55,3 @@ protected slots:
private:
dtkDistributedSlavePrivate *d;
};
/* @(#)dtkDistributedWork.h ---
*
* Author: Nicolas Niclausse
* Copyright (C) 2013 - Nicolas Niclausse, Inria.
* Created: 2013/02/15 13:47:58
*/
// Version: $Id$
//
//
/* Commentary:
*
*/
// Commentary:
//
//
/* Change log:
*
*/
// Change Log:
//
//
// Code:
#pragma once
#include <dtkDistributedExport>
#include <QtCore>
class dtkDistributedCommunicator;
class dtkDistributedWorker;
class dtkDistributedWorkPrivate;
class dtkDistributedWork : public QObject
class DTKDISTRIBUTED_EXPORT dtkDistributedWork : public QObject
{
Q_OBJECT
......@@ -58,3 +59,6 @@ public:
};
//
// dtkDistributedWork.h ends here
......@@ -18,13 +18,14 @@
#include <QtCore>
#include "dtkDistributed.h"
#include <dtkDistributedExport>
class dtkDistributedCommunicator;
class dtkDistributedContainer;
class dtkDistributedWork;
class dtkDistributedWorkerPrivate;
class dtkDistributedWorker : public QRunnable
class DTKDISTRIBUTED_EXPORT dtkDistributedWorker : public QRunnable
{
public:
dtkDistributedWorker(void);
......
......@@ -15,6 +15,8 @@
#pragma once
#include <dtkDistributedExport>
#include <QtCore>
class dtkDistributedCommunicator;
......@@ -22,7 +24,7 @@ class dtkDistributedPolicy;
class dtkDistributedWork;
class dtkDistributedWorkerManagerPrivate;
class dtkDistributedWorkerManager: public QObject
class DTKDISTRIBUTED_EXPORT dtkDistributedWorkerManager: public QObject
{
Q_OBJECT
......@@ -47,8 +49,3 @@ public:
dtkDistributedWorkerManagerPrivate *d;
};
......@@ -47,6 +47,24 @@ set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTA