Commit 5c95f509 authored by Julien Wintz's avatar Julien Wintz
Browse files

Simplified plugininization framework a lot.

parent e7ab6d04
......@@ -3,9 +3,9 @@
## Author: Julien Wintz
## Created: Fri Mar 22 09:22:26 2013 (+0100)
## Version:
## Last-Updated: Fri Mar 22 12:26:17 2013 (+0100)
## Last-Updated: Mon Mar 25 09:34:06 2013 (+0100)
## By: Julien Wintz
## Update #: 17
## Update #: 24
######################################################################
##
### Change Log:
......@@ -19,12 +19,16 @@ project(dtk3D)
## #################################################################
set(${PROJECT_NAME}_HEADERS
dtk3D.h
dtk3DItem.h
dtk3DItemMesh.h
dtk3DScene.h
dtk3DView.h)
set(${PROJECT_NAME}_SOURCES
dtk3D.cpp
dtk3DItem.cpp
dtk3DItemMesh.cpp
dtk3DScene.cpp
dtk3DView.cpp)
......@@ -61,9 +65,3 @@ install(TARGETS ${PROJECT_NAME}
DESTINATION lib
COMPONENT 3D
EXPORT dtkDepends)
## ###################################################################
## Target export
## ###################################################################
list(APPEND DTK_TARGETS ${PROJECT_NAME})
#include "dtk3D.h"
#include "dtk3DItem.h"
#include "dtk3DItemMesh.h"
#include "dtk3DScene.h"
#include "dtk3DView.h"
/* dtk3D.cpp ---
*
* Author: Julien Wintz
* Created: Mon Mar 25 09:23:28 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 09:39:30 2013 (+0100)
* By: Julien Wintz
* Update #: 17
*/
/* Change Log:
*
*/
#include "dtk3D.h"
#include "dtk3DItemMesh.h"
namespace dtk3D
{
namespace _private {
dtk3DItemMeshPluginFactory factory;
dtk3DItemMeshPluginManager manager;
}
dtk3DItemMeshPluginFactory& pluginFactory(void) {
return _private::factory;
}
dtk3DItemMeshPluginManager& pluginManager(void) {
return _private::manager;
}
}
/* dtk3D.h ---
*
* Author: Julien Wintz
* Created: Mon Mar 25 09:21:47 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 09:33:31 2013 (+0100)
* By: Julien Wintz
* Update #: 8
*/
/* Change Log:
*
*/
#pragma once
class dtk3DItemMeshPlugin;
class dtk3DItemMeshPluginFactory;
class dtk3DItemMeshPluginManager;
namespace dtk3D
{
namespace mesh {
dtk3DItemMeshPluginFactory& pluginFactory(void);
dtk3DItemMeshPluginManager& pluginManager(void);
}
}
/* dtk3DItemMesh.cpp ---
*
* Author: Julien Wintz
* Created: Sun Mar 24 16:42:30 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 09:35:47 2013 (+0100)
* By: Julien Wintz
* Update #: 9
*/
/* Change Log:
*
*/
#include "dtk3DItemMesh.h"
class dtk3DItemMeshPrivate
{
public:
};
dtk3DItemMesh::dtk3DItemMesh(QObject *parent) : dtk3DItem(parent), d(new dtk3DItemMeshPrivate)
{
}
dtk3DItemMesh::~dtk3DItemMesh(void)
{
delete d;
d = NULL;
}
/* dtk3DItemMesh.h ---
*
* Author: Julien Wintz
* Created: Sun Mar 24 16:41:03 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 10:06:50 2013 (+0100)
* By: Julien Wintz
* Update #: 13
*/
/* Change Log:
*
*/
#pragma once
#include "dtk3DItem.h"
#include <dtkCore>
class dtk3DItemMeshPrivate;
class dtk3DItemMesh : public dtk3DItem
{
Q_OBJECT
public:
dtk3DItemMesh(QObject *parent = 0);
~dtk3DItemMesh(void);
private:
dtk3DItemMeshPrivate *d;
};
DTK_DECLARE_OBJECT(dtk3DItemMesh*)
DTK_DECLARE_PLUGIN(dtk3DItemMesh)
DTK_DECLARE_PLUGIN_FACTORY(dtk3DItemMesh)
DTK_DECLARE_PLUGIN_MANAGER(dtk3DItemMesh)
......@@ -3,9 +3,9 @@
* Author: Julien Wintz
* Created: Thu Feb 28 16:15:02 2013 (+0100)
* Version:
* Last-Updated: Thu Feb 28 18:55:08 2013 (+0100)
* Last-Updated: Mon Mar 25 10:21:13 2013 (+0100)
* By: Julien Wintz
* Update #: 88
* Update #: 113
*/
/* Change Log:
......@@ -28,6 +28,15 @@
// DTK_DECLARE_PLUGIN
// ///////////////////////////////////////////////////////////////////
#define DTK_DECLARE_PLUGIN_INTERFACE_NAME_STRINGIFIED(type) \
#type
#define DTK_DECLARE_PLUGIN_INTERFACE_NAME(type) \
fr.inria.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 \
{ \
......@@ -41,6 +50,8 @@
virtual void initialize(void) = 0; \
virtual void uninitialize(void) = 0; \
}; \
\
Q_DECLARE_INTERFACE(type##Plugin, DTK_DECLARE_PLUGIN_INTERFACE(type))
// ///////////////////////////////////////////////////////////////////
// DTK_DECLARE_PLUGIN_FACTORY
......
/* dtkDistributed.cpp ---
*
*
* Author: Julien Wintz
* Created: Mon Feb 11 15:00:12 2013 (+0100)
* Created: Mon Mar 25 09:23:52 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 09:23:58 2013 (+0100)
* By: Julien Wintz
* Update #: 2
*/
/* Change Log:
*
*
*/
#include "dtkDistributed.h"
#include "dtkDistributedCommunicator.h"
// #include "dtkDistributedCommunicatorPlugin.h"
// #include "dtkDistributedCommunicatorPluginFactory.h"
// #include "dtkDistributedCommunicatorPluginManager.h"
namespace dtkDistributed
{
namespace _private {
......
/* dtkDistributed.h ---
*
*
* Author: Julien Wintz
* Created: Mon Feb 11 13:45:24 2013 (+0100)
* Created: Mon Mar 25 09:21:53 2013 (+0100)
* Version:
* Last-Updated: Mon Mar 25 09:29:55 2013 (+0100)
* By: Julien Wintz
* Update #: 8
*/
/* Change Log:
*
*
*/
#pragma once
......@@ -14,6 +18,10 @@ class dtkDistributedCommunicatorPlugin;
class dtkDistributedCommunicatorPluginFactory;
class dtkDistributedCommunicatorPluginManager;
// ///////////////////////////////////////////////////////////////////
// Distribution macros
// ///////////////////////////////////////////////////////////////////
#define DTK_DISTRIBUTED_BEGIN_GLOBAL \
barrier(); dtkDistributed::setMode(dtkDistributed::Global); dtkDistributedWork::worker()->setMode(dtkDistributed::mode()); if (dtkDistributedWork::worker()->master()) { time.restart();
......@@ -26,16 +34,33 @@ class dtkDistributedCommunicatorPluginManager;
#define DTK_DISTRIBUTED_END_LOCAL \
qDebug() << "local section:" << time.elapsed() << "ms";
// ///////////////////////////////////////////////////////////////////
// Distribution layer attributes
// ///////////////////////////////////////////////////////////////////
namespace dtkDistributed
{
#pragma mark -
#pragma mark Distribution namespace flags
enum Mode {
Global,
Local
};
#pragma mark -
#pragma mark Setting distribution mode
void setMode(dtkDistributed::Mode);
#pragma mark -
#pragma mark Querying distribution mode
dtkDistributed::Mode mode(void);
#pragma mark -
#pragma mark Modular concepts
namespace communicator {
dtkDistributedCommunicatorPluginFactory& pluginFactory(void);
dtkDistributedCommunicatorPluginManager& pluginManager(void);
......
......@@ -71,5 +71,3 @@ DTK_DECLARE_OBJECT(dtkDistributedCommunicator*)
DTK_DECLARE_PLUGIN(dtkDistributedCommunicator)
DTK_DECLARE_PLUGIN_FACTORY(dtkDistributedCommunicator)
DTK_DECLARE_PLUGIN_MANAGER(dtkDistributedCommunicator)
Q_DECLARE_INTERFACE(dtkDistributedCommunicatorPlugin, "fr.inria.dtkDistributedCommunicatorPlugin")
Markdown is supported
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