Index: 0.6/Examples/Construction/Construction.cpp =================================================================== --- 0.6/Examples/Construction/Construction.cpp (Revision 639054) +++ 0.6/Examples/Construction/Construction.cpp (Arbeitskopie) @@ -16,7 +16,9 @@ */ extern "C" { +#ifndef _WIN32 #include +#endif } #include Index: 0.6/Examples/Construction/Construction.pro =================================================================== --- 0.6/Examples/Construction/Construction.pro (Revision 639054) +++ 0.6/Examples/Construction/Construction.pro (Arbeitskopie) @@ -1,7 +1,17 @@ TEMPLATE = app SOURCES += Construction.cpp INCLUDEPATH += ../../Weaver/ -LIBS += -L../../Weaver -lThreadWeaver +win32 { + debug { + LIBS += -L../../Weaver/debug -lThreadWeaver0 +} + else { + LIBS += -L../../Weaver/release -lThreadWeaver0 +} +} +else { + LIBS += -L../../Weaver -lThreadWeaver +} CONFIG += qt warn_on thread TARGET = Construction Index: 0.6/Examples/Jobs/Jobs.pro =================================================================== --- 0.6/Examples/Jobs/Jobs.pro (Revision 639054) +++ 0.6/Examples/Jobs/Jobs.pro (Arbeitskopie) @@ -3,6 +3,16 @@ HEADERS += Jobs.h WeaverObserverTest.h WeaverThreadGrid.h FORMS += JobsBase.ui INCLUDEPATH += ../../Weaver/ ../../Experimental -LIBS += -L../../Weaver -lThreadWeaver -L../../Experimental -lThreadWeaverExperimental +win32 { + debug { + LIBS += -L../../Weaver/debug -L../../Experimental/debug -lThreadWeaver0 -lThreadWeaverExperimental0 +} + else { + LIBS += -L../../Weaver/release -L../../Experimental/release -lThreadWeaver0 -lThreadWeaverExperimental0 +} +} +else { + LIBS += -L../../Weaver -lThreadWeaver -L../../Experimental -lThreadWeaverExperimental +} CONFIG += qt warn_on thread TARGET = Jobs Index: 0.6/Examples/QProcessJob/QProcessJob.pro =================================================================== --- 0.6/Examples/QProcessJob/QProcessJob.pro (Revision 639054) +++ 0.6/Examples/QProcessJob/QProcessJob.pro (Arbeitskopie) @@ -5,7 +5,17 @@ INCLUDEPATH += ../../Weaver/ -LIBS += -L../../Weaver -lThreadWeaver +win32 { + debug { + LIBS += -L../../Weaver/debug -lThreadWeaver0 +} + else { + LIBS += -L../../Weaver/release -lThreadWeaver0 +} +} +else { + LIBS += -L../../Weaver -lThreadWeaver +} CONFIG += qt warn_on thread Index: 0.6/Examples/SMIV/SMIV.pro =================================================================== --- 0.6/Examples/SMIV/SMIV.pro (Revision 639054) +++ 0.6/Examples/SMIV/SMIV.pro (Arbeitskopie) @@ -7,7 +7,17 @@ ComputeThumbNailJob.h FORMS += SMIVBase.ui INCLUDEPATH += ../../Weaver/ ../../Experimental -LIBS += -L../../Weaver -lThreadWeaver -L../../Experimental -lThreadWeaverExperimental +win32 { + debug { + LIBS += -L../../Weaver/debug -L../../Experimental/debug -lThreadWeaver0 -lThreadWeaverExperimental0 +} + else { + LIBS += -L../../Weaver/release -L../../Experimental/release -lThreadWeaver0 -lThreadWeaverExperimental0 +} +} +else { + LIBS += -L../../Weaver -lThreadWeaver -L../../Experimental -lThreadWeaverExperimental +} CONFIG += qt warn_on thread TARGET = smiv Index: 0.6/Experimental/Experimental.pro =================================================================== --- 0.6/Experimental/Experimental.pro (Revision 639054) +++ 0.6/Experimental/Experimental.pro (Arbeitskopie) @@ -1,8 +1,19 @@ -TEMPLATE = lib -SOURCES += FileLoaderJob.cpp -HEADERS += FileLoaderJob.h -CONFIG += dll warn_on thread -VERSION = 0.4.0 -INCLUDEPATH += ../Weaver/ -LIBS += -L../Weaver -lThreadWeaver -TARGET = ThreadWeaverExperimental +TEMPLATE = lib +SOURCES += FileLoaderJob.cpp +HEADERS += FileLoaderJob.h +CONFIG += dll warn_on thread +VERSION = 0.4.0 +INCLUDEPATH += ../Weaver/ +win32 { + debug { + LIBS += -L../Weaver/debug -lThreadWeaver0 +} + else { + LIBS += -L../Weaver/release -lThreadWeaver0 +} + DEFINES += DLL_BAUEN +} +else { + LIBS += -L../Weaver -lThreadWeaver +} +TARGET = ThreadWeaverExperimental Index: 0.6/Experimental/FileLoaderJob.h =================================================================== --- 0.6/Experimental/FileLoaderJob.h (Revision 639054) +++ 0.6/Experimental/FileLoaderJob.h (Arbeitskopie) @@ -20,7 +20,11 @@ extern "C" { #include -#include +#ifndef _WIN32 + #include +#else + #include +#endif #include #include #include @@ -29,6 +33,16 @@ #include #include +#ifdef Q_WS_WIN + #ifdef DLL_BAUEN + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif + namespace ThreadWeaver { /** This Job, when executed, loads a file on the file system into memory @@ -42,7 +56,7 @@ The allocated memory gets freed on destruction of the object, or when freeMemory() is called. */ - class FileLoaderJob : public Job + class DLL_EXPORT FileLoaderJob : public Job { Q_OBJECT public: Index: 0.6/Tests/JobTests.pro =================================================================== --- 0.6/Tests/JobTests.pro (Revision 639054) +++ 0.6/Tests/JobTests.pro (Arbeitskopie) @@ -1,17 +1,28 @@ -TEMPLATE = app -TARGET = JobTests -DEPENDPATH += . -INCLUDEPATH += ../Weaver ../Experimental -LIBS += -L../Weaver -lThreadWeaver -L../Experimental -lThreadWeaverExperimental -CONFIG += qtestlib - -test.target = test -unix:test.commands = LD_LIBRARY_PATH=../Weaver:../Experimental ./$(TARGET) -macx:test.commands = DYLD_LIBRARY_PATH=../Weaver:../Experimental ./$(TARGET) -test.depends = $(TARGET) -QMAKE_EXTRA_TARGETS += test - -SOURCES += JobTests.cpp \ - AppendCharacterJob.cpp - -HEADERS += AppendCharacterJob.h +TEMPLATE = app +TARGET = JobTests +DEPENDPATH += . +INCLUDEPATH += ../Weaver ../Experimental +win32 { + debug { + LIBS += -L../Weaver/debug -lThreadWeaver0 -L../Experimental/debug -lThreadWeaverExperimental0 +} + else { + LIBS += -L../Weaver/release -lThreadWeaver0 -L../Experimental/release -lThreadWeaverExperimental0 +} +} +else { + LIBS += -L../Weaver -lThreadWeaver -L../Experimental -lThreadWeaverExperimental +} + +CONFIG += qtestlib + +test.target = test +unix:test.commands = LD_LIBRARY_PATH=../Weaver:../Experimental ./$(TARGET) +macx:test.commands = DYLD_LIBRARY_PATH=../Weaver:../Experimental ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +SOURCES += JobTests.cpp \ + AppendCharacterJob.cpp + +HEADERS += AppendCharacterJob.h Index: 0.6/Tests/QueueTests.pro =================================================================== --- 0.6/Tests/QueueTests.pro (Revision 639054) +++ 0.6/Tests/QueueTests.pro (Arbeitskopie) @@ -2,7 +2,17 @@ TARGET = QueueTests DEPENDPATH += . INCLUDEPATH += ../Weaver ../Experimental -LIBS += -L../Weaver -lThreadWeaver -L../Experimental -lThreadWeaverExperimental +win32 { + debug { + LIBS += -L../Weaver/debug -lThreadWeaver0 -L../Experimental/debug -lThreadWeaverExperimental0 +} + else { + LIBS += -L../Weaver/release -lThreadWeaver0 -L../Experimental/release -lThreadWeaverExperimental0 +} +} +else { + LIBS += -L../Weaver -lThreadWeaver -L../Experimental -lThreadWeaverExperimental +} CONFIG += qtestlib test.target = test Index: 0.6/Weaver/DebuggingAids.cpp =================================================================== --- 0.6/Weaver/DebuggingAids.cpp (Revision 639054) +++ 0.6/Weaver/DebuggingAids.cpp (Arbeitskopie) @@ -20,6 +20,6 @@ /** A global mutex for the ThreadWeaver objects. Generally, you should not use it in your own code. */ -QMutex ThreadWeaver::GlobalMutex; -bool ThreadWeaver::Debug = true; -int ThreadWeaver::DebugLevel = 01; +DLL_EXPORT QMutex ThreadWeaver::GlobalMutex; +DLL_EXPORT bool ThreadWeaver::Debug = true; +DLL_EXPORT int ThreadWeaver::DebugLevel = 01; Index: 0.6/Weaver/DebuggingAids.h =================================================================== --- 0.6/Weaver/DebuggingAids.h (Revision 639054) +++ 0.6/Weaver/DebuggingAids.h (Arbeitskopie) @@ -20,7 +20,9 @@ extern "C" { #include +#ifndef _WIN32 #include +#endif #include #include #include @@ -29,11 +31,21 @@ #include #include +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif + namespace ThreadWeaver { - extern bool Debug; - extern int DebugLevel; - extern QMutex GlobalMutex; + extern DLL_EXPORT bool Debug; + extern DLL_EXPORT int DebugLevel; + extern DLL_EXPORT QMutex GlobalMutex; /** Set the debug log level. @see debug Index: 0.6/Weaver/DependencyPolicy.h =================================================================== --- 0.6/Weaver/DependencyPolicy.h (Revision 639054) +++ 0.6/Weaver/DependencyPolicy.h (Arbeitskopie) @@ -20,7 +20,15 @@ #include "QueuePolicy.h" namespace ThreadWeaver { - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif /** DependencyPolicy implements the way dependencies between Jobs are handled. To declare that Job B can only be executed when Job A is finished, @@ -32,7 +40,7 @@ JobSequence uses dependencies to implement the ordered execution of the sequence elements. */ - class DependencyPolicy : public QueuePolicy + class DLL_EXPORT DependencyPolicy : public QueuePolicy { public: /** Destructor. */ Index: 0.6/Weaver/Job.h =================================================================== --- 0.6/Weaver/Job.h (Revision 639054) +++ 0.6/Weaver/Job.h (Arbeitskopie) @@ -21,7 +21,15 @@ class QMutex; class QWaitCondition; - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif namespace ThreadWeaver { class Thread; @@ -45,7 +53,7 @@ DependencyPolicy. */ - class Job : public QObject + class DLL_EXPORT Job : public QObject { Q_OBJECT Index: 0.6/Weaver/JobCollection.h =================================================================== --- 0.6/Weaver/JobCollection.h (Revision 639054) +++ 0.6/Weaver/JobCollection.h (Arbeitskopie) @@ -19,6 +19,15 @@ #include "Job.h" +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif namespace ThreadWeaver { class Thread; @@ -31,7 +40,7 @@ * It is intended that the collection is set up first and then * queued. After queuing, no further jobs should be added to the collection. */ - class JobCollection : public Job + class DLL_EXPORT JobCollection : public Job { friend class JobCollectionJobRunner; Q_OBJECT Index: 0.6/Weaver/JobSequence.h =================================================================== --- 0.6/Weaver/JobSequence.h (Revision 639054) +++ 0.6/Weaver/JobSequence.h (Arbeitskopie) @@ -19,6 +19,16 @@ #include "JobCollection.h" +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif + namespace ThreadWeaver { /** A JobSequence is a vector of Jobs that will be executed in a sequence. @@ -30,7 +40,7 @@ slot. If it is called, the processing of the sequence will stop, and all it's remaining Jobs will be dequeued. */ - class JobSequence : public JobCollection + class DLL_EXPORT JobSequence : public JobCollection { Q_OBJECT Index: 0.6/Weaver/QueuePolicy.h =================================================================== --- 0.6/Weaver/QueuePolicy.h (Revision 639054) +++ 0.6/Weaver/QueuePolicy.h (Arbeitskopie) @@ -2,7 +2,15 @@ #define QUEUEPOLICY_H namespace ThreadWeaver { - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif class Job; /** QueuePolicy is an interface for customizations of the queueing behaviour @@ -26,7 +34,7 @@ jobs are executed. Jobs never assume ownership of their assigned queue policies. */ - class QueuePolicy + class DLL_EXPORT QueuePolicy { public: virtual ~QueuePolicy() {} Index: 0.6/Weaver/ResourceRestrictionPolicy.cpp =================================================================== --- 0.6/Weaver/ResourceRestrictionPolicy.cpp (Revision 639054) +++ 0.6/Weaver/ResourceRestrictionPolicy.cpp (Arbeitskopie) @@ -54,7 +54,7 @@ d->cap = cap; } -bool ResourceRestrictionPolicy::canRun( Job* job ) +bool ResourceRestrictionPolicy::canRun( ThreadWeaver::Job* job ) { QMutexLocker l ( & d->mutex ); if ( d->customers.size() < d->cap ) @@ -66,7 +66,7 @@ } } -void ResourceRestrictionPolicy::free ( Job* job ) +void ResourceRestrictionPolicy::free ( ThreadWeaver::Job* job ) { QMutexLocker l ( & d->mutex ); int position = d->customers.indexOf (job); @@ -78,12 +78,12 @@ } } -void ResourceRestrictionPolicy::release ( Job* job ) +void ResourceRestrictionPolicy::release ( ThreadWeaver::Job* job ) { free (job); } -void ResourceRestrictionPolicy::destructed ( Job* job ) +void ResourceRestrictionPolicy::destructed ( ThreadWeaver::Job* job ) { free (job); } Index: 0.6/Weaver/ResourceRestrictionPolicy.h =================================================================== --- 0.6/Weaver/ResourceRestrictionPolicy.h (Revision 639054) +++ 0.6/Weaver/ResourceRestrictionPolicy.h (Arbeitskopie) @@ -21,6 +21,15 @@ namespace ThreadWeaver { +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif /** ResourceRestrictionPolicy is used to limit the number of concurrent accesses to the same resource. @@ -39,7 +48,7 @@ */ - class ResourceRestrictionPolicy : public QueuePolicy + class DLL_EXPORT ResourceRestrictionPolicy : public QueuePolicy { public: explicit ResourceRestrictionPolicy ( int cap = 0); Index: 0.6/Weaver/State.h =================================================================== --- 0.6/Weaver/State.h (Revision 639054) +++ 0.6/Weaver/State.h (Arbeitskopie) @@ -18,9 +18,16 @@ #define THREADWEAVER_STATE_H #include - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif namespace ThreadWeaver { - class Job; class Thread; class WeaverInterface; @@ -56,7 +63,7 @@ /** We use a State pattern to handle the system state in ThreadWeaver. */ - class State + class DLL_EXPORT State { public: /** Default constructor. */ Index: 0.6/Weaver/Thread.h =================================================================== --- 0.6/Weaver/Thread.h (Revision 639054) +++ 0.6/Weaver/Thread.h (Arbeitskopie) @@ -23,14 +23,22 @@ #include namespace ThreadWeaver { - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif class Job; class WeaverImpl; class ThreadRunHelper; /** The class Thread is used to represent the worker threads in the weaver's inventory. It is not meant to be overloaded. */ - class Thread : public QThread + class DLL_EXPORT Thread : public QThread { Q_OBJECT Index: 0.6/Weaver/ThreadWeaver.h =================================================================== --- 0.6/Weaver/ThreadWeaver.h (Revision 639054) +++ 0.6/Weaver/ThreadWeaver.h (Arbeitskopie) @@ -22,6 +22,15 @@ #include "WeaverInterface.h" namespace ThreadWeaver { +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif class Job; class State; @@ -49,7 +58,7 @@ derived WeaverImpl objects. */ - class Weaver : public WeaverInterface + class DLL_EXPORT Weaver : public WeaverInterface { Q_OBJECT public: Index: 0.6/Weaver/Weaver.pro =================================================================== --- 0.6/Weaver/Weaver.pro (Revision 639054) +++ 0.6/Weaver/Weaver.pro (Arbeitskopie) @@ -1,39 +1,38 @@ -TEMPLATE = lib - -SOURCES += WeaverInterface.cpp \ - ThreadWeaver.cpp WeaverImpl.cpp \ - DebuggingAids.cpp Thread.cpp Job.cpp \ - State.cpp \ - StateImplementation.cpp \ - InConstructionState.cpp WorkingHardState.cpp \ - SuspendingState.cpp SuspendedState.cpp \ - ShuttingDownState.cpp DestructedState.cpp \ - WeaverObserver.cpp \ - JobCollection.cpp \ - JobSequence.cpp \ - DependencyPolicy.cpp \ - ResourceRestrictionPolicy.cpp - -HEADERS += WeaverInterface.h \ - ThreadWeaver.h WeaverImpl.h \ - DebuggingAids.h Thread.h Job.h \ - State.h \ - StateImplementation.h \ - InConstructionState.h WorkingHardState.h \ - SuspendingState.h SuspendedState.h \ - ShuttingDownState.h DestructedState.h \ - WeaverObserver.h \ - JobCollection.h \ - JobSequence.h \ - QueuePolicy.h \ - DependencyPolicy.h \ - ResourceRestrictionPolicy.h - -CONFIG += dll warn_on thread -QT -= gui -VERSION = 0.4.0 -TARGET = ThreadWeaver - -test.target=test -test.commands= cd .. && $(MAKE) test -QMAKE_EXTRA_TARGETS += test +TEMPLATE = lib +win32:DEFINES += DLL_BAUENW +SOURCES += WeaverInterface.cpp \ + ThreadWeaver.cpp WeaverImpl.cpp \ + DebuggingAids.cpp Thread.cpp Job.cpp \ + State.cpp \ + StateImplementation.cpp \ + InConstructionState.cpp WorkingHardState.cpp \ + SuspendingState.cpp SuspendedState.cpp \ + ShuttingDownState.cpp DestructedState.cpp \ + WeaverObserver.cpp \ + JobCollection.cpp \ + JobSequence.cpp \ + DependencyPolicy.cpp \ + ResourceRestrictionPolicy.cpp + +HEADERS += WeaverInterface.h \ + ThreadWeaver.h WeaverImpl.h \ + DebuggingAids.h Thread.h Job.h \ + State.h \ + StateImplementation.h \ + InConstructionState.h WorkingHardState.h \ + SuspendingState.h SuspendedState.h \ + ShuttingDownState.h DestructedState.h \ + WeaverObserver.h \ + JobCollection.h \ + JobSequence.h \ + QueuePolicy.h \ + DependencyPolicy.h \ + ResourceRestrictionPolicy.h + +CONFIG += dll warn_on thread +QT -= gui +VERSION = 0.4.0 +TARGET = ThreadWeaver +test.target=test +test.commands= cd .. && $(MAKE) test +QMAKE_EXTRA_TARGETS += test Index: 0.6/Weaver/WeaverInterface.h =================================================================== --- 0.6/Weaver/WeaverInterface.h (Revision 639054) +++ 0.6/Weaver/WeaverInterface.h (Arbeitskopie) @@ -19,8 +19,16 @@ #include +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif namespace ThreadWeaver { - class Job; class State; class WeaverObserver; @@ -44,7 +52,7 @@ WeaverImpl classes. */ - class WeaverInterface : public QObject { + class DLL_EXPORT WeaverInterface : public QObject { Q_OBJECT public: Index: 0.6/Weaver/WeaverObserver.h =================================================================== --- 0.6/Weaver/WeaverObserver.h (Revision 639054) +++ 0.6/Weaver/WeaverObserver.h (Arbeitskopie) @@ -20,7 +20,15 @@ #include namespace ThreadWeaver { - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif class Job; class State; class Thread; @@ -41,7 +49,7 @@ aware not to delete Job objects externally that you reference in a WeaverObserver implementation. */ - class WeaverObserver : public QObject + class DLL_EXPORT WeaverObserver : public QObject { Q_OBJECT public: Index: 0.6/Weaver/WorkingHardState.h =================================================================== --- 0.6/Weaver/WorkingHardState.h (Revision 639054) +++ 0.6/Weaver/WorkingHardState.h (Arbeitskopie) @@ -24,10 +24,18 @@ #endif namespace ThreadWeaver { - +#ifdef Q_WS_WIN + #ifdef DLL_BAUENW + #define DLL_EXPORT __declspec(dllexport) + #else + #define DLL_EXPORT __declspec(dllimport) + #endif +#else + #define DLL_EXPORT +#endif /* WorkingHardState handles the state dependent calls in the state where jobs are executed. */ - class WorkingHardState : public StateImplementation + class DLL_EXPORT WorkingHardState : public StateImplementation { public: explicit WorkingHardState( WeaverImpl *weaver)