make it shared, properly export symbols
authorKonrad Rosenbaum <konrad@silmor.de>
Wed, 25 Jul 2012 20:19:42 +0000 (22:19 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Wed, 25 Jul 2012 20:19:42 +0000 (22:19 +0200)
28 files changed:
include/AnyType [new file with mode: 0644]
include/BinaryOperator [new file with mode: 0644]
include/BoolEngine [new file with mode: 0644]
include/CharacterClassSettings [new file with mode: 0644]
include/Engine [new file with mode: 0644]
include/Exception [new file with mode: 0644]
include/Expression [new file with mode: 0644]
include/FloatEngine [new file with mode: 0644]
include/IntEngine [new file with mode: 0644]
include/IntFloatEngine [new file with mode: 0644]
include/Position [new file with mode: 0644]
include/StringEngine [new file with mode: 0644]
include/Token [new file with mode: 0644]
include/UnaryOperator [new file with mode: 0644]
include/elam.h [moved from src/elam.h with 85% similarity]
include/elambinary.h [moved from src/elambinary.h with 98% similarity]
include/elamboolengine.h [moved from src/elamboolengine.h with 93% similarity]
include/elamcharclass.h [moved from src/elamcharclass.h with 99% similarity]
include/elamengine.h [moved from src/elamengine.h with 99% similarity]
include/elamexpression.h [moved from src/elamexpression.h with 96% similarity]
include/elamfloatengine.h [moved from src/elamfloatengine.h with 93% similarity]
include/elamglobal.h [new file with mode: 0644]
include/elamintengine.h [moved from src/elamintengine.h with 92% similarity]
include/elamstringengine.h [moved from src/elamstringengine.h with 92% similarity]
include/elamunary.h [moved from src/elamunary.h with 99% similarity]
include/elamvalue.h [moved from src/elamvalue.h with 95% similarity]
src/elam.pro
src/elamengine.cpp

diff --git a/include/AnyType b/include/AnyType
new file mode 100644 (file)
index 0000000..5fcdb6e
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamvalue.h"
diff --git a/include/BinaryOperator b/include/BinaryOperator
new file mode 100644 (file)
index 0000000..9105013
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elambinary.h"
diff --git a/include/BoolEngine b/include/BoolEngine
new file mode 100644 (file)
index 0000000..cc9401d
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamboolengine.h"
diff --git a/include/CharacterClassSettings b/include/CharacterClassSettings
new file mode 100644 (file)
index 0000000..4d4b633
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamcharclass.h"
diff --git a/include/Engine b/include/Engine
new file mode 100644 (file)
index 0000000..bea5477
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamengine.h"
diff --git a/include/Exception b/include/Exception
new file mode 100644 (file)
index 0000000..5fcdb6e
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamvalue.h"
diff --git a/include/Expression b/include/Expression
new file mode 100644 (file)
index 0000000..c46a659
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamexpression.h"
diff --git a/include/FloatEngine b/include/FloatEngine
new file mode 100644 (file)
index 0000000..0e25e64
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamfloatengine.h"
diff --git a/include/IntEngine b/include/IntEngine
new file mode 100644 (file)
index 0000000..147f580
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamintengine.h"
diff --git a/include/IntFloatEngine b/include/IntFloatEngine
new file mode 100644 (file)
index 0000000..0e25e64
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamfloatengine.h"
diff --git a/include/Position b/include/Position
new file mode 100644 (file)
index 0000000..5fcdb6e
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamvalue.h"
diff --git a/include/StringEngine b/include/StringEngine
new file mode 100644 (file)
index 0000000..fceaf33
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamstringengine.h"
diff --git a/include/Token b/include/Token
new file mode 100644 (file)
index 0000000..c46a659
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamexpression.h"
diff --git a/include/UnaryOperator b/include/UnaryOperator
new file mode 100644 (file)
index 0000000..dcdf78b
--- /dev/null
@@ -0,0 +1,2 @@
+//auto-generated code, do not change
+#include "elamunary.h"
similarity index 85%
rename from src/elam.h
rename to include/elam.h
index d3806f9..b1017c9 100644 (file)
@@ -23,8 +23,6 @@ See the ELAM namespace for member documentation.
 
 namespace ELAM {
 
-///returns version information about ELAM
-inline QString versionInfo(){return "0.2 alpha";}
 
 };
 
similarity index 98%
rename from src/elambinary.h
rename to include/elambinary.h
index f0972bc..f18124c 100644 (file)
@@ -11,6 +11,7 @@
 #include <QVariant>
 
 #include "../dptr/dptr_base.h"
+#include "elamglobal.h"
 
 #include <functional>
 
@@ -36,7 +37,7 @@ typedef QVariant(*BinaryOperatorCall_FP)(const QVariant&op1,const QVariant&op2,E
 
 You can use the methods of this class to change the routines that handle the operator and the types on which it operates. Instances of this class are implicitly shared - meaning calls on a copy of an instance are also visible on the original and all other copies.
 */
-class BinaryOperator
+class ELAM_EXPORT BinaryOperator
 {
        DECLARE_SHARED_DPTR(d);
        public:
similarity index 93%
rename from src/elamboolengine.h
rename to include/elamboolengine.h
index 379bb32..d74fc21 100644 (file)
@@ -14,7 +14,7 @@ namespace ELAM {
 
 This engine type plays nicely with ELAM::IntEngine
 */
-class BoolEngine:public Engine
+class ELAM_EXPORT BoolEngine:public Engine
 {
        public:
                ///instantiates a pre-configured engine
similarity index 99%
rename from src/elamcharclass.h
rename to include/elamcharclass.h
index a3c32e8..c08bcd5 100644 (file)
@@ -48,7 +48,7 @@ None of these three classes may overlap. There are several more minor classes:
   - both surrounding another operator combine the operation with assignment (e.g. a+=b is equivalent to a=a+b)
 
 */
-class CharacterClassSettings
+class ELAM_EXPORT CharacterClassSettings
 {
        DECLARE_SHARED_DPTR(d)
        public:
similarity index 99%
rename from src/elamengine.h
rename to include/elamengine.h
index 0912bb2..1dab137 100644 (file)
@@ -21,6 +21,8 @@
 
 namespace ELAM {
 
+///returns version information about ELAM
+ELAM_EXPORT QString versionInfo();
 
 class Engine;
 
@@ -84,7 +86,7 @@ Instances of this class can be configured to represent a specific system of func
 
 Methods of this class are used to evaluate expressions into final values.
 */
-class Engine:public QObject
+class ELAM_EXPORT Engine:public QObject
 {
        Q_OBJECT
        DECLARE_DPTR(d);
similarity index 96%
rename from src/elamexpression.h
rename to include/elamexpression.h
index b804a05..2311fbf 100644 (file)
@@ -14,7 +14,7 @@ namespace ELAM {
 /**Represents a single token in a parsed expression.
 
 Tokens are pretty stupid themselves - they just know their type, position, their original piece of text and an optional value (literals). They are used by the engine and expressions to transform text into executable expressions.*/
-class Token
+class ELAM_EXPORT Token
 {
        DECLARE_SHARED_DPTR(d)
        public:
@@ -108,16 +108,16 @@ class Token
 };
 
 ///makes tokens accessable to qDebug()
-QDebug& operator<<(QDebug,const Token&);
+ELAM_EXPORT QDebug& operator<<(QDebug,const Token&);
 ///makes tokens accessable to qDebug()
-QDebug& operator<<(QDebug,const QList<Token>&);
+ELAM_EXPORT QDebug& operator<<(QDebug,const QList<Token>&);
 
 class Engine;
 /**Represents an expression in the context of its engine.
 
 An expression always has an engine as context and stores a hierarchy of operations (also expressions) to perform when called to evaluate. Expressions may become invalid if constants, functions, or operators change between the time they are created and the time they are evaluated.
 */
-class Expression
+class ELAM_EXPORT Expression
 {
        DECLARE_SHARED_DPTR(d)
        public:
@@ -168,7 +168,7 @@ class Expression
 };
 
 ///makes expressions accessable to qDebug()
-QDebug& operator<<(QDebug,const Expression&);
+ELAM_EXPORT QDebug& operator<<(QDebug,const Expression&);
 
 //end of namespace
 };
similarity index 93%
rename from src/elamfloatengine.h
rename to include/elamfloatengine.h
index b850789..0a5c133 100644 (file)
@@ -16,7 +16,7 @@ This engine type plays nice with the IntEngine functions by supplemening its ope
 
 Per default only the float versions are pre-installed. Use IntEngine::configureIntEngine or IntFloatEngine to have both.
 */
-class FloatEngine:public Engine
+class ELAM_EXPORT FloatEngine:public Engine
 {
        public:
                ///instantiates a pre-initialized engine
@@ -32,7 +32,7 @@ class FloatEngine:public Engine
 };
 
 ///an engine with integer and float math pre-installed, see IntEngine and FloatEngine
-class IntFloatEngine:public Engine
+class ELAM_EXPORT IntFloatEngine:public Engine
 {
        public:
                ///instantiates a pre-installed engine
diff --git a/include/elamglobal.h b/include/elamglobal.h
new file mode 100644 (file)
index 0000000..0f7f4d4
--- /dev/null
@@ -0,0 +1,18 @@
+//ELAM global definitions header
+//
+// (c) Konrad Rosenbaum, 2012
+// protected under the GNU LGPL v3 or at your option any newer
+
+#ifndef ELAM_GLOBAL_H
+#define ELAM_GLOBAL_H
+
+//export for DLL
+#include <QtCore/QtGlobal>
+
+#if defined(ELAM_LIBRARY_BUILD)
+#  define ELAM_EXPORT Q_DECL_EXPORT
+#else
+#  define ELAM_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif
similarity index 92%
rename from src/elamintengine.h
rename to include/elamintengine.h
index 71ae4ec..5f7acc4 100644 (file)
@@ -11,7 +11,7 @@
 namespace ELAM {
 
 ///integer math enabled engine
-class IntEngine:public Engine
+class ELAM_EXPORT IntEngine:public Engine
 {
        public:
                ///instantiates a pre-configured engine
similarity index 92%
rename from src/elamstringengine.h
rename to include/elamstringengine.h
index de35cd9..931cf39 100644 (file)
@@ -11,7 +11,7 @@
 namespace ELAM {
 
 ///integer math enabled engine
-class StringEngine:public Engine
+class ELAM_EXPORT StringEngine:public Engine
 {
        public:
                ///instantiates a pre-configured engine
similarity index 99%
rename from src/elamunary.h
rename to include/elamunary.h
index f79af2c..79561d7 100644 (file)
@@ -35,7 +35,7 @@ typedef QVariant(*UnaryOperatorCall_FP)(const QVariant&op,Engine&engine);
 
 You can use the methods of this class to change the routines that handle the operator and the types on which it operates. Instances of this class are implicitly shared - meaning calls on a copy of an instance are also visible on the original and all other copies.
 */
-class UnaryOperator
+class ELAM_EXPORT UnaryOperator
 {
        DECLARE_SHARED_DPTR(d);
        public:
similarity index 95%
rename from src/elamvalue.h
rename to include/elamvalue.h
index 4a8ccfc..7ebcc94 100644 (file)
@@ -11,6 +11,8 @@
 #include <QPair>
 #include <QPoint>
 
+#include "elamglobal.h"
+
 namespace ELAM {
 
 /** \brief A character position inside a text/string that is being evaluated.
@@ -18,7 +20,7 @@ namespace ELAM {
 A position consists of line and column. The top left position in a text is assumed to be line 1 column 1. Any position with line and/or column less than zero is considered invalid.
 
 This class is completely inline and as such should be quite fast.*/
-class Position
+class ELAM_EXPORT Position
 {
        public:
                ///converts a pair of ints to a position
@@ -55,10 +57,10 @@ class Position
        private:
                int mline,mcol;
 };
-QDebug&operator<<(QDebug,const Position&);
+ELAM_EXPORT QDebug&operator<<(QDebug,const Position&);
 
 /**Objects of this class represent an exception in the evaluation of an ELAM expression.*/
-class Exception
+class ELAM_EXPORT Exception
 {
        public:
                ///Type of Exception
@@ -129,10 +131,10 @@ class Exception
                Position mpos;
 };
 
-QDebug&operator<<(QDebug,const Exception&);
+ELAM_EXPORT QDebug&operator<<(QDebug,const Exception&);
 
 /**this type is not actually used, its ID is used as a fallback to tell operators, functions and engines that any supported type can be used*/
-class AnyType
+class ELAM_EXPORT AnyType
 {
        public:
                ///returns the meta type ID of the ANY type
index 982c04b..adf6142 100644 (file)
@@ -1,12 +1,13 @@
 TEMPLATE = lib
 TARGET = elam
 DESTDIR = ..
-CONFIG += staticlib create_prl
+CONFIG += dll create_prl
 QT -= gui
 OBJECTS_DIR = .ctmp
 MOC_DIR = .ctmp
 RCC_DIR = .ctmp
-
+DEFINES += ELAM_LIBRARY_BUILD
+VERSION = 0.3.0
 
 HEADERS += \
        elam.h \
@@ -33,7 +34,7 @@ SOURCES += \
        elamboolengine.cpp \
        elamstringengine.cpp
 
-INCLUDEPATH += .
-DEPENDPATH += .
+INCLUDEPATH += . ../include
+DEPENDPATH += . ../include ../dptr
 
 QMAKE_CXXFLAGS+=-std=gnu++0x
\ No newline at end of file
index 569248e..9b5a7d4 100644 (file)
@@ -10,6 +10,8 @@
 #include "../dptr/dptr.h"
 
 namespace ELAM {
+
+ELAM_EXPORT QString versionInfo(){return "0.3 alpha";}
 ///////////////////////////////////////////////////////////////////////////////
 // Engine