From 635f036e9587544c691ee183c726d36f9bb2626c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Jan 2016 21:09:32 +0000 Subject: Partially tested global visibility hidden in all projects --- Jamroot.jam | 8 ++++---- project2/basics/options/flagSet.h | 3 ++- project2/basics/options/showHelp.h | 3 ++- project2/basics/views/flatView.cpp | 2 +- project2/basics/views/flatView.h | 5 +++-- project2/cgi/cgiAppEngine.h | 3 ++- project2/cgi/cgiContentNegotiate.cpp | 2 +- project2/cgi/cgiOutputOptions.cpp | 2 +- project2/cgi/cgiOutputOptions.h | 2 +- project2/cgi/cgiProgRouter.cpp | 4 ++-- project2/cgi/cgiStageDefaultError.cpp | 2 +- project2/cgi/cgiStagePresent.cpp | 4 ++-- project2/cli/claOptions.h | 5 +++-- project2/common/aggregate.cpp | 4 ++-- project2/common/aggregate.h | 11 ++++++----- project2/common/appInstance.h | 3 ++- project2/common/check.cpp | 2 +- project2/common/check.h | 5 +++-- project2/common/checkHost.h | 3 ++- project2/common/columns.h | 3 ++- project2/common/commonObjects.h | 3 ++- project2/common/dataSource.cpp | 2 +- project2/common/dataSource.h | 5 +++-- project2/common/definedColumns.h | 5 +++-- project2/common/exceptions.h | 9 +++++---- project2/common/execContext.h | 3 ++- project2/common/fileStrmVarWriter.h | 3 ++- project2/common/iHaveParameters.h | 3 ++- project2/common/iHaveSubTasks.h | 3 ++- project2/common/lifeCycle.h | 3 ++- project2/common/logger.h | 5 +++-- project2/common/loggerFactory.h | 5 +++-- project2/common/options.h | 3 ++- project2/common/optionsSource.h | 3 ++- project2/common/presenter.cpp | 5 +++-- project2/common/presenter.h | 13 +++++++------ project2/common/presenterCache.cpp | 2 +- project2/common/presenterCache.h | 5 +++-- project2/common/rowProcessor.h | 3 ++- project2/common/rowSet.cpp | 2 +- project2/common/rowSet.h | 7 ++++--- project2/common/rowSetCache.cpp | 2 +- project2/common/rowSetCache.h | 5 +++-- project2/common/scriptLoader.cpp | 6 +++--- project2/common/scriptLoader.h | 3 ++- project2/common/scriptStorage.h | 14 +++++++------- project2/common/scripts.h | 7 ++++--- project2/common/scripts_fwd.h | 5 +++-- project2/common/session.h | 3 ++- project2/common/sessionContainer.h | 3 ++- project2/common/sourceObject.h | 7 ++++--- project2/common/stream.cpp | 2 +- project2/common/stream.h | 5 +++-- project2/common/task.cpp | 2 +- project2/common/task.h | 5 +++-- project2/common/taskHost.h | 3 ++- project2/common/test.cpp | 4 ++-- project2/common/test.h | 5 +++-- project2/common/transform.cpp | 6 +++--- project2/common/transform.h | 13 +++++++------ project2/common/variableType.h | 13 +++++++------ project2/common/variables.cpp | 2 +- project2/common/variables.h | 9 +++++---- project2/common/variables/literal.h | 3 ++- project2/common/view.cpp | 4 ++-- project2/common/view.h | 5 +++-- project2/common/viewHost.h | 3 ++- project2/daemon/lib/daemon.h | 3 ++- project2/files/fsRows.cpp | 2 +- project2/files/fsRows.h | 2 +- project2/files/optionsSource.h | 5 +++-- project2/files/presenterCache.cpp | 2 +- project2/ice/buildComms.cpp | 2 +- project2/ice/iceBase.h | 3 ++- project2/ice/iceClient.h | 3 ++- project2/ice/iceCompile.cpp | 2 +- project2/ice/iceConvert.h | 5 +++-- project2/ice/iceDaemon.h | 3 ++- project2/ice/iceDataSource.h | 3 ++- project2/ice/iceModule.h | 3 ++- project2/ice/iceRows.h | 3 ++- project2/ice/iceboxDaemon.cpp | 1 + project2/ice/slice2Common.h | 3 ++- project2/ice/sliceCompile.h | 3 ++- project2/ice/unittests/conversions.cpp | 4 ++++ project2/url/curlHelper.h | 5 +++-- project2/ut/testAppInstance.h | 3 ++- project2/ut/testOptionsSource.h | 3 ++- project2/ut/testPresenter.h | 9 +++++---- project2/ut/testScriptHost.h | 3 ++- project2/ut/testScriptNode.h | 3 ++- project2/xml/transformHtml.h | 3 ++- project2/xml/transformText.h | 3 ++- project2/xml/xmlCache.cpp | 2 +- project2/xml/xmlPresenter.cpp | 2 +- project2/xml/xmlPresenter.h | 5 +++-- project2/xml/xmlScriptParser.h | 3 ++- 97 files changed, 237 insertions(+), 166 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index cc16698..f42f929 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -8,13 +8,13 @@ variant coverage : debug ; project : requirements - release:"-std=c++1y" + release:"-std=c++1y -fvisibility=hidden" release:"-Wl,-z,defs,--warn-once,--gc-sections" - debug:"-W -Wall -Werror -Wwrite-strings -std=c++1y" + debug:"-W -Wall -Werror -Wwrite-strings -std=c++1y -fvisibility=hidden" debug:"-Wl,-z,defs,--warn-once" - coverage:"-W -Wall -Werror -Wwrite-strings -std=c++1y --coverage" + coverage:"-W -Wall -Werror -Wwrite-strings -std=c++1y --coverage -fvisibility=hidden" coverage:"-Wl,-z,defs,--warn-once --coverage" - component:"-W -Wall -Werror -Wwrite-strings -std=c++1y -fPIC" + component:"-W -Wall -Werror -Wwrite-strings -std=c++1y -fPIC -fvisibility=hidden" component:"-Wl,-z,lazy,--warn-once,-fPIC" ; diff --git a/project2/basics/options/flagSet.h b/project2/basics/options/flagSet.h index 0e7830f..e956e8a 100644 --- a/project2/basics/options/flagSet.h +++ b/project2/basics/options/flagSet.h @@ -2,8 +2,9 @@ #define OPTIONS_FLAGSET_H #include +#include -class OptionFlagSet : public Options::Target { +class DLL_PUBLIC OptionFlagSet : public Options::Target { public: OptionFlagSet(bool * target); diff --git a/project2/basics/options/showHelp.h b/project2/basics/options/showHelp.h index c42a736..eb94155 100644 --- a/project2/basics/options/showHelp.h +++ b/project2/basics/options/showHelp.h @@ -3,8 +3,9 @@ #include #include +#include -class ShowHelpComponent : public LifeCycle { +class DLL_PUBLIC ShowHelpComponent : public LifeCycle { public: void onConfigLoad() override; static Options::TargetPtr Option(); diff --git a/project2/basics/views/flatView.cpp b/project2/basics/views/flatView.cpp index 1ad2c68..aba684f 100644 --- a/project2/basics/views/flatView.cpp +++ b/project2/basics/views/flatView.cpp @@ -6,7 +6,7 @@ #include NAMEDFACTORY("flatview", FlatView, FlatViewFactory); -INSTANTIATEFACTORY(FlatView, ScriptNodePtr); +INSTANTIATEFACTORY(FlatView, const ScriptNode *); FlatView::FlatView(ScriptNodePtr p) : SourceObject(p), diff --git a/project2/basics/views/flatView.h b/project2/basics/views/flatView.h index 3e7f9d2..b79162b 100644 --- a/project2/basics/views/flatView.h +++ b/project2/basics/views/flatView.h @@ -5,9 +5,10 @@ #include "rowProcessor.h" #include "view.h" #include "aggregate.h" +#include /// Project2 component to create output based on a records in a flat row set -class FlatView : public SourceObject, public RowProcessor { +class DLL_PUBLIC FlatView : public SourceObject, public RowProcessor { public: FlatView(ScriptNodePtr); virtual ~FlatView(); @@ -23,7 +24,7 @@ class FlatView : public SourceObject, public RowProcessor { typedef std::map Columns; Columns viewColumns; }; -typedef AdHoc::Factory FlatViewFactory; +typedef AdHoc::Factory FlatViewFactory; #endif diff --git a/project2/cgi/cgiAppEngine.h b/project2/cgi/cgiAppEngine.h index d8271b5..b9a30d9 100644 --- a/project2/cgi/cgiAppEngine.h +++ b/project2/cgi/cgiAppEngine.h @@ -17,6 +17,7 @@ #include "cgiRequestContext.h" #include #include +#include class Session; namespace cgicc { @@ -24,7 +25,7 @@ namespace cgicc { class CgiEnvironment; } -class CgiApplicationEngine : AppInstance { +class DLL_PUBLIC CgiApplicationEngine : AppInstance { public: typedef boost::shared_ptr HttpHeaderPtr; typedef std::pair> PlatformHostname; diff --git a/project2/cgi/cgiContentNegotiate.cpp b/project2/cgi/cgiContentNegotiate.cpp index 0d1bbaf..beff91c 100644 --- a/project2/cgi/cgiContentNegotiate.cpp +++ b/project2/cgi/cgiContentNegotiate.cpp @@ -5,7 +5,7 @@ class ContentNegotiateFactory : public PresenterFactory { public: - MultiRowSetPresenter * create(const ScriptNodePtr & s, const ObjectSource & os, ExecContext * const & ec) const + MultiRowSetPresenter * create(const ScriptNode * const & s, const ObjectSource & os, ExecContext * const & ec) const override { auto accept = static_cast(ec)->getAccept(); typedef boost::tokenizer> tokenizer; diff --git a/project2/cgi/cgiOutputOptions.cpp b/project2/cgi/cgiOutputOptions.cpp index 07dbf79..56590ff 100644 --- a/project2/cgi/cgiOutputOptions.cpp +++ b/project2/cgi/cgiOutputOptions.cpp @@ -32,5 +32,5 @@ DECLARE_OPTIONS(OutputOptions, "CGI default output options") END_OPTIONS(OutputOptions) NAMEDFACTORY("outputoptions", OutputOptions, OutputOptionsFactory) -INSTANTIATEFACTORY(OutputOptions, ScriptNodePtr); +INSTANTIATEFACTORY(OutputOptions, const ScriptNode *); diff --git a/project2/cgi/cgiOutputOptions.h b/project2/cgi/cgiOutputOptions.h index 6c40388..9914665 100644 --- a/project2/cgi/cgiOutputOptions.h +++ b/project2/cgi/cgiOutputOptions.h @@ -30,6 +30,6 @@ class OutputOptions : public IntrusivePtrBase { static bool parameters; }; typedef boost::intrusive_ptr OutputOptionsPtr; -typedef AdHoc::Factory OutputOptionsFactory; +typedef AdHoc::Factory OutputOptionsFactory; #endif diff --git a/project2/cgi/cgiProgRouter.cpp b/project2/cgi/cgiProgRouter.cpp index 562b922..9993441 100644 --- a/project2/cgi/cgiProgRouter.cpp +++ b/project2/cgi/cgiProgRouter.cpp @@ -16,7 +16,7 @@ typedef std::map VarMap; class RoutingTable { public: class Route; - typedef AdHoc::Factory RouteFactory; + typedef AdHoc::Factory RouteFactory; void loadRoutesFromFile(const std::string & routeFile) { routeScriptPath = routeFile; @@ -224,5 +224,5 @@ class Routes : public RowSet { }; NAMEDFACTORY("routes", Routes, RowSetFactory); -INSTANTIATEFACTORY(RoutingTable::Route, ScriptNodePtr); +INSTANTIATEFACTORY(RoutingTable::Route, const ScriptNode *); diff --git a/project2/cgi/cgiStageDefaultError.cpp b/project2/cgi/cgiStageDefaultError.cpp index e5d1b9f..f932f78 100644 --- a/project2/cgi/cgiStageDefaultError.cpp +++ b/project2/cgi/cgiStageDefaultError.cpp @@ -16,7 +16,7 @@ CgiApplicationEngine::DefaultErrorStage::DefaultErrorStage(const std::exception auto xp = dynamic_cast(pres.get()); auto cp = dynamic_cast(pres.get()); if (xp && cp && cp->contentType == CgiApplicationEngine::transformContentType) { - auto h = TransformTargetFactory::createNew(CgiApplicationEngine::transformTargetType, root, Default); + auto h = TransformTargetFactory::createNew(CgiApplicationEngine::transformTargetType, root.get(), Default); xp->addTarget(h, crc, root); } } diff --git a/project2/cgi/cgiStagePresent.cpp b/project2/cgi/cgiStagePresent.cpp index dffc98e..04fae92 100644 --- a/project2/cgi/cgiStagePresent.cpp +++ b/project2/cgi/cgiStagePresent.cpp @@ -11,11 +11,11 @@ CgiApplicationEngine::PresentStage::PresentStage(ScriptReaderPtr s, CgiRequestCo CheckHost(s->root()), ViewHost(s->root()), presenter([this, crc] { - auto p = PresenterFactory::createNew(CgiApplicationEngine::defaultPresenter, root, Default, crc); + auto p = PresenterFactory::createNew(CgiApplicationEngine::defaultPresenter, root.get(), Default, crc); auto xp = dynamic_cast(p); auto cp = dynamic_cast(p); if (xp && cp && cp->contentType == CgiApplicationEngine::transformContentType) { - auto h = TransformTargetFactory::createNew(CgiApplicationEngine::transformTargetType, root, Default); + auto h = TransformTargetFactory::createNew(CgiApplicationEngine::transformTargetType, root.get(), Default); xp->addTarget(h, crc, root); } return p; diff --git a/project2/cli/claOptions.h b/project2/cli/claOptions.h index 3f13b4b..d178720 100644 --- a/project2/cli/claOptions.h +++ b/project2/cli/claOptions.h @@ -2,12 +2,13 @@ #define CLAOPTIONS_H #include "../common/optionsSource.h" +#include -class CommandLineArguments : public OptionsSource { +class DLL_PUBLIC CommandLineArguments : public OptionsSource { public: typedef boost::function Others; CommandLineArguments(int c, const char * const * v, const Others &); - void loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & platform) const; + void loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & platform) const override; boost::posix_time::ptime modifiedTime() const override; private: diff --git a/project2/common/aggregate.cpp b/project2/common/aggregate.cpp index f00f7dc..07d6902 100644 --- a/project2/common/aggregate.cpp +++ b/project2/common/aggregate.cpp @@ -23,6 +23,6 @@ Aggregate::pushValue(ExecContext * ec) const pushValue(value(ec), ec); } -INSTANTIATEFACTORY(ValueAggregate, ScriptNodePtr); -INSTANTIATEFACTORY(SetAggregate, ScriptNodePtr); +INSTANTIATEFACTORY(ValueAggregate, const ScriptNode *); +INSTANTIATEFACTORY(SetAggregate, const ScriptNode *); diff --git a/project2/common/aggregate.h b/project2/common/aggregate.h index a2ad54d..90d8248 100644 --- a/project2/common/aggregate.h +++ b/project2/common/aggregate.h @@ -4,8 +4,9 @@ #include "scripts.h" #include "variables.h" #include +#include -class Aggregate : public SourceObject { +class DLL_PUBLIC Aggregate : public SourceObject { public: Aggregate(ScriptNodePtr); @@ -17,16 +18,16 @@ class Aggregate : public SourceObject { Variable value; }; -class ValueAggregate : public Aggregate { +class DLL_PUBLIC ValueAggregate : public Aggregate { public: ValueAggregate(ScriptNodePtr); virtual VariableType resultValue() const = 0; }; typedef boost::intrusive_ptr ValueAggregateCPtr; -typedef AdHoc::Factory ValueAggregateFactory; +typedef AdHoc::Factory ValueAggregateFactory; -class SetAggregate : public Aggregate { +class DLL_PUBLIC SetAggregate : public Aggregate { public: typedef boost::function1 UseAgg; SetAggregate(ScriptNodePtr); @@ -34,6 +35,6 @@ class SetAggregate : public Aggregate { virtual void onResultValues(const UseAgg &) const = 0; }; typedef boost::intrusive_ptr SetAggregateCPtr; -typedef AdHoc::Factory SetAggregateFactory; +typedef AdHoc::Factory SetAggregateFactory; #endif diff --git a/project2/common/appInstance.h b/project2/common/appInstance.h index 50ade4d..4494b5e 100644 --- a/project2/common/appInstance.h +++ b/project2/common/appInstance.h @@ -3,8 +3,9 @@ #include #include "scripts.h" +#include -class AppInstance { +class DLL_PUBLIC AppInstance { public: typedef std::map ScriptCache; diff --git a/project2/common/check.cpp b/project2/common/check.cpp index 703a3ea..37879e2 100644 --- a/project2/common/check.cpp +++ b/project2/common/check.cpp @@ -29,5 +29,5 @@ Check::performCheck(ExecContext * ec) const return test->passes(ec); } -INSTANTIATEFACTORY(Check, ScriptNodePtr); +INSTANTIATEFACTORY(Check, const ScriptNode *); diff --git a/project2/common/check.h b/project2/common/check.h index d108f7c..8b9ce14 100644 --- a/project2/common/check.h +++ b/project2/common/check.h @@ -4,11 +4,12 @@ #include "sourceObject.h" #include "variables.h" #include "test.h" +#include class ExecContext; /// Base class for Project2 compoments that perform checks -class Check : public SourceObject { +class DLL_PUBLIC Check : public SourceObject { public: Check(ScriptNodePtr p); virtual ~Check(); @@ -21,7 +22,7 @@ class Check : public SourceObject { TestPtr test; }; typedef boost::intrusive_ptr CheckCPtr; -typedef AdHoc::Factory CheckFactory; +typedef AdHoc::Factory CheckFactory; #endif diff --git a/project2/common/checkHost.h b/project2/common/checkHost.h index f404d9e..46b5a04 100644 --- a/project2/common/checkHost.h +++ b/project2/common/checkHost.h @@ -6,8 +6,9 @@ #include #include #include "commonObjects.h" +#include -class CheckHost : virtual public CommonObjects { +class DLL_PUBLIC CheckHost : virtual public CommonObjects { public: class CheckFailure : std::exception { public: diff --git a/project2/common/columns.h b/project2/common/columns.h index d3e2c97..72fd40b 100644 --- a/project2/common/columns.h +++ b/project2/common/columns.h @@ -5,8 +5,9 @@ #include #include #include +#include -class Column : public IntrusivePtrBase { +class DLL_PUBLIC Column : public IntrusivePtrBase { public: Column(unsigned int idx, ScriptNodePtr p); Column(unsigned int i, const Glib::ustring & n, const Variable & v = Variable(Null())); diff --git a/project2/common/commonObjects.h b/project2/common/commonObjects.h index 788e3bd..474e7e4 100644 --- a/project2/common/commonObjects.h +++ b/project2/common/commonObjects.h @@ -5,8 +5,9 @@ #include "rowSet.h" #include "scriptStorage.h" #include "options.h" +#include -class CommonObjects : public virtual IntrusivePtrBase { +class DLL_PUBLIC CommonObjects : public virtual IntrusivePtrBase { public: typedef STORAGEOF(RowSet) RowSets; typedef STORAGEOF(DataSource) DataSources; diff --git a/project2/common/dataSource.cpp b/project2/common/dataSource.cpp index 5b23c9a..da1ab52 100644 --- a/project2/common/dataSource.cpp +++ b/project2/common/dataSource.cpp @@ -8,5 +8,5 @@ DataSource::DataSource(ScriptNodePtr p) : { } -INSTANTIATEFACTORY(DataSource, ScriptNodePtr); +INSTANTIATEFACTORY(DataSource, const ScriptNode *); diff --git a/project2/common/dataSource.h b/project2/common/dataSource.h index c60cceb..baaaac7 100644 --- a/project2/common/dataSource.h +++ b/project2/common/dataSource.h @@ -3,12 +3,13 @@ #include #include "sourceObject.h" +#include class DataSource; typedef boost::intrusive_ptr DataSourcePtr; /// Base class for data sources providing transaction support -class DataSource : public SourceObject { +class DLL_PUBLIC DataSource : public SourceObject { public: DataSource(ScriptNodePtr p); virtual ~DataSource() = default; @@ -17,7 +18,7 @@ class DataSource : public SourceObject { virtual void commit() { }; virtual void rollback() { }; }; -typedef AdHoc::Factory DataSourceFactory; +typedef AdHoc::Factory DataSourceFactory; #endif diff --git a/project2/common/definedColumns.h b/project2/common/definedColumns.h index 2f53669..2459872 100644 --- a/project2/common/definedColumns.h +++ b/project2/common/definedColumns.h @@ -4,15 +4,16 @@ #include "variables.h" #include "rowSet.h" #include "columns.h" +#include -class DefinedColumns { +class DLL_PUBLIC DefinedColumns { public: typedef boost::function2 ColCreator; DefinedColumns(ScriptNodePtr p, const Glib::ustring & colPath, const ColCreator & func); Columns columns; }; -class ColumnValues : public RowState { +class DLL_PUBLIC ColumnValues : public RowState { public: ColumnValues(const DefinedColumns *); virtual ~ColumnValues(); diff --git a/project2/common/exceptions.h b/project2/common/exceptions.h index 1051220..1642e1a 100644 --- a/project2/common/exceptions.h +++ b/project2/common/exceptions.h @@ -3,8 +3,9 @@ #include #include +#include -class MsgBufferedException : public std::exception { +class DLL_PUBLIC MsgBufferedException : public std::exception { public: inline ~MsgBufferedException() throw() { } const char * what() const throw(); @@ -14,7 +15,7 @@ class MsgBufferedException : public std::exception { mutable boost::optional buf; }; -class numeric_error : public MsgBufferedException { +class DLL_PUBLIC numeric_error : public MsgBufferedException { public: numeric_error(int); protected: @@ -23,7 +24,7 @@ class numeric_error : public MsgBufferedException { int err; }; -class syscall_error : public MsgBufferedException { +class DLL_PUBLIC syscall_error : public MsgBufferedException { public: syscall_error(int); protected: @@ -32,7 +33,7 @@ class syscall_error : public MsgBufferedException { int err; }; -class two_part_error : public MsgBufferedException { +class DLL_PUBLIC two_part_error : public MsgBufferedException { public: two_part_error(const std::string & what1, const std::string & what2); ~two_part_error() throw(); diff --git a/project2/common/execContext.h b/project2/common/execContext.h index 86438bd..4fcf36c 100644 --- a/project2/common/execContext.h +++ b/project2/common/execContext.h @@ -6,12 +6,13 @@ #include #include "variableType.h" #include "session.h" +#include class MultiRowSetPresenter; class RowState; class IHaveParameters; -class ExecContext { +class DLL_PUBLIC ExecContext { public: class Message : public IntrusivePtrBase { public: diff --git a/project2/common/fileStrmVarWriter.h b/project2/common/fileStrmVarWriter.h index dd43473..dd125c4 100644 --- a/project2/common/fileStrmVarWriter.h +++ b/project2/common/fileStrmVarWriter.h @@ -2,8 +2,9 @@ #define FILESTREAMVARWRITER_H #include "variables.h" +#include -class FileStreamVariableWriter : public boost::static_visitor<> { +class DLL_PUBLIC FileStreamVariableWriter : public boost::static_visitor<> { public: FileStreamVariableWriter(FILE *, bool quoting); ~FileStreamVariableWriter(); diff --git a/project2/common/iHaveParameters.h b/project2/common/iHaveParameters.h index bab4592..e8d7519 100644 --- a/project2/common/iHaveParameters.h +++ b/project2/common/iHaveParameters.h @@ -5,9 +5,10 @@ #include #include "variables.h" #include "intrusivePtrBase.h" +#include /// Mix-in base class to store parameters for component execution -class IHaveParameters { +class DLL_PUBLIC IHaveParameters { public: typedef std::map Parameters; diff --git a/project2/common/iHaveSubTasks.h b/project2/common/iHaveSubTasks.h index 1fd5041..433899d 100644 --- a/project2/common/iHaveSubTasks.h +++ b/project2/common/iHaveSubTasks.h @@ -3,9 +3,10 @@ #include "task.h" #include "scriptStorage.h" +#include /// Base class for Project2 compoments that perform actions, but product no output -class IHaveSubTasks : public Task { +class DLL_PUBLIC IHaveSubTasks : public Task { public: typedef ANONORDEREDSTORAGEOF(Task) Tasks; diff --git a/project2/common/lifeCycle.h b/project2/common/lifeCycle.h index 2a6b5b2..0e24581 100644 --- a/project2/common/lifeCycle.h +++ b/project2/common/lifeCycle.h @@ -3,9 +3,10 @@ #include #include +#include /// Helper for loading and maintaining Project2 components -class LifeCycle : public virtual AdHoc::AbstractPluginImplementation { +class DLL_PUBLIC LifeCycle : public virtual AdHoc::AbstractPluginImplementation { public: virtual ~LifeCycle() = 0; diff --git a/project2/common/logger.h b/project2/common/logger.h index 8d8b6de..c6c1be0 100644 --- a/project2/common/logger.h +++ b/project2/common/logger.h @@ -8,11 +8,12 @@ #include #include "intrusivePtrBase.h" #include +#include #include "lifeCycle.h" class LogDriverBase; class LogDriverFactory; -class Log { +class DLL_PUBLIC Log { public: typedef boost::intrusive_ptr LogDriverBasePtr; typedef std::map LogDrivers; @@ -47,7 +48,7 @@ class Log { int nextId; }; -class Logger { +class DLL_PUBLIC Logger { public: Log * operator->() const; private: diff --git a/project2/common/loggerFactory.h b/project2/common/loggerFactory.h index e620e0c..1c6033b 100644 --- a/project2/common/loggerFactory.h +++ b/project2/common/loggerFactory.h @@ -5,9 +5,10 @@ #include "lifeCycle.h" #include "intrusivePtrBase.h" #include "logger.h" +#include /// Base class for classes providing a logging facility -class LogDriverBase : public virtual IntrusivePtrBase { +class DLL_PUBLIC LogDriverBase : public virtual IntrusivePtrBase { public: LogDriverBase(); virtual ~LogDriverBase(); @@ -15,7 +16,7 @@ class LogDriverBase : public virtual IntrusivePtrBase { virtual void message(int priority, const char * msg) const = 0; }; -class LogDriverFactory : public AdHoc::Factory { +class DLL_PUBLIC LogDriverFactory : public AdHoc::Factory { public: virtual int loggerLevel() const = 0; }; diff --git a/project2/common/options.h b/project2/common/options.h index 6e734bb..4c52649 100644 --- a/project2/common/options.h +++ b/project2/common/options.h @@ -10,8 +10,9 @@ #include #include "variableType.h" #include +#include -class Options : public AdHoc::AbstractPluginImplementation { +class DLL_PUBLIC Options : public AdHoc::AbstractPluginImplementation { public: class Target; diff --git a/project2/common/optionsSource.h b/project2/common/optionsSource.h index a6b50e9..35905aa 100644 --- a/project2/common/optionsSource.h +++ b/project2/common/optionsSource.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "scriptLoader.h" #include "options.h" @@ -18,7 +19,7 @@ class OptionsSource; typedef boost::shared_ptr OptionsSourcePtr; /// Base class of things that load options -class OptionsSource : public AdHoc::AbstractPluginImplementation { +class DLL_PUBLIC OptionsSource : public AdHoc::AbstractPluginImplementation { public: virtual ~OptionsSource() = default; diff --git a/project2/common/presenter.cpp b/project2/common/presenter.cpp index a28f00c..b4b7379 100644 --- a/project2/common/presenter.cpp +++ b/project2/common/presenter.cpp @@ -1,6 +1,7 @@ #include +#include "scripts.h" +#include "execContext.h" #include "presenter.h" -#include "dataSource.h" #include NameValuePairPresenter::NameValuePairPresenter() @@ -120,5 +121,5 @@ MultiRowSetPresenter::finalizeContent() const { } -INSTANTIATEFACTORY(MultiRowSetPresenter, ScriptNodePtr, ObjectSource, ExecContext *); +INSTANTIATEFACTORY(MultiRowSetPresenter, const ScriptNode *, const ObjectSource &, ExecContext *); diff --git a/project2/common/presenter.h b/project2/common/presenter.h index 037e7bf..6efb6e4 100644 --- a/project2/common/presenter.h +++ b/project2/common/presenter.h @@ -7,8 +7,9 @@ #include #include "view.h" #include "scriptLoader.h" +#include -class NameValuePairPresenter : public virtual IntrusivePtrBase { +class DLL_PUBLIC NameValuePairPresenter : public virtual IntrusivePtrBase { public: NameValuePairPresenter(); virtual ~NameValuePairPresenter(); @@ -17,7 +18,7 @@ class NameValuePairPresenter : public virtual IntrusivePtrBase { virtual void addAttribute(const Glib::ustring & name, const VariableType & value) const; }; -class RowSetPresenter : public NameValuePairPresenter { +class DLL_PUBLIC RowSetPresenter : public NameValuePairPresenter { public: RowSetPresenter(); virtual ~RowSetPresenter() = 0; @@ -26,7 +27,7 @@ class RowSetPresenter : public NameValuePairPresenter { virtual void finishRow() const = 0; }; -class MultiRowSetPresenter : public RowSetPresenter { +class DLL_PUBLIC MultiRowSetPresenter : public RowSetPresenter { public: MultiRowSetPresenter(ObjectSource); virtual ~MultiRowSetPresenter() = 0; @@ -43,7 +44,7 @@ class MultiRowSetPresenter : public RowSetPresenter { virtual void finalizeContent() const; }; -class Presenter : public MultiRowSetPresenter { +class DLL_PUBLIC Presenter : public MultiRowSetPresenter { public: Presenter(ObjectSource); virtual ~Presenter() = 0; @@ -65,7 +66,7 @@ class Presenter : public MultiRowSetPresenter { void finishRowSet() const; }; -class ContentPresenter { +class DLL_PUBLIC ContentPresenter { public: ContentPresenter(const Glib::ustring & contentType); const Glib::ustring contentType; @@ -77,7 +78,7 @@ typedef boost::intrusive_ptr RowSetPresenterPtr; typedef boost::intrusive_ptr MultiRowSetPresenterPtr; typedef boost::intrusive_ptr NameValuePairPresenterPtr; -typedef AdHoc::Factory PresenterFactory; +typedef AdHoc::Factory PresenterFactory; #endif diff --git a/project2/common/presenterCache.cpp b/project2/common/presenterCache.cpp index 429f93e..db597d9 100644 --- a/project2/common/presenterCache.cpp +++ b/project2/common/presenterCache.cpp @@ -13,7 +13,7 @@ PresenterCache::flushCache() { } -INSTANTIATEFACTORY(PresenterCache, ScriptNodePtr); +INSTANTIATEFACTORY(PresenterCache, const ScriptNode *); class WriteToCache : public TransformImpl { public: diff --git a/project2/common/presenterCache.h b/project2/common/presenterCache.h index c90c077..48967d6 100644 --- a/project2/common/presenterCache.h +++ b/project2/common/presenterCache.h @@ -4,8 +4,9 @@ #include "transform.h" #include "scripts.h" #include "iHaveParameters.h" +#include -class PresenterCache : public SourceObject, public virtual TransformSource, public StaticContent, public SourceOf, public IHaveParameters { +class DLL_PUBLIC PresenterCache : public SourceObject, public virtual TransformSource, public StaticContent, public SourceOf, public IHaveParameters { public: PresenterCache(ScriptNodePtr); virtual bool check(time_t scriptMtime, ExecContext *) const = 0; @@ -15,6 +16,6 @@ class PresenterCache : public SourceObject, public virtual TransformSource, publ const std::string encoding; }; typedef boost::intrusive_ptr PresenterCachePtr; -typedef AdHoc::Factory PresenterCacheFactory; +typedef AdHoc::Factory PresenterCacheFactory; #endif diff --git a/project2/common/rowProcessor.h b/project2/common/rowProcessor.h index ca36b32..66f99ec 100644 --- a/project2/common/rowProcessor.h +++ b/project2/common/rowProcessor.h @@ -8,12 +8,13 @@ #include "rowSetCache.h" #include "test.h" #include "scriptStorage.h" +#include class Presenter; class ExecContext; /// Base class for Project2 components that work with row sets -class RowProcessor : public IHaveParameters { +class DLL_PUBLIC RowProcessor : public IHaveParameters { public: enum EventIDs { Complete }; RowProcessor(ScriptNodePtr); diff --git a/project2/common/rowSet.cpp b/project2/common/rowSet.cpp index 1299818..cd0b097 100644 --- a/project2/common/rowSet.cpp +++ b/project2/common/rowSet.cpp @@ -88,5 +88,5 @@ RowState::foreachAttr(const AttrAction &) const // rowNum is magic, so it doesn't count :) } -INSTANTIATEFACTORY(RowSet, ScriptNodePtr); +INSTANTIATEFACTORY(RowSet, const ScriptNode *); diff --git a/project2/common/rowSet.h b/project2/common/rowSet.h index 8745c87..30a8c37 100644 --- a/project2/common/rowSet.h +++ b/project2/common/rowSet.h @@ -7,6 +7,7 @@ #include "exceptions.h" #include "columns.h" #include +#include class RowSet; class VariableType; @@ -17,7 +18,7 @@ typedef boost::intrusive_ptr ConstRowSetPtr; typedef boost::function RowProcessorCallback; /// Base class for Project2 components that provide a row set representation of data -class RowSet : public virtual SourceObject { +class DLL_PUBLIC RowSet : public virtual SourceObject { public: SimpleNumericException(ParentOutOfRange); SimpleMessageException(FieldDoesNotExist); @@ -29,7 +30,7 @@ class RowSet : public virtual SourceObject { virtual void execute(const Glib::ustring &, const RowProcessorCallback &, ExecContext *) const = 0; }; -class RowState { +class DLL_PUBLIC RowState { public: RowState(); virtual ~RowState() = default; @@ -55,7 +56,7 @@ class RowState { private: unsigned int rowNum; }; -typedef AdHoc::Factory RowSetFactory; +typedef AdHoc::Factory RowSetFactory; #endif diff --git a/project2/common/rowSetCache.cpp b/project2/common/rowSetCache.cpp index b8c0ef6..0380a5d 100644 --- a/project2/common/rowSetCache.cpp +++ b/project2/common/rowSetCache.cpp @@ -48,5 +48,5 @@ RowSetCache::applyKeys(ExecContext * ec, const KeyApplier & f, const IHaveParame } } -INSTANTIATEFACTORY(RowSetCache, ScriptNodePtr); +INSTANTIATEFACTORY(RowSetCache, const ScriptNode *); diff --git a/project2/common/rowSetCache.h b/project2/common/rowSetCache.h index 9418463..c8501c9 100644 --- a/project2/common/rowSetCache.h +++ b/project2/common/rowSetCache.h @@ -5,12 +5,13 @@ #include "presenter.h" #include "iHaveParameters.h" #include "rowSet.h" +#include class RowSet; class RowState; typedef boost::intrusive_ptr RowSetCPtr; -class RowSetCache : public IHaveParameters, public virtual SourceObject { +class DLL_PUBLIC RowSetCache : public IHaveParameters, public virtual SourceObject { public: RowSetCache(ScriptNodePtr p); @@ -26,7 +27,7 @@ class RowSetCache : public IHaveParameters, public virtual SourceObject { const bool inherit; }; typedef boost::intrusive_ptr RowSetCachePtr; -typedef AdHoc::Factory RowSetCacheFactory; +typedef AdHoc::Factory RowSetCacheFactory; #endif diff --git a/project2/common/scriptLoader.cpp b/project2/common/scriptLoader.cpp index e3abd86..1d2bc53 100644 --- a/project2/common/scriptLoader.cpp +++ b/project2/common/scriptLoader.cpp @@ -62,7 +62,7 @@ LoaderBase::collectAll(ScriptNodePtr node, LoadedObjects & loadedObjects, bool c if (!node->obj) { for (const StorerPtr & s : sts) { try { - node->obj = s->create(node); + node->obj = s->create(node.get()); break; } catch (const AdHoc::NoSuchPluginException &) { @@ -76,9 +76,9 @@ LoaderBase::collectAll(ScriptNodePtr node, LoadedObjects & loadedObjects, bool c loadedObjects.insert(p.get()); } for (const StorerPtr & s : sts) { - if (s->save(node->obj, node)) { + if (s->save(node->obj, node.get())) { stored += 1; - if (!s->cacheable(node)) { + if (!s->cacheable(node.get())) { node->obj.reset(); } break; diff --git a/project2/common/scriptLoader.h b/project2/common/scriptLoader.h index fed7cef..c5cf853 100644 --- a/project2/common/scriptLoader.h +++ b/project2/common/scriptLoader.h @@ -11,6 +11,7 @@ #include #include #include +#include class CommonObjects; class Storer; @@ -18,7 +19,7 @@ class ScriptReader; class SourceObject; typedef boost::intrusive_ptr SourceObjectPtr; -class LoaderBase { +class DLL_PUBLIC LoaderBase { public: typedef boost::intrusive_ptr StorerPtr; typedef std::vector StorerPtrs; diff --git a/project2/common/scriptStorage.h b/project2/common/scriptStorage.h index c4155f2..4d7cbf4 100644 --- a/project2/common/scriptStorage.h +++ b/project2/common/scriptStorage.h @@ -37,30 +37,30 @@ class Storer : public virtual IntrusivePtrBase { template static boost::intrusive_ptr > into(ANONORDEREDSTORAGEOF(X) * list, const C & ... c); - virtual boost::intrusive_ptr create(ScriptNodePtr) const = 0; - virtual bool save(boost::intrusive_ptr, ScriptNodePtr) = 0; - virtual bool cacheable(ScriptNodePtr) const { return true; } + virtual boost::intrusive_ptr create(const ScriptNode *) const = 0; + virtual bool save(boost::intrusive_ptr, const ScriptNode *) = 0; + virtual bool cacheable(const ScriptNode *) const { return true; } }; template class StorerBase : public Storer { public: - typedef boost::function2, const L *, ScriptNodePtr> Creator; + typedef boost::function2, const L *, const ScriptNode *> Creator; StorerBase(const Creator & c) : creator(c) { } - boost::intrusive_ptr create(ScriptNodePtr p) const { + boost::intrusive_ptr create(const ScriptNode * p) const { return creator(L::get(p->get_name()), p); } - bool cacheable(ScriptNodePtr p) const { + bool cacheable(const ScriptNode * p) const { auto f = AdHoc::PluginManager::getDefault()->get(p->get_name()); if (auto c = dynamic_cast(f->implementation())) { return c->cacheable(); } return true; } - bool save(boost::intrusive_ptr o, ScriptNodePtr name) { + bool save(boost::intrusive_ptr o, const ScriptNode * name) { boost::intrusive_ptr O = boost::dynamic_pointer_cast(o); if (O) { if (!insert(O)) { diff --git a/project2/common/scripts.h b/project2/common/scripts.h index 2442558..d72e567 100644 --- a/project2/common/scripts.h +++ b/project2/common/scripts.h @@ -12,6 +12,7 @@ #include "variableType.h" #include "options.h" #include +#include SimpleMessageException(ValueNotFound); SimpleMessage2Exception(ScriptNotFound); @@ -20,14 +21,14 @@ SimpleMessage2Exception(DependencyNotFound); class VariableImpl; class ExecContext; -class Scripts { +class DLL_PUBLIC Scripts { public: INITOPTIONS; static std::string scriptNamespace; static std::string scriptNamespacePrefix; }; -class ScriptNode : public IntrusivePtrBase { +class DLL_PUBLIC ScriptNode : public IntrusivePtrBase { public: ScriptNode(ScriptReaderPtr); virtual ~ScriptNode() { } @@ -62,7 +63,7 @@ class ScriptNode : public IntrusivePtrBase { mutable boost::intrusive_ptr obj; }; -class ScriptReader : public virtual IntrusivePtrBase { +class DLL_PUBLIC ScriptReader : public virtual IntrusivePtrBase { public: typedef boost::tuple ScriptKey; diff --git a/project2/common/scripts_fwd.h b/project2/common/scripts_fwd.h index 7d5ed00..30ed674 100644 --- a/project2/common/scripts_fwd.h +++ b/project2/common/scripts_fwd.h @@ -2,9 +2,10 @@ #define SCRIPTS_FWD_H #include +#include -class ScriptNode; -class ScriptReader; +class DLL_PUBLIC ScriptNode; +class DLL_PUBLIC ScriptReader; typedef boost::intrusive_ptr ScriptNodePtr; typedef boost::intrusive_ptr ScriptReaderPtr; diff --git a/project2/common/session.h b/project2/common/session.h index 24b021e..1a77a88 100644 --- a/project2/common/session.h +++ b/project2/common/session.h @@ -9,9 +9,10 @@ #include "intrusivePtrBase.h" #include "variables.h" #include "exceptions.h" +#include /// Base class for classes implementing session variable storage -class Session : public virtual IntrusivePtrBase { +class DLL_PUBLIC Session : public virtual IntrusivePtrBase { public: SimpleMessageException(VariableNotFound); typedef std::map Values; diff --git a/project2/common/sessionContainer.h b/project2/common/sessionContainer.h index 4f62e96..9d9e173 100644 --- a/project2/common/sessionContainer.h +++ b/project2/common/sessionContainer.h @@ -6,8 +6,9 @@ #include "session.h" #include "options.h" #include +#include -class SessionContainer : public IntrusivePtrBase { +class DLL_PUBLIC SessionContainer : public IntrusivePtrBase { public: SessionContainer(); virtual ~SessionContainer() = 0; diff --git a/project2/common/sourceObject.h b/project2/common/sourceObject.h index 1af9ceb..5e3499c 100644 --- a/project2/common/sourceObject.h +++ b/project2/common/sourceObject.h @@ -5,17 +5,18 @@ #include #include #include -#include "intrusivePtrBase.h" +#include +#include #include "scriptLoader.h" #include "scripts_fwd.h" -enum ObjectSource { +enum DLL_PUBLIC ObjectSource { Default, Scripted }; class CommonObjects; /// Base class for all Project2 components that can be placed in a Project2 script -class SourceObject : public virtual IntrusivePtrBase { +class DLL_PUBLIC SourceObject : public virtual IntrusivePtrBase { public: typedef int EventID; typedef boost::function Event; diff --git a/project2/common/stream.cpp b/project2/common/stream.cpp index d97d1ab..98180d8 100644 --- a/project2/common/stream.cpp +++ b/project2/common/stream.cpp @@ -21,5 +21,5 @@ Stream::writeTo(std::ostream & os, const std::string &, ExecContext * ec) const runStream(boost::bind(&Stream::write, &os, _1, _2), ec); } -INSTANTIATEFACTORY(Stream, ScriptNodePtr); +INSTANTIATEFACTORY(Stream, const ScriptNode *); diff --git a/project2/common/stream.h b/project2/common/stream.h index 4fe47f0..bffee9b 100644 --- a/project2/common/stream.h +++ b/project2/common/stream.h @@ -4,10 +4,11 @@ #include "sourceObject.h" #include #include "transform.h" +#include class ExecContext; -class Stream : public SourceObject, public WritableContent { +class DLL_PUBLIC Stream : public SourceObject, public WritableContent { public: template Stream(const X &... x) : SourceObject(x...) { } @@ -21,7 +22,7 @@ class Stream : public SourceObject, public WritableContent { static size_t write(std::ostream * os, const char * data, size_t len); }; typedef boost::intrusive_ptr StreamPtr; -typedef AdHoc::Factory StreamFactory; +typedef AdHoc::Factory StreamFactory; #endif diff --git a/project2/common/task.cpp b/project2/common/task.cpp index f77d518..54291f2 100644 --- a/project2/common/task.cpp +++ b/project2/common/task.cpp @@ -16,5 +16,5 @@ Task::~Task() { } -INSTANTIATEFACTORY(Task, ScriptNodePtr); +INSTANTIATEFACTORY(Task, const ScriptNode *); diff --git a/project2/common/task.h b/project2/common/task.h index 9a9548f..4b31809 100644 --- a/project2/common/task.h +++ b/project2/common/task.h @@ -3,16 +3,17 @@ #include "sourceObject.h" #include "execContext.h" +#include /// Base class for Project2 components that perform some specific task -class Task : public virtual SourceObject { +class DLL_PUBLIC Task : public virtual SourceObject { public: Task(ScriptNodePtr p); Task(const std::string & name); virtual ~Task(); virtual void execute(ExecContext *) const = 0; }; -typedef AdHoc::Factory TaskFactory; +typedef AdHoc::Factory TaskFactory; #endif diff --git a/project2/common/taskHost.h b/project2/common/taskHost.h index 84c04c9..ed9bc1b 100644 --- a/project2/common/taskHost.h +++ b/project2/common/taskHost.h @@ -5,8 +5,9 @@ #include "checkHost.h" #include "iHaveSubTasks.h" #include "commonObjects.h" +#include -class TaskHost : public IHaveSubTasks, virtual public CheckHost, virtual public CommonObjects { +class DLL_PUBLIC TaskHost : public IHaveSubTasks, virtual public CheckHost, virtual public CommonObjects { protected: TaskHost(ScriptNodePtr script); virtual ~TaskHost(); diff --git a/project2/common/test.cpp b/project2/common/test.cpp index db7514d..e0e731e 100644 --- a/project2/common/test.cpp +++ b/project2/common/test.cpp @@ -2,7 +2,7 @@ #include Test::Test(ScriptNodePtr s) : - SourceObject(s) + SourceObject(s.get()) { } @@ -11,5 +11,5 @@ Test::reset() const { } -INSTANTIATEFACTORY(Test, ScriptNodePtr); +INSTANTIATEFACTORY(Test, const ScriptNode *); diff --git a/project2/common/test.h b/project2/common/test.h index b821844..edeb22f 100644 --- a/project2/common/test.h +++ b/project2/common/test.h @@ -3,16 +3,17 @@ #include "sourceObject.h" #include "scripts.h" +#include class ExecContext; -class Test : public virtual SourceObject { +class DLL_PUBLIC Test : public virtual SourceObject { public: Test(ScriptNodePtr); virtual bool passes(ExecContext *) const = 0; virtual void reset() const; }; typedef boost::intrusive_ptr TestPtr; -typedef AdHoc::Factory TestFactory; +typedef AdHoc::Factory TestFactory; #endif diff --git a/project2/common/transform.cpp b/project2/common/transform.cpp index 6b44da0..7be475f 100644 --- a/project2/common/transform.cpp +++ b/project2/common/transform.cpp @@ -11,11 +11,11 @@ class TransformTargetStorer : public Storer { transformSource(ts) { } - boost::intrusive_ptr create(ScriptNodePtr p) const + boost::intrusive_ptr create(const ScriptNode * p) const { return TransformTargetFactory::createNew(p->get_name(), p, Scripted); } - bool save(boost::intrusive_ptr o, ScriptNodePtr s) + bool save(boost::intrusive_ptr o, const ScriptNode * s) { TransformChainLinkPtr O = boost::dynamic_pointer_cast(o); if (O) { @@ -107,5 +107,5 @@ class TransformStaticContentToStdStream : public TransformImpl #include #include "range.h" +#include class ExecContext; -class TransformChainLink : public virtual IntrusivePtrBase { +class DLL_PUBLIC TransformChainLink : public virtual IntrusivePtrBase { public: virtual ~TransformChainLink() = 0; }; @@ -20,7 +21,7 @@ class Transform; typedef boost::intrusive_ptr TransformPtr; typedef std::map Targets; -class TransformSource : public TransformChainLink { +class DLL_PUBLIC TransformSource : public TransformChainLink { public: TransformSource(); TransformSource(ScriptNodePtr, ObjectSource); @@ -43,7 +44,7 @@ class SourceOf : public virtual TransformSource { virtual operator const X * () const = 0; }; -class Transform : public virtual IntrusivePtrBase { +class DLL_PUBLIC Transform : public virtual IntrusivePtrBase { public: virtual void transform(const TransformSource * src, TransformChainLink * dest, ExecContext *) const = 0; virtual bool canTransform(const TransformSource * src, TransformChainLink * dest) const = 0; @@ -53,7 +54,7 @@ class Transform : public virtual IntrusivePtrBase { typedef AdHoc::Factory TransformFactory; #define DECLARE_TRANSFORM(T) NAMEDFACTORY(#T, T, TransformFactory) -typedef AdHoc::Factory TransformTargetFactory; +typedef AdHoc::Factory TransformTargetFactory; #define DECLARE_TRANSFORMTARGET(N, T) NAMEDFACTORY(N, T, TransformTargetFactory) template @@ -70,7 +71,7 @@ class TransformImpl : public Transform { } }; -class WritableContent { +class DLL_PUBLIC WritableContent { public: enum Class { ClassPlain = 1, @@ -86,7 +87,7 @@ class WritableContent { virtual void writeTo(std::ostream &, const std::string & encoding, ExecContext *) const = 0; }; -class StaticContent { +class DLL_PUBLIC StaticContent { public: virtual Glib::ustring getContentType() const = 0; virtual Glib::ustring getEncoding() const = 0; diff --git a/project2/common/variableType.h b/project2/common/variableType.h index f2a6890..b395a41 100644 --- a/project2/common/variableType.h +++ b/project2/common/variableType.h @@ -7,6 +7,7 @@ #include #include #include +#include enum VT_typeID { DefaultType, @@ -29,10 +30,10 @@ class Null { bool operator==(const Null &) const { return true; } }; -std::basic_ostream & operator<<(std::basic_ostream &, const Null &); -std::basic_ostream & operator<<(std::basic_ostream &, const Null &); +DLL_PUBLIC std::basic_ostream & operator<<(std::basic_ostream &, const Null &); +DLL_PUBLIC std::basic_ostream & operator<<(std::basic_ostream &, const Null &); -class Boolean { +class DLL_PUBLIC Boolean { public: Boolean(bool v); bool operator<(const Boolean &) const; @@ -40,8 +41,8 @@ class Boolean { bool value; }; -std::basic_ostream & operator<<(std::basic_ostream &, const Boolean &); -std::basic_ostream & operator<<(std::basic_ostream &, const Boolean &); +DLL_PUBLIC std::basic_ostream & operator<<(std::basic_ostream &, const Boolean &); +DLL_PUBLIC std::basic_ostream & operator<<(std::basic_ostream &, const Boolean &); typedef boost::variant< // Other @@ -57,7 +58,7 @@ typedef boost::variant< boost::posix_time::ptime > _VT; -class VariableType : public _VT { +class DLL_PUBLIC VariableType : public _VT { public: VariableType(const unsigned char * const & t); VariableType(const char * const & t); diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp index 526f90c..a71ca85 100644 --- a/project2/common/variables.cpp +++ b/project2/common/variables.cpp @@ -116,5 +116,5 @@ Variable::fromScriptNode(ScriptNodePtr p) return p->variable(); } -INSTANTIATEFACTORY(VariableImpl, ScriptNodePtr); +INSTANTIATEFACTORY(VariableImpl, const ScriptNode *); diff --git a/project2/common/variables.h b/project2/common/variables.h index 89aeeaf..c17269a 100644 --- a/project2/common/variables.h +++ b/project2/common/variables.h @@ -9,11 +9,12 @@ #include "scripts.h" #include "variableType.h" #include +#include class ExecContext; /// Base class for Project2 variable accessors -class VariableImpl : public IntrusivePtrBase { +class DLL_PUBLIC VariableImpl : public IntrusivePtrBase { public: virtual VariableType value(ExecContext *) const = 0; @@ -21,7 +22,7 @@ class VariableImpl : public IntrusivePtrBase { virtual ~VariableImpl() = default; }; -class Variable { +class DLL_PUBLIC Variable { public: typedef boost::intrusive_ptr VariableImplPtr; @@ -43,7 +44,7 @@ class Variable { }; /// Base class for variables whose content is dynamic -class VariableImplDyn : public VariableImpl { +class DLL_PUBLIC VariableImplDyn : public VariableImpl { public: VariableImplDyn(ScriptNodePtr e); virtual VariableType value(ExecContext *) const = 0; @@ -53,7 +54,7 @@ class VariableImplDyn : public VariableImpl { }; /// Base class to create variables -typedef AdHoc::Factory VariableFactory; +typedef AdHoc::Factory VariableFactory; #endif diff --git a/project2/common/variables/literal.h b/project2/common/variables/literal.h index 8c120b6..0f743e8 100644 --- a/project2/common/variables/literal.h +++ b/project2/common/variables/literal.h @@ -3,8 +3,9 @@ #include "../variables.h" #include +#include -class VariableLiteral : public VariableImpl { +class DLL_PUBLIC VariableLiteral : public VariableImpl { public: VariableLiteral(const Glib::ustring & src, const VT_typeID format = DefaultType); VariableLiteral(ScriptNodePtr); diff --git a/project2/common/view.cpp b/project2/common/view.cpp index 5ab8f0a..d5bd00f 100644 --- a/project2/common/view.cpp +++ b/project2/common/view.cpp @@ -3,7 +3,7 @@ #include View::View(ScriptNodePtr p) : - SourceObject(p) + SourceObject(p.get()) { } @@ -11,5 +11,5 @@ View::~View() { } -INSTANTIATEFACTORY(View, ScriptNodePtr); +INSTANTIATEFACTORY(View, const ScriptNode *); diff --git a/project2/common/view.h b/project2/common/view.h index fa0f37b..1225f11 100644 --- a/project2/common/view.h +++ b/project2/common/view.h @@ -3,20 +3,21 @@ #include "sourceObject.h" #include "scriptStorage.h" +#include class MultiRowSetPresenter; class ExecContext; SimpleMessageException(EmptyRequiredRows); /// Base class for Project2 components that output data -class View : public virtual SourceObject { +class DLL_PUBLIC View : public virtual SourceObject { public: View(ScriptNodePtr); virtual ~View(); virtual void execute(const MultiRowSetPresenter *, ExecContext *) const = 0; }; -typedef AdHoc::Factory ViewFactory; +typedef AdHoc::Factory ViewFactory; #endif diff --git a/project2/common/viewHost.h b/project2/common/viewHost.h index 09196f3..4405a1a 100644 --- a/project2/common/viewHost.h +++ b/project2/common/viewHost.h @@ -5,9 +5,10 @@ #include "presenter.h" #include "checkHost.h" #include +#include #include "commonObjects.h" -class ViewHost : virtual public CheckHost, virtual public CommonObjects { +class DLL_PUBLIC ViewHost : virtual public CheckHost, virtual public CommonObjects { public: ViewHost(ScriptNodePtr script); ~ViewHost(); diff --git a/project2/daemon/lib/daemon.h b/project2/daemon/lib/daemon.h index 261d2f0..fb850b7 100644 --- a/project2/daemon/lib/daemon.h +++ b/project2/daemon/lib/daemon.h @@ -4,8 +4,9 @@ #include #include #include +#include -class Daemon : public IntrusivePtrBase { +class DLL_PUBLIC Daemon : public IntrusivePtrBase { public: Daemon(); virtual ~Daemon(); diff --git a/project2/files/fsRows.cpp b/project2/files/fsRows.cpp index b0a2279..445f073 100644 --- a/project2/files/fsRows.cpp +++ b/project2/files/fsRows.cpp @@ -238,6 +238,6 @@ FsRows::SearchState::fileType() const throw NotSupported(__PRETTY_FUNCTION__); } -INSTANTIATEFACTORY(FsRows::SpecBase, ScriptNodePtr); +INSTANTIATEFACTORY(FsRows::SpecBase, const ScriptNode *); INSTANTIATEFACTORY(FsRows::SpecBase, const Glib::ustring &); diff --git a/project2/files/fsRows.h b/project2/files/fsRows.h index 897f274..53df49e 100644 --- a/project2/files/fsRows.h +++ b/project2/files/fsRows.h @@ -26,7 +26,7 @@ class FsRows : public RowSet { const struct stat & curStat(const SearchState * fs) const; }; typedef boost::intrusive_ptr SpecBasePtr; - typedef AdHoc::Factory SpecBaseFactory; + typedef AdHoc::Factory SpecBaseFactory; typedef AdHoc::Factory SpecBaseStringFactory; typedef ANONSTORAGEOF(SpecBase) SpecBases; typedef std::list SpecSpec; diff --git a/project2/files/optionsSource.h b/project2/files/optionsSource.h index a6d1cd1..14bab77 100644 --- a/project2/files/optionsSource.h +++ b/project2/files/optionsSource.h @@ -4,15 +4,16 @@ #include "../common/optionsSource.h" #include "../common/options.h" #include +#include class FileOptions; typedef boost::shared_ptr FileOptionsPtr; -class FileOptions : public OptionsSource { +class DLL_PUBLIC FileOptions : public OptionsSource { public: FileOptions(const boost::filesystem::path & file); - void loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & platform) const; + void loadInto(const ConfigConsumer & consume, const Options::CurrentPlatform & platform) const override; boost::posix_time::ptime modifiedTime() const override; INITOPTIONS; diff --git a/project2/files/presenterCache.cpp b/project2/files/presenterCache.cpp index 9651c20..ec79a0f 100644 --- a/project2/files/presenterCache.cpp +++ b/project2/files/presenterCache.cpp @@ -87,7 +87,7 @@ class FilePresenterCache : public PresenterCache { FilePresenterCache(ScriptNodePtr s) : PresenterCache(s), - idProvider(VariableFactory::createNew(Provider, s)) { + idProvider(VariableFactory::createNew(Provider, s.get())) { } ~FilePresenterCache() { diff --git a/project2/ice/buildComms.cpp b/project2/ice/buildComms.cpp index 5bf80e7..49e58c8 100644 --- a/project2/ice/buildComms.cpp +++ b/project2/ice/buildComms.cpp @@ -33,7 +33,7 @@ BuildComms::Count(const boost::filesystem::path & in) const unsigned int BuildComms::Build(const boost::filesystem::path & in, const boost::filesystem::path & out) const { - const auto slicecmd = stringbf("%s --output-dir %s %s", slice2cpp, out.parent_path(), in); + const auto slicecmd = stringbf("%s --output-dir %s --dll-export JAM_DLL_PUBLIC %s", slice2cpp, out.parent_path(), in); Logger()->messagebf(LOG_DEBUG, "%s: slice command: %s", __PRETTY_FUNCTION__, slicecmd); if (system(slicecmd.c_str())) { throw std::runtime_error("slice2cpp failed"); diff --git a/project2/ice/iceBase.h b/project2/ice/iceBase.h index 0a59416..5547342 100644 --- a/project2/ice/iceBase.h +++ b/project2/ice/iceBase.h @@ -5,8 +5,9 @@ #include #include "iceCompile.h" #include +#include -class IceBase { +class DLL_PUBLIC IceBase { public: typedef boost::tuple LibCompile; typedef boost::variant LibPromise; diff --git a/project2/ice/iceClient.h b/project2/ice/iceClient.h index 1d198f1..7d1d5e1 100644 --- a/project2/ice/iceClient.h +++ b/project2/ice/iceClient.h @@ -4,8 +4,9 @@ #include #include #include "iceDataSource.h" +#include -class IceClientBase { +class DLL_PUBLIC IceClientBase { public: IceClientBase(ScriptNodePtr p); diff --git a/project2/ice/iceCompile.cpp b/project2/ice/iceCompile.cpp index 9eb5cf5..3701c8f 100644 --- a/project2/ice/iceCompile.cpp +++ b/project2/ice/iceCompile.cpp @@ -102,7 +102,7 @@ IceCompile::Compile(const fs::path & in, const fs::path & out) if (components == 0) return; const auto compile = stringbf( - "%s %s -o %s -x c++ -c -I %s -I %s -I /usr/include/adhocutil -I %s -I %s -I %s `pkg-config --cflags glibmm-2.4` %s", + "%s %s -o %s -x c++ -c -fvisibility=hidden -I %s -I %s -I /usr/include/adhocutil -I %s -I %s -I %s `pkg-config --cflags glibmm-2.4` %s", cxx, cxxopts, out, tmpdir, slicerheaderdir, headerdir / "common", diff --git a/project2/ice/iceConvert.h b/project2/ice/iceConvert.h index 93e531c..38b07d9 100644 --- a/project2/ice/iceConvert.h +++ b/project2/ice/iceConvert.h @@ -4,16 +4,17 @@ #include #include #include +#include template -class IceConvert { +class DLL_PUBLIC IceConvert { public: static IceType FromVariable(const VariableType &); static VariableType ToVariable(const IceType &); }; template -class IceConvert> { +class DLL_PUBLIC IceConvert> { public: static IceUtil::Optional FromVariable(const VariableType & v) { diff --git a/project2/ice/iceDaemon.h b/project2/ice/iceDaemon.h index 41343ec..e61a2b7 100644 --- a/project2/ice/iceDaemon.h +++ b/project2/ice/iceDaemon.h @@ -4,8 +4,9 @@ #include #include "iceModule.h" #include "iceBase.h" +#include -class IceDaemon : public Daemon, IceBase { +class DLL_PUBLIC IceDaemon : public Daemon, IceBase { public: IceDaemon(int & argc, char ** argv); virtual ~IceDaemon(); diff --git a/project2/ice/iceDataSource.h b/project2/ice/iceDataSource.h index 715f27b..a18efc6 100644 --- a/project2/ice/iceDataSource.h +++ b/project2/ice/iceDataSource.h @@ -6,8 +6,9 @@ #include #include #include "iceBase.h" +#include -class IceDataSource : public DataSource, IceBase { +class DLL_PUBLIC IceDataSource : public DataSource, IceBase { public: INITOPTIONS; diff --git a/project2/ice/iceModule.h b/project2/ice/iceModule.h index 49aa63b..6e55e8a 100644 --- a/project2/ice/iceModule.h +++ b/project2/ice/iceModule.h @@ -10,11 +10,12 @@ #include #include "iceConvert.h" #include +#include typedef std::map ParamMap; class IceDaemon; -class IceDaemonModule : virtual public ::Ice::Object { +class DLL_PUBLIC IceDaemonModule : virtual public ::Ice::Object { public: void add(Ice::ObjectAdapterPtr, Ice::CommunicatorPtr); void remove(Ice::ObjectAdapterPtr, Ice::CommunicatorPtr); diff --git a/project2/ice/iceRows.h b/project2/ice/iceRows.h index 3ac2019..dded0db 100644 --- a/project2/ice/iceRows.h +++ b/project2/ice/iceRows.h @@ -6,10 +6,11 @@ #include "iceClient.h" #include #include +#include class IceRowState; -class RowProcSerializer : public Slicer::Serializer { +class DLL_PUBLIC RowProcSerializer : public Slicer::Serializer { public: RowProcSerializer(ExecContext *, const RowProcessorCallback &); diff --git a/project2/ice/iceboxDaemon.cpp b/project2/ice/iceboxDaemon.cpp index 8aa3582..0e27303 100644 --- a/project2/ice/iceboxDaemon.cpp +++ b/project2/ice/iceboxDaemon.cpp @@ -66,6 +66,7 @@ DECLARE_OPTIONS(IceBoxDaemon, "Project2 IceBox options") END_OPTIONS(IceBoxDaemon); extern "C" { + DLL_PUBLIC IceBox::Service * createProject2Daemon(Ice::CommunicatorPtr ic) { diff --git a/project2/ice/slice2Common.h b/project2/ice/slice2Common.h index 8ea21d0..ec1b35c 100644 --- a/project2/ice/slice2Common.h +++ b/project2/ice/slice2Common.h @@ -2,8 +2,9 @@ #define SLICE2COMMON_H #include +#include -class Slice2Common : public Slice::ParserVisitor { +class DLL_PUBLIC Slice2Common : public Slice::ParserVisitor { public: Slice2Common(FILE * c); diff --git a/project2/ice/sliceCompile.h b/project2/ice/sliceCompile.h index d8e8e32..db4127b 100644 --- a/project2/ice/sliceCompile.h +++ b/project2/ice/sliceCompile.h @@ -5,8 +5,9 @@ #include #include #include +#include -class SliceCompile : public IceCompile { +class DLL_PUBLIC SliceCompile : public IceCompile { public: SliceCompile(const boost::filesystem::path & slice, const IceCompile::Deps & dep); diff --git a/project2/ice/unittests/conversions.cpp b/project2/ice/unittests/conversions.cpp index e6be3f8..546e922 100644 --- a/project2/ice/unittests/conversions.cpp +++ b/project2/ice/unittests/conversions.cpp @@ -3,6 +3,7 @@ #include namespace Slicer { + DLL_PUBLIC boost::posix_time::ptime dateTimeToPTime(const UnitTestComplex::DatePtr & dt) { @@ -12,6 +13,7 @@ namespace Slicer { boost::posix_time::time_duration(dt->hours, dt->minutes, dt->seconds)); } + DLL_PUBLIC UnitTestComplex::DatePtr ptimeToDateTime(const boost::posix_time::ptime & pt) { @@ -27,6 +29,7 @@ namespace Slicer { } template<> +DLL_PUBLIC ::UnitTestComplex::DatePtr IceConvert< ::UnitTestComplex::DatePtr >::FromVariable(const VariableType & vt) { @@ -35,6 +38,7 @@ IceConvert< ::UnitTestComplex::DatePtr >::FromVariable(const VariableType & vt) } template<> +DLL_PUBLIC VariableType IceConvert< ::UnitTestComplex::DatePtr >::ToVariable(const ::UnitTestComplex::DatePtr & d) { diff --git a/project2/url/curlHelper.h b/project2/url/curlHelper.h index d56173c..ff1947b 100644 --- a/project2/url/curlHelper.h +++ b/project2/url/curlHelper.h @@ -3,9 +3,10 @@ #include "variables.h" #include +#include /// Project2 helper component to provide common access to remote resources via libcurl -class CurlHelper { +class DLL_PUBLIC CurlHelper { public: CurlHelper(); virtual ~CurlHelper(); @@ -18,7 +19,7 @@ class CurlHelper { }; /// Project2 helper component to configure CurlHelper from variables -class VariableCurlHelper : public CurlHelper { +class DLL_PUBLIC VariableCurlHelper : public CurlHelper { public: VariableCurlHelper(ScriptNodePtr p); ~VariableCurlHelper(); diff --git a/project2/ut/testAppInstance.h b/project2/ut/testAppInstance.h index aa52227..1c82a90 100644 --- a/project2/ut/testAppInstance.h +++ b/project2/ut/testAppInstance.h @@ -3,8 +3,9 @@ #include #include +#include -class TestAppInstance : public AppInstance, public ExecContext { +class DLL_PUBLIC TestAppInstance : public AppInstance, public ExecContext { public: VariableType getParameter(const VariableType & key) const override; SessionPtr getSession() const override; diff --git a/project2/ut/testOptionsSource.h b/project2/ut/testOptionsSource.h index 3d0e046..c293a4b 100644 --- a/project2/ut/testOptionsSource.h +++ b/project2/ut/testOptionsSource.h @@ -2,8 +2,9 @@ #define P2_TEST_OPTIONSSOURCE_H #include +#include -class TestOptionsSource : public OptionsSource { +class DLL_PUBLIC TestOptionsSource : public OptionsSource { public: typedef std::list> Opts; diff --git a/project2/ut/testPresenter.h b/project2/ut/testPresenter.h index 74e5e0d..ac36bfa 100644 --- a/project2/ut/testPresenter.h +++ b/project2/ut/testPresenter.h @@ -5,10 +5,11 @@ #include #include #include +#include typedef std::vector PresenterData; -class TestPresenter : public Presenter { +class DLL_PUBLIC TestPresenter : public Presenter { public: TestPresenter(); @@ -32,9 +33,9 @@ class TestPresenter : public Presenter { }; namespace std { - bool operator==(const PresenterData &, const boost::filesystem::path &); - std::ostream & operator<<(std::ostream & s, const PresenterData & v); - std::istream & operator>>(std::istream & s, PresenterData & v); + DLL_PUBLIC bool operator==(const PresenterData &, const boost::filesystem::path &); + DLL_PUBLIC std::ostream & operator<<(std::ostream & s, const PresenterData & v); + DLL_PUBLIC std::istream & operator>>(std::istream & s, PresenterData & v); } #endif diff --git a/project2/ut/testScriptHost.h b/project2/ut/testScriptHost.h index c838f9c..816d54c 100644 --- a/project2/ut/testScriptHost.h +++ b/project2/ut/testScriptHost.h @@ -4,8 +4,9 @@ #include #include #include "testPresenter.h" +#include -class TestScriptHost : public TaskHost, public ViewHost { +class DLL_PUBLIC TestScriptHost : public TaskHost, public ViewHost { public: TestScriptHost(ScriptReaderPtr script); ~TestScriptHost(); diff --git a/project2/ut/testScriptNode.h b/project2/ut/testScriptNode.h index d85f6db..bfa8bb2 100644 --- a/project2/ut/testScriptNode.h +++ b/project2/ut/testScriptNode.h @@ -2,8 +2,9 @@ #define TESTSCRIPTNODE_H #include +#include -class TestScriptNode : public ScriptNode { +class DLL_PUBLIC TestScriptNode : public ScriptNode { public: typedef std::map Vars; diff --git a/project2/xml/transformHtml.h b/project2/xml/transformHtml.h index b8fa82e..0cb3b93 100644 --- a/project2/xml/transformHtml.h +++ b/project2/xml/transformHtml.h @@ -3,8 +3,9 @@ #include "transform.h" #include +#include -class HtmlDocument : public SourceOf, public WritableContent, public SourceOf { +class DLL_PUBLIC HtmlDocument : public SourceOf, public WritableContent, public SourceOf { public: HtmlDocument(ScriptNodePtr, ObjectSource); ~HtmlDocument(); diff --git a/project2/xml/transformText.h b/project2/xml/transformText.h index 57e19f9..bba45f0 100644 --- a/project2/xml/transformText.h +++ b/project2/xml/transformText.h @@ -4,8 +4,9 @@ #include "transform.h" #include #include +#include -class TextDocument : public SourceOf, public WritableContent, public SourceOf { +class DLL_PUBLIC TextDocument : public SourceOf, public WritableContent, public SourceOf { public: TextDocument(ScriptNodePtr, ObjectSource); Glib::ustring doc; diff --git a/project2/xml/xmlCache.cpp b/project2/xml/xmlCache.cpp index 5e3c66c..343d5e6 100644 --- a/project2/xml/xmlCache.cpp +++ b/project2/xml/xmlCache.cpp @@ -85,7 +85,7 @@ boost::filesystem::path XmlCache::Store; std::string XmlCache::FileName; time_t XmlCache::CacheLife; -class CustomXmlCacheFactory : public AdHoc::Factory::For, public LifeCycle { +class CustomXmlCacheFactory : public AdHoc::Factory::For, public LifeCycle { public: void onIdle() override { diff --git a/project2/xml/xmlPresenter.cpp b/project2/xml/xmlPresenter.cpp index ec3d2f3..88b5108 100644 --- a/project2/xml/xmlPresenter.cpp +++ b/project2/xml/xmlPresenter.cpp @@ -275,5 +275,5 @@ XmlDocMutator::XmlDocMutator(ScriptNodePtr) { } -INSTANTIATEFACTORY(XmlDocMutator, ScriptNodePtr); +INSTANTIATEFACTORY(XmlDocMutator, const ScriptNode *); diff --git a/project2/xml/xmlPresenter.h b/project2/xml/xmlPresenter.h index 996ce9b..1410a34 100644 --- a/project2/xml/xmlPresenter.h +++ b/project2/xml/xmlPresenter.h @@ -6,6 +6,7 @@ #include "options.h" #include "variables.h" #include +#include namespace xmlpp { class Document; @@ -18,9 +19,9 @@ class XmlDocMutator : public IntrusivePtrBase { virtual void mutateElement(xmlpp::Element *) const = 0; }; typedef boost::intrusive_ptr XmlDocMutatorPtr; -typedef AdHoc::Factory XmlDocMutatorFactory; +typedef AdHoc::Factory XmlDocMutatorFactory; -class XmlPresenter : public Presenter, public ContentPresenter, public SourceOf, public SourceOf, public SourceOf >, public WritableContent, public SourceOf { +class DLL_PUBLIC XmlPresenter : public Presenter, public ContentPresenter, public SourceOf, public SourceOf, public SourceOf >, public WritableContent, public SourceOf { public: typedef boost::shared_ptr XmlDocumentPtr; XmlPresenter(const Glib::ustring & responseRootNodeName, const Glib::ustring & responseStyle, const Glib::ustring & contentType); diff --git a/project2/xml/xmlScriptParser.h b/project2/xml/xmlScriptParser.h index f596c8d..ae5f3af 100644 --- a/project2/xml/xmlScriptParser.h +++ b/project2/xml/xmlScriptParser.h @@ -10,6 +10,7 @@ #include #include #include +#include class XmlScriptNode : public ScriptNode { public: @@ -32,7 +33,7 @@ class XmlScriptNode : public ScriptNode { mutable boost::shared_ptr childrenCache; }; -class XmlScriptParser : public xmlpp::DomParser, public ScriptReader { +class DLL_PUBLIC XmlScriptParser : public xmlpp::DomParser, public ScriptReader { public: SimpleMessageException(ParseError); SimpleMessageExceptionBase(NotReadable, ParseError); -- cgit v1.2.3