diff --git a/filters/StreamCallbackFilter.cpp b/filters/StreamCallbackFilter.cpp index 9e2e208500..eb161ba7e4 100644 --- a/filters/StreamCallbackFilter.cpp +++ b/filters/StreamCallbackFilter.cpp @@ -37,11 +37,13 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo( +static StaticPluginInfo const s_info +{ "filters.streamcallback", "Provide a hook for a simple point-by-point callback.", - "" ); + "" +}; -CREATE_STATIC_PLUGIN(1, 0, StreamCallbackFilter, Filter, s_info) +CREATE_STATIC_STAGE(StreamCallbackFilter, s_info) } // namespace pdal diff --git a/kernels/DeltaKernel.cpp b/kernels/DeltaKernel.cpp index 8a33e93e1a..ddcd45d63a 100644 --- a/kernels/DeltaKernel.cpp +++ b/kernels/DeltaKernel.cpp @@ -39,10 +39,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.delta", "Delta Kernel", - "http://www.pdal.io/apps/delta.html"); +static StaticPluginInfo const s_info +{ + "kernels.delta", + "Delta Kernel", + "http://www.pdal.io/apps/delta.html" +}; -CREATE_STATIC_PLUGIN(1, 0, DeltaKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(DeltaKernel, s_info) std::string DeltaKernel::getName() const { return s_info.name; } diff --git a/kernels/DiffKernel.cpp b/kernels/DiffKernel.cpp index 32ea7b40c4..a8cf16c9f6 100644 --- a/kernels/DiffKernel.cpp +++ b/kernels/DiffKernel.cpp @@ -43,10 +43,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.diff", "Diff Kernel", - "http://www.pdal.io/apps/diff.html" ); +static StaticPluginInfo const s_info +{ + "kernels.diff", + "Diff Kernel", + "http://www.pdal.io/apps/diff.html" +}; -CREATE_STATIC_PLUGIN(1, 0, DiffKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(DiffKernel, s_info) std::string DiffKernel::getName() const { return s_info.name; } diff --git a/kernels/GroundKernel.cpp b/kernels/GroundKernel.cpp index d4313022e1..6534099194 100644 --- a/kernels/GroundKernel.cpp +++ b/kernels/GroundKernel.cpp @@ -48,10 +48,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.ground", "Ground Kernel", - "http://pdal.io/apps/ground.html"); +static StaticPluginInfo const s_info +{ + "kernels.ground", + "Ground Kernel", + "http://pdal.io/apps/ground.html" +}; -CREATE_STATIC_PLUGIN(1, 0, GroundKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(GroundKernel, s_info) std::string GroundKernel::getName() const { diff --git a/kernels/HausdorffKernel.cpp b/kernels/HausdorffKernel.cpp index abfe7c0297..ccea59ccf9 100644 --- a/kernels/HausdorffKernel.cpp +++ b/kernels/HausdorffKernel.cpp @@ -43,10 +43,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.hausdorff", - "Hausdorff Kernel", "http://pdal.io/apps/hausdorff.html"); +static StaticPluginInfo const s_info +{ + "kernels.hausdorff", + "Hausdorff Kernel", + "http://pdal.io/apps/hausdorff.html" +}; -CREATE_STATIC_PLUGIN(1, 0, HausdorffKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(HausdorffKernel, s_info) std::string HausdorffKernel::getName() const { diff --git a/kernels/InfoKernel.cpp b/kernels/InfoKernel.cpp index 69cf4985c7..7777e03366 100644 --- a/kernels/InfoKernel.cpp +++ b/kernels/InfoKernel.cpp @@ -48,10 +48,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.info", "Info Kernel", - "http://pdal.io/apps/info.html" ); +static StaticPluginInfo const s_info +{ + "kernels.info", + "Info Kernel", + "http://pdal.io/apps/info.html" +}; -CREATE_STATIC_PLUGIN(1, 0, InfoKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(InfoKernel, s_info) std::string InfoKernel::getName() const { return s_info.name; } diff --git a/kernels/MergeKernel.cpp b/kernels/MergeKernel.cpp index 7cf975dfe4..ad72e034b2 100644 --- a/kernels/MergeKernel.cpp +++ b/kernels/MergeKernel.cpp @@ -40,10 +40,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.merge", "Merge Kernel", - "http://pdal.io/apps/merge.html" ); +static StaticPluginInfo const s_info +{ + "kernels.merge", + "Merge Kernel", + "http://pdal.io/apps/merge.html" +}; -CREATE_STATIC_PLUGIN(1, 0, MergeKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(MergeKernel, s_info) std::string MergeKernel::getName() const { diff --git a/kernels/PipelineKernel.cpp b/kernels/PipelineKernel.cpp index 211c36ba04..7d0ff31506 100644 --- a/kernels/PipelineKernel.cpp +++ b/kernels/PipelineKernel.cpp @@ -44,10 +44,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.pipeline", - "Pipeline Kernel", "http://pdal.io/apps/pipeline.html" ); +static StaticPluginInfo const s_info +{ + "kernels.pipeline", + "Pipeline Kernel", + "http://pdal.io/apps/pipeline.html" +}; -CREATE_STATIC_PLUGIN(1, 0, PipelineKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(PipelineKernel, s_info) std::string PipelineKernel::getName() const { return s_info.name; } diff --git a/kernels/RandomKernel.cpp b/kernels/RandomKernel.cpp index 448e48bb19..514b8abe97 100644 --- a/kernels/RandomKernel.cpp +++ b/kernels/RandomKernel.cpp @@ -37,10 +37,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.random", "Random Kernel", - "http://pdal.io/apps/random.html" ); +static StaticPluginInfo const s_info +{ + "kernels.random", + "Random Kernel", + "http://pdal.io/apps/random.html" +}; -CREATE_STATIC_PLUGIN(1, 0, RandomKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(RandomKernel, s_info) std::string RandomKernel::getName() const { return s_info.name; } diff --git a/kernels/SortKernel.cpp b/kernels/SortKernel.cpp index 89f2a2df3f..a24e264be9 100644 --- a/kernels/SortKernel.cpp +++ b/kernels/SortKernel.cpp @@ -37,10 +37,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.sort", "Sort Kernel", - "http://pdal.io/apps/sort.html" ); +static StaticPluginInfo const s_info +{ + "kernels.sort", + "Sort Kernel", + "http://pdal.io/apps/sort.html" +}; -CREATE_STATIC_PLUGIN(1, 0, SortKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(SortKernel, s_info) std::string SortKernel::getName() const { diff --git a/kernels/SplitKernel.cpp b/kernels/SplitKernel.cpp index ff65d5af65..b896fcc948 100644 --- a/kernels/SplitKernel.cpp +++ b/kernels/SplitKernel.cpp @@ -40,10 +40,14 @@ namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.split", "Split Kernel", - "http://pdal.io/apps/split.html" ); +static StaticPluginInfo const s_info +{ + "kernels.split", + "Split Kernel", + "http://pdal.io/apps/split.html" +}; -CREATE_STATIC_PLUGIN(1, 0, SplitKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(SplitKernel, s_info) std::string SplitKernel::getName() const { diff --git a/kernels/TIndexKernel.cpp b/kernels/TIndexKernel.cpp index 80b88f3d93..194a8d14ff 100644 --- a/kernels/TIndexKernel.cpp +++ b/kernels/TIndexKernel.cpp @@ -62,10 +62,14 @@ void setDate(OGRFeatureH feature, const tm& tyme, int fieldNumber) namespace pdal { -static PluginInfo const s_info = PluginInfo("kernels.tindex", "TIndex Kernel", - "http://pdal.io/apps/tindex.html" ); +static StaticPluginInfo const s_info +{ + "kernels.tindex", + "TIndex Kernel", + "http://pdal.io/apps/tindex.html" +}; -CREATE_STATIC_PLUGIN(1, 0, TIndexKernel, Kernel, s_info) +CREATE_STATIC_KERNEL(TIndexKernel, s_info) std::string TIndexKernel::getName() const { return s_info.name; } diff --git a/kernels/TranslateKernel.cpp b/kernels/TranslateKernel.cpp index 446b5d77ee..cac3814e70 100644 --- a/kernels/TranslateKernel.cpp +++ b/kernels/TranslateKernel.cpp @@ -52,16 +52,18 @@ namespace pdal { -static PluginInfo const s_info = - PluginInfo("kernels.translate", - "The Translate kernel allows users to construct a pipeline " \ - "consisting of a reader, a writer, and N filter stages. " \ - "Any supported stage type can be specified from the command " \ - "line, reducing the need to create custom kernels for every " \ - "combination.", - "http://pdal.io/apps/translate.html"); - -CREATE_STATIC_PLUGIN(1, 0, TranslateKernel, Kernel, s_info) +static StaticPluginInfo const s_info +{ + "kernels.translate", + "The Translate kernel allows users to construct a pipeline " \ + "consisting of a reader, a writer, and N filter stages. " \ + "Any supported stage type can be specified from the command " \ + "line, reducing the need to create custom kernels for every " \ + "combination.", + "http://pdal.io/apps/translate.html" +}; + +CREATE_STATIC_KERNEL(TranslateKernel, s_info) std::string TranslateKernel::getName() const { diff --git a/pdal/PluginHelper.hpp b/pdal/PluginHelper.hpp index 99fa781473..33d01b5c97 100644 --- a/pdal/PluginHelper.hpp +++ b/pdal/PluginHelper.hpp @@ -92,6 +92,7 @@ typedef void (*PF_InitFunc)(); pdal::PluginManager::registerPlugin(info); \ } +/** #define CREATE_STATIC_PLUGIN(version_major, version_minor, T, type, info) \ extern "C" PDAL_DLL void T ## _InitPlugin() \ { \ @@ -101,6 +102,11 @@ typedef void (*PF_InitFunc)(); else \ pdal::PluginManager::registerPlugin(info); \ } +**/ + +#define CREATE_STATIC_KERNEL(T, info) \ + static bool T ## _b = \ + pdal::PluginManager::registerPlugin(info); #define CREATE_STATIC_STAGE(T, info) \ static bool T ## _b = \ diff --git a/pdal/StageFactory.cpp b/pdal/StageFactory.cpp index e274dc8cf0..c41c41791e 100644 --- a/pdal/StageFactory.cpp +++ b/pdal/StageFactory.cpp @@ -36,22 +36,8 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include -//#include // for funcptr namespace pdal { @@ -147,20 +133,6 @@ std::string StageFactory::inferWriterDriver(const std::string& filename) StageFactory::StageFactory(bool ignored) { (void)ignored; - - // kernels - DeltaKernel_InitPlugin(); - DiffKernel_InitPlugin(); - GroundKernel_InitPlugin(); - HausdorffKernel_InitPlugin(); - InfoKernel_InitPlugin(); - MergeKernel_InitPlugin(); - PipelineKernel_InitPlugin(); - RandomKernel_InitPlugin(); - SortKernel_InitPlugin(); - SplitKernel_InitPlugin(); - TIndexKernel_InitPlugin(); - TranslateKernel_InitPlugin(); }