Commit 62786405 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

remove FactoryManager; use composerExtensions sub-classes instead for nodes recording

parent 753d46ef
......@@ -76,7 +76,7 @@ int main(int argc, char **argv)
// main_settings->endGroup();
// dtkPluginManager::instance()->initialize();
dtkComposerNodeFactory *factory = dtkComposer::node::factory();
dtkComposerNodeFactory *factory = &(dtkComposer::node::factory());
// if (args[1] == "--spawn") {
......
......@@ -40,12 +40,12 @@ set(${PROJECT_NAME}_HEADERS
# dtkComposerControlsListItemLeafProcess.h
dtkComposerControlsListItemReal.h
dtkComposerControlsListItemString.h
dtkComposerDefaultExtensions.h
dtkComposerEvaluator.h
dtkComposerEvaluator_p.h
dtkComposerEvaluatorProcess.h
dtkComposerEvaluatorSlave.h
dtkComposerExtension.h
dtkComposerFactoryManager.h
dtkComposerGraph.h
dtkComposerGraphEdge.h
dtkComposerGraphNode.h
......@@ -169,7 +169,6 @@ set(${PROJECT_NAME}_SOURCES
dtkComposerEvaluator.cpp
dtkComposerEvaluatorProcess.cpp
dtkComposerEvaluatorSlave.cpp
dtkComposerFactoryManager.cpp
dtkComposerGraph.cpp
dtkComposerGraphEdge.cpp
dtkComposerGraphNodeBegin.cpp
......
......@@ -20,7 +20,6 @@
#include "dtkComposerNode.h"
#include "dtkComposerNodeObject.h"
#include "dtkComposerNodeFactory.h"
#include "dtkComposerFactoryManager.h"
#include "dtkComposerNodeFactoryView.h"
#include "dtkComposerNodeBoolean.h"
#include "dtkComposerNodeBooleanOperator.h"
......
......@@ -13,30 +13,39 @@
#include <dtkConfig.h>
#include "dtkComposerNodeFactory.h"
#include "dtkComposerFactoryManager.h"
#include "dtkComposerExtension.h"
#include "dtkComposerSettings.h"
#include "dtkComposerDefaultExtensions.h"
namespace dtkComposer
{
namespace node
{
namespace _private {
dtkComposerFactoryManager manager;
dtkComposerNodeFactory factory;
}
dtkComposerNodeFactory *factory(void) {
return _private::manager.factory();
dtkComposerNodeFactory& factory(void) {
return _private::factory;
}
void initialize(void) {
_private::manager.initNodeBase();
_private::manager.initNodeBoolean();
_private::manager.initNodeControl();
_private::manager.initNodeConstants();
_private::manager.initNodeDistributed();
_private::manager.initNodeFile();
_private::manager.initNodeNumber();
_private::manager.initNodeString();
_private::manager.initNodeContainer();
dtkComposerBaseExtension baseExt;
baseExt.extend(&(_private::factory));
dtkComposerBooleanExtension boolExt;
boolExt.extend(&(_private::factory));
dtkComposerControlExtension controlExt;
controlExt.extend(&(_private::factory));
dtkComposerConstantsExtension constantsExt;
constantsExt.extend(&(_private::factory));
dtkComposerDistributedExtension distributedExt;
distributedExt.extend(&(_private::factory));
dtkComposerFileExtension fileExt;
fileExt.extend(&(_private::factory));
dtkComposerNumberExtension numberExt;
numberExt.extend(&(_private::factory));
dtkComposerStringExtension stringExt;
stringExt.extend(&(_private::factory));
dtkComposerContainerExtension containerExt;
containerExt.extend(&(_private::factory));
}
}
......
......@@ -25,7 +25,7 @@ class dtkComposerExtensionPluginFactory;
namespace dtkComposer
{
namespace node {
DTKCOMPOSER_EXPORT dtkComposerNodeFactory *factory(void);
DTKCOMPOSER_EXPORT dtkComposerNodeFactory& factory(void);
DTKCOMPOSER_EXPORT void initialize(void);
}
namespace extension {
......
/* @(#)dtkComposerDefaultExtensions.h ---
*
* Author: Nicolas Niclausse
* Copyright (C) 2016 - Nicolas Niclausse, Inria.
* Created: 2016/05/04 12:47:16
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#pragma once
#include "dtkComposerExport.h"
#include "dtkComposerExtension.h"
#include "dtkComposerNodeFactory.h"
#include "dtkComposerNodeBoolean.h"
#include "dtkComposerNodeBooleanOperator.h"
#include "dtkComposerNodeComposite.h"
#include "dtkComposerNodeConstants.h"
#include "dtkComposerNodeControlCase.h"
#include "dtkComposerNodeControlDoWhile.h"
#include "dtkComposerNodeControlFor.h"
#include "dtkComposerNodeControlForEach.h"
#include "dtkComposerNodeControlIf.h"
#include "dtkComposerNodeControlMap.h"
#include "dtkComposerNodeControlWhile.h"
#include "dtkComposerNodeDistributed.h"
#include "dtkComposerNodeExec.h"
#include "dtkComposerNodeFile.h"
#include "dtkComposerNodeInteger.h"
#include "dtkComposerNodeRange.h"
#include "dtkComposerNodeMetaContainer.h"
#include "dtkComposerNodeNumberOperator.h"
#include "dtkComposerNodeReal.h"
#include "dtkComposerNodeRemote.h"
#include "dtkComposerNodeSpawn.h"
#include "dtkComposerNodeString.h"
#include "dtkComposerNodeStringOperator.h"
#include "dtkComposerNodeLogger.h"
#include "dtkComposerNodePrint.h"
// -- Base nodes
class DTKCOMPOSER_EXPORT dtkComposerBaseExtension : public dtkComposerExtension
{
public:
dtkComposerBaseExtension(void) {};
~dtkComposerBaseExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerBaseExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeComposite.json", dtkComposerNodeCreator<dtkComposerNodeComposite>);
factory->record(":dtkComposer/dtkComposerNodeLogger.json", dtkComposerNodeCreator<dtkComposerNodeLogger>);
factory->record(":dtkComposer/dtkComposerNodePrint.json", dtkComposerNodeCreator<dtkComposerNodePrint>);
}
// -- Files nodes
class DTKCOMPOSER_EXPORT dtkComposerFileExtension : public dtkComposerExtension
{
public:
dtkComposerFileExtension(void) {};
~dtkComposerFileExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerFileExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeFile.json", dtkComposerNodeCreator<dtkComposerNodeFile>);
factory->record(":dtkComposer/dtkComposerNodeFileExists.json", dtkComposerNodeCreator<dtkComposerNodeFileExists>);
factory->record(":dtkComposer/dtkComposerNodeFileList.json", dtkComposerNodeCreator<dtkComposerNodeFileList>);
factory->record(":dtkComposer/dtkComposerNodeFileRead.json", dtkComposerNodeCreator<dtkComposerNodeFileRead>);
factory->record(":dtkComposer/dtkComposerNodeFileWrite.json", dtkComposerNodeCreator<dtkComposerNodeFileWrite>);
factory->record(":dtkComposer/dtkComposerNodeDirectory.json", dtkComposerNodeCreator<dtkComposerNodeDirectory>);
factory->record(":dtkComposer/dtkComposerNodeExec.json", dtkComposerNodeCreator<dtkComposerNodeExec>);
}
// -- Distributed nodes
class DTKCOMPOSER_EXPORT dtkComposerDistributedExtension : public dtkComposerExtension
{
public:
dtkComposerDistributedExtension(void) {};
~dtkComposerDistributedExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerDistributedExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeRemote.json", dtkComposerNodeCreator<dtkComposerNodeRemote>);
factory->record(":dtkComposer/dtkComposerNodeRemoteSubmit.json", dtkComposerNodeCreator<dtkComposerNodeRemoteSubmit>);
factory->record(":dtkComposer/dtkComposerNodeSpawn.json", dtkComposerNodeCreator<dtkComposerNodeSpawn>);
factory->record(":dtkComposer/dtkComposerNodeCommunicatorRank.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorRank>);
factory->record(":dtkComposer/dtkComposerNodeCommunicatorSize.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorSize>);
factory->record(":dtkComposer/dtkComposerNodeCommunicatorSend.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorSend>);
factory->record(":dtkComposer/dtkComposerNodeCommunicatorReceive.json",dtkComposerNodeCreator<dtkComposerNodeCommunicatorReceive>);
factory->record(":dtkComposer/dtkComposerNodeAnySource.json", dtkComposerNodeCreator<dtkComposerNodeAnySource>);
factory->record(":dtkComposer/dtkComposerNodeAnyTag.json", dtkComposerNodeCreator<dtkComposerNodeAnyTag>);
factory->record(":dtkComposer/dtkComposerNodeControllerRank.json", dtkComposerNodeCreator<dtkComposerNodeControllerRank>);
}
// -- Constants nodes
class DTKCOMPOSER_EXPORT dtkComposerConstantsExtension : public dtkComposerExtension
{
public:
dtkComposerConstantsExtension(void) {};
~dtkComposerConstantsExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerConstantsExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodePi.json", dtkComposerNodeCreator<dtkComposerNodePi>);
factory->record(":dtkComposer/dtkComposerNodeE.json", dtkComposerNodeCreator<dtkComposerNodeE>);
}
// -- Control nodes
class DTKCOMPOSER_EXPORT dtkComposerControlExtension : public dtkComposerExtension
{
public:
dtkComposerControlExtension(void) {};
~dtkComposerControlExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerControlExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodePi.json", dtkComposerNodeCreator<dtkComposerNodePi>);
factory->record(":dtkComposer/dtkComposerNodeE.json", dtkComposerNodeCreator<dtkComposerNodeE>);
}
// -- Boolean nodes
class DTKCOMPOSER_EXPORT dtkComposerBooleanExtension : public dtkComposerExtension
{
public:
dtkComposerBooleanExtension(void) {};
~dtkComposerBooleanExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerBooleanExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeBoolean.json", dtkComposerNodeCreator<dtkComposerNodeBoolean>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorUnaryNot.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorUnaryNot>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryAnd.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryAnd>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryOr.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryOr>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryXor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryXor>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNand.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNand>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNor>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryXnor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryXnor>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryImp.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryImp>);
factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNimp.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNimp>);
}
// -- Number nodes
class DTKCOMPOSER_EXPORT dtkComposerNumberExtension : public dtkComposerExtension
{
public:
dtkComposerNumberExtension(void) {};
~dtkComposerNumberExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerNumberExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeInteger.json", dtkComposerNodeCreator<dtkComposerNodeInteger>);
factory->record(":dtkComposer/dtkComposerNodeReal.json", dtkComposerNodeCreator<dtkComposerNodeReal>);
factory->record(":dtkComposer/dtkComposerNodeRange.json", dtkComposerNodeCreator<dtkComposerNodeRange>);
// -- Unary operators
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAbs.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAbs>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySqrt.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySqrt>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySquare.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySquare>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryInv.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryInv>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryIncr.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryIncr>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryDecr.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryDecr>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryFloor.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryFloor>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryCeil.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryCeil>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryRound.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryRound>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryCos.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryCos>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySin>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryTan.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryTan>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAcos.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAcos>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAsin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAsin>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAtan.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAtan>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryDeg2Rad.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryDeg2Rad>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryRad2Deg.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryRad2Deg>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryLn.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryLn>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryLog10.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryLog10>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryExp.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryExp>);
// -- Binary operators
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryEucldiv.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryEucldiv>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryModulo.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryModulo>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMin>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMax.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMax>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryPlus.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryPlus>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMinus.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMinus>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMult.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMult>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryRatio.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryRatio>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryPower.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryPower>);
factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryNthroot.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryNthroot>);
// -- Comparator operator
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorEqual.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorEqual>);
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorNotequal.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorNotequal>);
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorGt.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorGt>);
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorLt.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorLt>);
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorGte.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorGte>);
factory->record(":dtkComposer/dtkComposerNodeNumberComparatorLte.json", dtkComposerNodeCreator<dtkComposerNodeNumberComparatorLte>);
factory->record(":dtkComposer/dtkComposerNodeNumberAlmosteq.json", dtkComposerNodeCreator<dtkComposerNodeNumberAlmosteq>);
factory->record(":dtkComposer/dtkComposerNodeNumberNotalmosteq.json", dtkComposerNodeCreator<dtkComposerNodeNumberNotalmosteq>);
}
// -- String nodes
class DTKCOMPOSER_EXPORT dtkComposerStringExtension : public dtkComposerExtension
{
public:
dtkComposerStringExtension(void) {};
~dtkComposerStringExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerStringExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeString.json", dtkComposerNodeCreator<dtkComposerNodeString>);
factory->record(":dtkComposer/dtkComposerNodeStringReplace.json", dtkComposerNodeCreator<dtkComposerNodeStringReplace>);
factory->record(":dtkComposer/dtkComposerNodeStringOperatorBinaryAppend.json", dtkComposerNodeCreator<dtkComposerNodeStringOperatorBinaryAppend>);
factory->record(":dtkComposer/dtkComposerNodeStringOperatorBinaryLogicEquality.json", dtkComposerNodeCreator<dtkComposerNodeStringOperatorBinaryLogicEquality>);
}
// -- Containers nodes
class DTKCOMPOSER_EXPORT dtkComposerContainerExtension : public dtkComposerExtension
{
public:
dtkComposerContainerExtension(void) {};
~dtkComposerContainerExtension(void) {};
public:
void extend(dtkComposerNodeFactory *factory);
};
void dtkComposerContainerExtension::extend(dtkComposerNodeFactory *factory)
{
factory->record(":dtkComposer/dtkComposerNodeMetaContainer.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainer>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerAppend.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerAppend>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerAt.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerAt>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerInsert.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerInsert>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerPrepend.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerPrepend>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerRemoveAt.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerRemoveAt>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerResize.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerResize>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerSetAt.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerSetAt>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerSize.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerSize>);
factory->record(":dtkComposer/dtkComposerNodeMetaContainerTakeAt.json", dtkComposerNodeCreator<dtkComposerNodeMetaContainerTakeAt>);
}
/* dtkComposerMangager.cpp ---
*
* Author: Nicolas Niclausse
* Copyright (C) 2016 - Nicolas Niclausse, Inria.
* Created: 2016/05/02 08:06:42
*/
#include "dtkComposerFactoryManager.h"
#include "dtkComposerNodeFactory.h"
#include "dtkComposerNodeBoolean.h"
#include "dtkComposerNodeBooleanOperator.h"
#include "dtkComposerNodeComposite.h"
#include "dtkComposerNodeConstants.h"
#include "dtkComposerNodeControlCase.h"
#include "dtkComposerNodeControlDoWhile.h"
#include "dtkComposerNodeControlFor.h"
#include "dtkComposerNodeControlForEach.h"
#include "dtkComposerNodeControlIf.h"
#include "dtkComposerNodeControlMap.h"
#include "dtkComposerNodeControlWhile.h"
#include "dtkComposerNodeDistributed.h"
#include "dtkComposerNodeExec.h"
#include "dtkComposerNodeFile.h"
#include "dtkComposerNodeInteger.h"
#include "dtkComposerNodeRange.h"
#include "dtkComposerNodeMetaContainer.h"
#include "dtkComposerNodeNumberOperator.h"
#include "dtkComposerNodeReal.h"
#include "dtkComposerNodeRemote.h"
#include "dtkComposerNodeSpawn.h"
#include "dtkComposerNodeString.h"
#include "dtkComposerNodeStringOperator.h"
#include "dtkComposerNodeLogger.h"
#include "dtkComposerNodePrint.h"
class dtkComposerFactoryManagerPrivate
{
public:
dtkComposerNodeFactory *factory;
};
dtkComposerFactoryManager::dtkComposerFactoryManager(void) : d(new dtkComposerFactoryManagerPrivate)
{
d->factory = new dtkComposerNodeFactory;
}
dtkComposerFactoryManager::~dtkComposerFactoryManager(void)
{
delete d;
}
dtkComposerNodeFactory *dtkComposerFactoryManager::factory(void)
{
return d->factory;
}
void dtkComposerFactoryManager::initNodeFile(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeFile.json", dtkComposerNodeCreator<dtkComposerNodeFile>);
d->factory->record(":dtkComposer/dtkComposerNodeFileExists.json", dtkComposerNodeCreator<dtkComposerNodeFileExists>);
d->factory->record(":dtkComposer/dtkComposerNodeFileList.json", dtkComposerNodeCreator<dtkComposerNodeFileList>);
d->factory->record(":dtkComposer/dtkComposerNodeFileRead.json", dtkComposerNodeCreator<dtkComposerNodeFileRead>);
d->factory->record(":dtkComposer/dtkComposerNodeFileWrite.json", dtkComposerNodeCreator<dtkComposerNodeFileWrite>);
d->factory->record(":dtkComposer/dtkComposerNodeDirectory.json", dtkComposerNodeCreator<dtkComposerNodeDirectory>);
d->factory->record(":dtkComposer/dtkComposerNodeExec.json", dtkComposerNodeCreator<dtkComposerNodeExec>);
}
void dtkComposerFactoryManager::initNodeBase(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeComposite.json", dtkComposerNodeCreator<dtkComposerNodeComposite>);
d->factory->record(":dtkComposer/dtkComposerNodeLogger.json", dtkComposerNodeCreator<dtkComposerNodeLogger>);
d->factory->record(":dtkComposer/dtkComposerNodePrint.json", dtkComposerNodeCreator<dtkComposerNodePrint>);
}
void dtkComposerFactoryManager::initNodeDistributed(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeRemote.json", dtkComposerNodeCreator<dtkComposerNodeRemote>);
d->factory->record(":dtkComposer/dtkComposerNodeRemoteSubmit.json", dtkComposerNodeCreator<dtkComposerNodeRemoteSubmit>);
d->factory->record(":dtkComposer/dtkComposerNodeSpawn.json", dtkComposerNodeCreator<dtkComposerNodeSpawn>);
d->factory->record(":dtkComposer/dtkComposerNodeCommunicatorRank.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorRank>);
d->factory->record(":dtkComposer/dtkComposerNodeCommunicatorSize.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorSize>);
d->factory->record(":dtkComposer/dtkComposerNodeCommunicatorSend.json", dtkComposerNodeCreator<dtkComposerNodeCommunicatorSend>);
d->factory->record(":dtkComposer/dtkComposerNodeCommunicatorReceive.json",dtkComposerNodeCreator<dtkComposerNodeCommunicatorReceive>);
d->factory->record(":dtkComposer/dtkComposerNodeAnySource.json", dtkComposerNodeCreator<dtkComposerNodeAnySource>);
d->factory->record(":dtkComposer/dtkComposerNodeAnyTag.json", dtkComposerNodeCreator<dtkComposerNodeAnyTag>);
d->factory->record(":dtkComposer/dtkComposerNodeControllerRank.json", dtkComposerNodeCreator<dtkComposerNodeControllerRank>);
}
void dtkComposerFactoryManager::initNodeConstants(void)
{
d->factory->record(":dtkComposer/dtkComposerNodePi.json", dtkComposerNodeCreator<dtkComposerNodePi>);
d->factory->record(":dtkComposer/dtkComposerNodeE.json", dtkComposerNodeCreator<dtkComposerNodeE>);
}
void dtkComposerFactoryManager::initNodeBoolean(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeBoolean.json", dtkComposerNodeCreator<dtkComposerNodeBoolean>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorUnaryNot.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorUnaryNot>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryAnd.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryAnd>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryOr.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryOr>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryXor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryXor>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNand.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNand>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNor>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryXnor.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryXnor>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryImp.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryImp>);
d->factory->record(":dtkComposer/dtkComposerNodeBooleanOperatorBinaryNimp.json", dtkComposerNodeCreator<dtkComposerNodeBooleanOperatorBinaryNimp>);
}
void dtkComposerFactoryManager::initNodeControl(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeControlCase.json", dtkComposerNodeCreator<dtkComposerNodeControlCase>);
d->factory->record(":dtkComposer/dtkComposerNodeControlIf.json", dtkComposerNodeCreator<dtkComposerNodeControlIf>);
d->factory->record(":dtkComposer/dtkComposerNodeControlDoWhile.json", dtkComposerNodeCreator<dtkComposerNodeControlDoWhile>);
d->factory->record(":dtkComposer/dtkComposerNodeControlFor.json", dtkComposerNodeCreator<dtkComposerNodeControlFor>);
d->factory->record(":dtkComposer/dtkComposerNodeControlForEach.json", dtkComposerNodeCreator<dtkComposerNodeControlForEach>);
d->factory->record(":dtkComposer/dtkComposerNodeControlMap.json", dtkComposerNodeCreator<dtkComposerNodeControlMap>);
d->factory->record(":dtkComposer/dtkComposerNodeControlWhile.json", dtkComposerNodeCreator<dtkComposerNodeControlWhile>);
}
void dtkComposerFactoryManager::initNodeNumber(void)
{
d->factory->record(":dtkComposer/dtkComposerNodeInteger.json", dtkComposerNodeCreator<dtkComposerNodeInteger>);
d->factory->record(":dtkComposer/dtkComposerNodeReal.json", dtkComposerNodeCreator<dtkComposerNodeReal>);
d->factory->record(":dtkComposer/dtkComposerNodeRange.json", dtkComposerNodeCreator<dtkComposerNodeRange>);
// -- Unary operators
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAbs.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAbs>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySqrt.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySqrt>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySquare.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySquare>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryInv.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryInv>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryIncr.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryIncr>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryDecr.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryDecr>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryFloor.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryFloor>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryCeil.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryCeil>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryRound.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryRound>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryCos.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryCos>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnarySin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnarySin>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryTan.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryTan>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAcos.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAcos>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAsin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAsin>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryAtan.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryAtan>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryDeg2Rad.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryDeg2Rad>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryRad2Deg.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryRad2Deg>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryLn.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryLn>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryLog10.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryLog10>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorUnaryExp.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorUnaryExp>);
// -- Binary operators
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryEucldiv.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryEucldiv>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryModulo.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryModulo>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMin.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMin>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMax.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMax>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryPlus.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryPlus>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMinus.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMinus>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryMult.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryMult>);
d->factory->record(":dtkComposer/dtkComposerNodeNumberOperatorBinaryRatio.json", dtkComposerNodeCreator<dtkComposerNodeNumberOperatorBinaryRatio>);