Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7ed725a0d |
@@ -96,28 +96,17 @@
|
||||
<ClCompile Include="Connector\Database\Model\Card\ModelCardDatabase.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Account\AccountBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Account\GetAccounts.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetDocumentInfo.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetDocumentState.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationName.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationVersion.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Send.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\SendBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GoAway.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\SayHi.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TestBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.cpp" />
|
||||
<ClCompile Include="Connector\Interface\ConnectorMenu.cpp" />
|
||||
<ClCompile Include="Connector\Interface\ConnectorPalette.cpp" />
|
||||
</ItemGroup>
|
||||
@@ -128,28 +117,17 @@
|
||||
<ClInclude Include="Connector\Event\ConnectorEventID.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Account\AccountBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Account\GetAccounts.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetDocumentInfo.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetDocumentState.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationName.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationVersion.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Send.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\SendBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GoAway.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\SayHi.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TestBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.h" />
|
||||
<ClInclude Include="Connector\Interface\ConnectorMenu.h" />
|
||||
<ClInclude Include="Connector\Interface\ConnectorPalette.h" />
|
||||
<ClInclude Include="Connector\Version.h" />
|
||||
@@ -586,7 +564,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<PreprocessorDefinitions>TESTING_MODE;DEBUG;ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_STLP_DONT_FORCE_MSVC_LIB_NAME;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_STLP_DONT_FORCE_MSVC_LIB_NAME;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
@@ -615,7 +593,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
|
||||
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STATD.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STATD.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>msvcrt.lib</IgnoreSpecificDefaultLibraries>
|
||||
@@ -773,7 +751,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
@@ -803,7 +781,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
|
||||
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STAT.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;msvcrt.lib;msvcprt.lib;IPHLPAPI.lib;Wininet.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STAT.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;msvcrt.lib;msvcprt.lib;IPHLPAPI.lib;Wininet.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(HEADER_PATH_5)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
|
||||
@@ -38,24 +38,6 @@
|
||||
<Filter Include="Connector\Database\Model\Card">
|
||||
<UniqueIdentifier>{85935d00-16ac-466a-a614-ad9ea802bffa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Config\Arg">
|
||||
<UniqueIdentifier>{6a2f1f18-a554-4546-bba3-314d5f2ec9f9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Base\Arg">
|
||||
<UniqueIdentifier>{d74446ad-e141-48ac-9fa0-8b82279bbdbf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Test">
|
||||
<UniqueIdentifier>{9976ca16-8f99-44a2-b596-b81df82d847a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Test\Arg">
|
||||
<UniqueIdentifier>{1656a0df-aa39-4f41-860f-7b278b31784a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Send">
|
||||
<UniqueIdentifier>{2b87cf11-87cd-435f-ab24-42170c2e657e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Send\Arg">
|
||||
<UniqueIdentifier>{3bc97363-0091-4f84-a5f7-085193bad850}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RFIX.win\Connector.rc2">
|
||||
@@ -98,6 +80,9 @@
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetConfig.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClCompile>
|
||||
@@ -107,6 +92,9 @@
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClCompile>
|
||||
@@ -125,43 +113,6 @@
|
||||
<ClCompile Include="Connector\Database\Model\Card\ModelCardDatabase.cpp">
|
||||
<Filter>Connector\Database\Model\Card</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config\Arg</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base\Arg</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GoAway.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\SayHi.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TestBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test\Arg</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\SendBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Send.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send\Arg</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connector\ConnectorResource.h">
|
||||
@@ -185,6 +136,9 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClInclude>
|
||||
@@ -194,6 +148,9 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
|
||||
</ClInclude>
|
||||
@@ -218,42 +175,5 @@
|
||||
<ClInclude Include="Connector\Database\Model\Card\ModelCardDatabase.h">
|
||||
<Filter>Connector\Database\Model\Card</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config\Arg</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Base\Arg</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GoAway.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\SayHi.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TestBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test\Arg</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\SendBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Send.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send\Arg</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -22,7 +22,6 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
210CC8832C80E6A300610F58 /* TriggerEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC8812C80E6A300610F58 /* TriggerEvent.cpp */; };
|
||||
213CC39C2B1101F500088049 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2151077C2AEDB9070022CD24 /* Cocoa.framework */; };
|
||||
214B7A372C764BCD00D586C1 /* UpdateConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */; };
|
||||
219F30422C769283009834E9 /* ConfigTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219F30402C769282009834E9 /* ConfigTests.cpp */; };
|
||||
@@ -32,22 +31,10 @@
|
||||
21B67CAD2C77329800FD64FC /* GetSourceApplicationName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CA72C77329800FD64FC /* GetSourceApplicationName.cpp */; };
|
||||
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CA92C77329800FD64FC /* GetSourceApplicationVersion.cpp */; };
|
||||
21B67CB92C774BFA00FD64FC /* GetConnectorVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */; };
|
||||
21B67CBD2C77537C00FD64FC /* DocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */; };
|
||||
21B67CC02C775A0D00FD64FC /* GetDocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */; };
|
||||
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CC22C77649F00FD64FC /* GetDocumentState.cpp */; };
|
||||
21B67CCC2C77670400FD64FC /* ModelCardDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */; };
|
||||
21B67CD92C78C83800FD64FC /* TestBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CD62C78C83800FD64FC /* TestBridge.cpp */; };
|
||||
21B67CDC2C78C88000FD64FC /* SayHi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CDA2C78C87F00FD64FC /* SayHi.cpp */; };
|
||||
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */; };
|
||||
21B67CE72C78D23B00FD64FC /* ConnectorConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */; };
|
||||
21B67CEB2C78D27200FD64FC /* DocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */; };
|
||||
21B67CF12C78D38000FD64FC /* GoAway.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CF02C78D38000FD64FC /* GoAway.cpp */; };
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */; };
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */; };
|
||||
21D0BD672C89D7410077E104 /* AccountTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD642C89D7400077E104 /* AccountTests.cpp */; };
|
||||
21D0BD6A2C8A0DB40077E104 /* GetIsDevMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */; };
|
||||
21D0BD8E2C8EE4490077E104 /* Send.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD8D2C8EE4490077E104 /* Send.cpp */; };
|
||||
21D0BD972C8F13F30077E104 /* GetSendFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */; };
|
||||
21D0BD9B2C8F154B0077E104 /* SendFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD982C8F154B0077E104 /* SendFilter.cpp */; };
|
||||
21D1E9AD2BF14AF200957EAA /* BIMData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9152BF14AEC00957EAA /* BIMData.framework */; };
|
||||
21D1E9AE2BF14AF200957EAA /* TeamworkPortalServerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9162BF14AEC00957EAA /* TeamworkPortalServerClient.framework */; };
|
||||
21D1E9AF2BF14AF200957EAA /* GDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9172BF14AEC00957EAA /* GDL.framework */; };
|
||||
@@ -209,6 +196,7 @@
|
||||
21F69F8D2C70D7EE008B6A06 /* GetAccounts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F8B2C70D7EE008B6A06 /* GetAccounts.cpp */; };
|
||||
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FB42C762EF0008B6A06 /* ConfigBridge.cpp */; };
|
||||
21F69FBC2C762EF0008B6A06 /* GetConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FB62C762EF0008B6A06 /* GetConfig.cpp */; };
|
||||
21F69FC22C7632B7008B6A06 /* ConnectorConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FC02C7632B7008B6A06 /* ConnectorConfig.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -271,13 +259,11 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
210CC8812C80E6A300610F58 /* TriggerEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerEvent.cpp; sourceTree = "<group>"; };
|
||||
210CC8822C80E6A300610F58 /* TriggerEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerEvent.h; sourceTree = "<group>"; };
|
||||
213CC3A52B1101F500088049 /* Speckle Connector.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Speckle Connector.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2151077C2AEDB9070022CD24 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
2161FD902BF2600C006D9527 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
219388682C4E5DE2002A0180 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.vwlibrary"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
219F30402C769282009834E9 /* ConfigTests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = ConfigTests.cpp; sourceTree = "<group>"; };
|
||||
219F30432C7693B6009834E9 /* Connector-AC27-Debug.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Connector-AC27-Debug.xctestplan"; sourceTree = SOURCE_ROOT; };
|
||||
21B67CA52C77329800FD64FC /* BaseBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseBridge.cpp; sourceTree = "<group>"; };
|
||||
@@ -289,6 +275,8 @@
|
||||
21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetConnectorVersion.cpp; sourceTree = "<group>"; };
|
||||
21B67CB82C774BFA00FD64FC /* GetConnectorVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetConnectorVersion.h; sourceTree = "<group>"; };
|
||||
21B67CBA2C774C6500FD64FC /* Version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Version.h; sourceTree = "<group>"; };
|
||||
21B67CBB2C77537C00FD64FC /* DocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentInfo.h; sourceTree = "<group>"; };
|
||||
21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentInfo.cpp; sourceTree = "<group>"; };
|
||||
21B67CBE2C775A0D00FD64FC /* GetDocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetDocumentInfo.h; sourceTree = "<group>"; };
|
||||
21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetDocumentInfo.cpp; sourceTree = "<group>"; };
|
||||
21B67CC12C77649E00FD64FC /* GetDocumentState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetDocumentState.h; sourceTree = "<group>"; };
|
||||
@@ -296,31 +284,6 @@
|
||||
21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModelCardDatabase.cpp; sourceTree = "<group>"; };
|
||||
21B67CC82C77670400FD64FC /* ModelCardDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCardDatabase.h; sourceTree = "<group>"; };
|
||||
21B67CCD2C77694500FD64FC /* Connector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
|
||||
21B67CD62C78C83800FD64FC /* TestBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestBridge.cpp; sourceTree = "<group>"; };
|
||||
21B67CD72C78C83800FD64FC /* TestBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestBridge.h; sourceTree = "<group>"; };
|
||||
21B67CDA2C78C87F00FD64FC /* SayHi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SayHi.cpp; sourceTree = "<group>"; };
|
||||
21B67CDB2C78C87F00FD64FC /* SayHi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SayHi.h; sourceTree = "<group>"; };
|
||||
21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SayHiArg.cpp; sourceTree = "<group>"; };
|
||||
21B67CE12C78D1FB00FD64FC /* SayHiArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SayHiArg.h; sourceTree = "<group>"; };
|
||||
21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectorConfig.cpp; sourceTree = "<group>"; };
|
||||
21B67CE52C78D23B00FD64FC /* ConnectorConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectorConfig.h; sourceTree = "<group>"; };
|
||||
21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentInfo.cpp; sourceTree = "<group>"; };
|
||||
21B67CE92C78D27200FD64FC /* DocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentInfo.h; sourceTree = "<group>"; };
|
||||
21B67CEF2C78D38000FD64FC /* GoAway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoAway.h; sourceTree = "<group>"; };
|
||||
21B67CF02C78D38000FD64FC /* GoAway.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoAway.cpp; sourceTree = "<group>"; };
|
||||
21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetComplexType.cpp; sourceTree = "<group>"; };
|
||||
21B67CF62C78D4DE00FD64FC /* GetComplexType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetComplexType.h; sourceTree = "<group>"; };
|
||||
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendBridge.cpp; sourceTree = "<group>"; };
|
||||
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendBridge.h; sourceTree = "<group>"; };
|
||||
21D0BD642C89D7400077E104 /* AccountTests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = AccountTests.cpp; sourceTree = "<group>"; };
|
||||
21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetIsDevMode.cpp; sourceTree = "<group>"; };
|
||||
21D0BD692C8A0DB40077E104 /* GetIsDevMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetIsDevMode.h; sourceTree = "<group>"; };
|
||||
21D0BD8A2C8EE4490077E104 /* Send.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Send.h; sourceTree = "<group>"; };
|
||||
21D0BD8D2C8EE4490077E104 /* Send.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Send.cpp; sourceTree = "<group>"; };
|
||||
21D0BD952C8F13F30077E104 /* GetSendFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetSendFilters.h; sourceTree = "<group>"; };
|
||||
21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetSendFilters.cpp; sourceTree = "<group>"; };
|
||||
21D0BD982C8F154B0077E104 /* SendFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendFilter.cpp; sourceTree = "<group>"; };
|
||||
21D0BD992C8F154B0077E104 /* SendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendFilter.h; sourceTree = "<group>"; };
|
||||
21D1E9152BF14AEC00957EAA /* BIMData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BIMData.framework; path = "../Archicad 27/Support/Frameworks/BIMData.framework"; sourceTree = "<group>"; };
|
||||
21D1E9162BF14AEC00957EAA /* TeamworkPortalServerClient.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TeamworkPortalServerClient.framework; path = "../Archicad 27/Support/Frameworks/TeamworkPortalServerClient.framework"; sourceTree = "<group>"; };
|
||||
21D1E9172BF14AEC00957EAA /* GDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GDL.framework; path = "../Archicad 27/Support/Frameworks/GDL.framework"; sourceTree = "<group>"; };
|
||||
@@ -498,6 +461,8 @@
|
||||
21F69FB72C762EF0008B6A06 /* GetConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetConfig.h; sourceTree = "<group>"; };
|
||||
21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UpdateConfig.cpp; sourceTree = "<group>"; };
|
||||
21F69FBE2C7630B3008B6A06 /* UpdateConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateConfig.h; sourceTree = "<group>"; };
|
||||
21F69FC02C7632B7008B6A06 /* ConnectorConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectorConfig.cpp; sourceTree = "<group>"; };
|
||||
21F69FC12C7632B7008B6A06 /* ConnectorConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectorConfig.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -679,7 +644,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
213CC3A52B1101F500088049 /* Speckle Connector.bundle */,
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */,
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -888,7 +853,6 @@
|
||||
219F30412C769282009834E9 /* ConnectorTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD642C89D7400077E104 /* AccountTests.cpp */,
|
||||
219F30402C769282009834E9 /* ConfigTests.cpp */,
|
||||
219F30432C7693B6009834E9 /* Connector-AC27-Debug.xctestplan */,
|
||||
);
|
||||
@@ -898,9 +862,10 @@
|
||||
21B67CAB2C77329800FD64FC /* Base */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CEA2C78D27200FD64FC /* Arg */,
|
||||
21B67CA52C77329800FD64FC /* BaseBridge.cpp */,
|
||||
21B67CA62C77329800FD64FC /* BaseBridge.h */,
|
||||
21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */,
|
||||
21B67CBB2C77537C00FD64FC /* DocumentInfo.h */,
|
||||
21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */,
|
||||
21B67CB82C774BFA00FD64FC /* GetConnectorVersion.h */,
|
||||
21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */,
|
||||
@@ -940,74 +905,6 @@
|
||||
path = Database;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CD82C78C83800FD64FC /* Test */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CE22C78D1FB00FD64FC /* Arg */,
|
||||
21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */,
|
||||
21B67CF62C78D4DE00FD64FC /* GetComplexType.h */,
|
||||
21B67CF02C78D38000FD64FC /* GoAway.cpp */,
|
||||
21B67CEF2C78D38000FD64FC /* GoAway.h */,
|
||||
21B67CDA2C78C87F00FD64FC /* SayHi.cpp */,
|
||||
21B67CDB2C78C87F00FD64FC /* SayHi.h */,
|
||||
21B67CD62C78C83800FD64FC /* TestBridge.cpp */,
|
||||
21B67CD72C78C83800FD64FC /* TestBridge.h */,
|
||||
210CC8812C80E6A300610F58 /* TriggerEvent.cpp */,
|
||||
210CC8822C80E6A300610F58 /* TriggerEvent.h */,
|
||||
);
|
||||
path = Test;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CE22C78D1FB00FD64FC /* Arg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */,
|
||||
21B67CE12C78D1FB00FD64FC /* SayHiArg.h */,
|
||||
);
|
||||
path = Arg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CE62C78D23B00FD64FC /* Arg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */,
|
||||
21B67CE52C78D23B00FD64FC /* ConnectorConfig.h */,
|
||||
);
|
||||
path = Arg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CEA2C78D27200FD64FC /* Arg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */,
|
||||
21B67CE92C78D27200FD64FC /* DocumentInfo.h */,
|
||||
);
|
||||
path = Arg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD5D2C89BFEA0077E104 /* Send */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */,
|
||||
21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */,
|
||||
21D0BD952C8F13F30077E104 /* GetSendFilters.h */,
|
||||
21D0BD8D2C8EE4490077E104 /* Send.cpp */,
|
||||
21D0BD8A2C8EE4490077E104 /* Send.h */,
|
||||
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */,
|
||||
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */,
|
||||
);
|
||||
path = Send;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD982C8F154B0077E104 /* SendFilter.cpp */,
|
||||
21D0BD992C8F154B0077E104 /* SendFilter.h */,
|
||||
);
|
||||
path = Arg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D1EA472BF14B6C00957EAA /* Archicad */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1089,8 +986,6 @@
|
||||
21F69F852C70D2C4008B6A06 /* Account */,
|
||||
21B67CAB2C77329800FD64FC /* Base */,
|
||||
21F69FB82C762EF0008B6A06 /* Config */,
|
||||
21D0BD5D2C89BFEA0077E104 /* Send */,
|
||||
21B67CD82C78C83800FD64FC /* Test */,
|
||||
);
|
||||
path = Bridge;
|
||||
sourceTree = "<group>";
|
||||
@@ -1106,13 +1001,12 @@
|
||||
21F69FB82C762EF0008B6A06 /* Config */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CE62C78D23B00FD64FC /* Arg */,
|
||||
21F69FB42C762EF0008B6A06 /* ConfigBridge.cpp */,
|
||||
21F69FB52C762EF0008B6A06 /* ConfigBridge.h */,
|
||||
21F69FC02C7632B7008B6A06 /* ConnectorConfig.cpp */,
|
||||
21F69FC12C7632B7008B6A06 /* ConnectorConfig.h */,
|
||||
21F69FB62C762EF0008B6A06 /* GetConfig.cpp */,
|
||||
21F69FB72C762EF0008B6A06 /* GetConfig.h */,
|
||||
21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */,
|
||||
21D0BD692C8A0DB40077E104 /* GetIsDevMode.h */,
|
||||
21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */,
|
||||
21F69FBE2C7630B3008B6A06 /* UpdateConfig.h */,
|
||||
);
|
||||
@@ -1173,7 +1067,7 @@
|
||||
);
|
||||
name = "Connector-AC27-Test";
|
||||
productName = "Connector-AC27-Test";
|
||||
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */;
|
||||
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -1324,33 +1218,22 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */,
|
||||
21B67CBD2C77537C00FD64FC /* DocumentInfo.cpp in Sources */,
|
||||
21F69FC22C7632B7008B6A06 /* ConnectorConfig.cpp in Sources */,
|
||||
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */,
|
||||
21F69F8A2C70D2C4008B6A06 /* AccountBridge.cpp in Sources */,
|
||||
21D0BD9B2C8F154B0077E104 /* SendFilter.cpp in Sources */,
|
||||
21D0BD8E2C8EE4490077E104 /* Send.cpp in Sources */,
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */,
|
||||
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */,
|
||||
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */,
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */,
|
||||
21D0BD972C8F13F30077E104 /* GetSendFilters.cpp in Sources */,
|
||||
21B67CAC2C77329800FD64FC /* BaseBridge.cpp in Sources */,
|
||||
21D0BD6A2C8A0DB40077E104 /* GetIsDevMode.cpp in Sources */,
|
||||
210CC8832C80E6A300610F58 /* TriggerEvent.cpp in Sources */,
|
||||
21B67CEB2C78D27200FD64FC /* DocumentInfo.cpp in Sources */,
|
||||
21B67CB92C774BFA00FD64FC /* GetConnectorVersion.cpp in Sources */,
|
||||
21B67CD92C78C83800FD64FC /* TestBridge.cpp in Sources */,
|
||||
214B7A372C764BCD00D586C1 /* UpdateConfig.cpp in Sources */,
|
||||
21B67CC02C775A0D00FD64FC /* GetDocumentInfo.cpp in Sources */,
|
||||
21B67CE72C78D23B00FD64FC /* ConnectorConfig.cpp in Sources */,
|
||||
21B67CAD2C77329800FD64FC /* GetSourceApplicationName.cpp in Sources */,
|
||||
21B67CDC2C78C88000FD64FC /* SayHi.cpp in Sources */,
|
||||
21F69F122C677BC0008B6A06 /* ConnectorMenu.cpp in Sources */,
|
||||
21F69F8D2C70D7EE008B6A06 /* GetAccounts.cpp in Sources */,
|
||||
21B67CCC2C77670400FD64FC /* ModelCardDatabase.cpp in Sources */,
|
||||
21F69F132C677BC0008B6A06 /* ConnectorPalette.cpp in Sources */,
|
||||
21F69FBC2C762EF0008B6A06 /* GetConfig.cpp in Sources */,
|
||||
21B67CF12C78D38000FD64FC /* GoAway.cpp in Sources */,
|
||||
21F69F142C677BC0008B6A06 /* Connector.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -1360,7 +1243,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
219F30422C769283009834E9 /* ConfigTests.cpp in Sources */,
|
||||
21D0BD672C89D7410077E104 /* AccountTests.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1451,6 +1333,7 @@
|
||||
"\"$(HEADER_PATH_6)\"",
|
||||
"\"$(HEADER_PATH_8)\"",
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1515,6 +1398,7 @@
|
||||
"\"$(HEADER_PATH_6)\"",
|
||||
"\"$(HEADER_PATH_8)\"",
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1554,7 +1438,6 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
TESTING_MODE,
|
||||
ARCHICAD,
|
||||
AddOn_EXPORTS,
|
||||
"'macintosh=1'",
|
||||
@@ -1625,6 +1508,7 @@
|
||||
"-multiply_defined",
|
||||
suppress,
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1665,7 +1549,6 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
TESTING_MODE,
|
||||
ARCHICAD,
|
||||
AddOn_EXPORTS,
|
||||
"'macintosh=1'",
|
||||
@@ -1733,6 +1616,7 @@
|
||||
"-multiply_defined",
|
||||
suppress,
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1892,7 +1776,7 @@
|
||||
OBJROOT = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PLUGIN_FOLDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
|
||||
PRODUCT_NAME = "$(BASE_NAME)";
|
||||
RESOURCE_EXTENSION = "";
|
||||
REZ_SEARCH_PATHS = (
|
||||
@@ -1919,7 +1803,7 @@
|
||||
suppress,
|
||||
);
|
||||
WORD_SIZE = 64;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
WRAPPER_EXTENSION = vwlibrary;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1998,7 +1882,7 @@
|
||||
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
|
||||
OBJROOT = "";
|
||||
PLUGIN_FOLDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
|
||||
PRODUCT_NAME = "$(BASE_NAME)";
|
||||
RESOURCE_EXTENSION = "";
|
||||
REZ_SEARCH_PATHS = (
|
||||
@@ -2021,7 +1905,7 @@
|
||||
);
|
||||
USE_HEADERMAP = YES;
|
||||
WORD_SIZE = 64;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
WRAPPER_EXTENSION = vwlibrary;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "219F30342C768F0A009834E9"
|
||||
BuildableName = "Connector-AC27-Test.bundle"
|
||||
BuildableName = "Connector-AC27-Test.vwlibrary"
|
||||
BlueprintName = "Connector-AC27-Test"
|
||||
ReferencedContainer = "container:Connector.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "219F30342C768F0A009834E9"
|
||||
BuildableName = "Connector-AC27-Test.bundle"
|
||||
BuildableName = "Connector-AC27-Test.vwlibrary"
|
||||
BlueprintName = "Connector-AC27-Test"
|
||||
ReferencedContainer = "container:Connector.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
@@ -1,34 +1,25 @@
|
||||
#include "Active/File/Directory.h"
|
||||
#include "ConnectorResource.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Interface/ConnectorMenu.h"
|
||||
#include "Interface/ConnectorPalette.h"
|
||||
#include "Speckle/Database/AccountDatabase.h"
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
using namespace active::file;
|
||||
using namespace active::environment;
|
||||
using namespace connector;
|
||||
using namespace connector::database;
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::environment;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
//The Speckle application data/support directory name
|
||||
const char* speckleDataDirName = "Speckle";
|
||||
//The account database name
|
||||
const char* accountDBaseName = "Accounts.db";
|
||||
|
||||
///The Connector addon class
|
||||
class ConnectorInstance : public ConnectorAddon {
|
||||
public:
|
||||
ConnectorInstance(const String& name) : ConnectorAddon{name} {
|
||||
add<ConnectorMenu>();
|
||||
add<ConnectorPalette>();
|
||||
add(std::make_shared<ConnectorMenu>());
|
||||
add(std::make_shared<ConnectorPalette>());
|
||||
}
|
||||
|
||||
// MARK: Functions (const)
|
||||
@@ -37,34 +28,15 @@ namespace {
|
||||
Get the model card database
|
||||
@return The model card database
|
||||
*/
|
||||
const ModelCardDatabase* getModelCardDatabase() const override { return &m_modelCards; }
|
||||
/*!
|
||||
Get the account database
|
||||
@return The account database
|
||||
*/
|
||||
const AccountDatabase* getAccountDatabase() const override;
|
||||
const ModelCardDatabase* getModelCards() const override { return &m_modelCards; }
|
||||
|
||||
private:
|
||||
mutable std::unique_ptr<AccountDatabase> m_account;
|
||||
ModelCardDatabase m_modelCards;
|
||||
};
|
||||
|
||||
///The active addon instance
|
||||
std::unique_ptr<ConnectorAddon> m_addonInstance;
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the speckle application data directory (creating if missing)
|
||||
|
||||
return: The application data directory (nullopt = missing and unable to create)
|
||||
--------------------------------------------------------------------*/
|
||||
Directory::Option getAppDataDirectory() {
|
||||
auto appData = Directory::appData();
|
||||
if (!appData)
|
||||
return std::nullopt;
|
||||
return Directory{*appData, speckleDataDirName, true};
|
||||
} //getAppDataDirectory
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -76,39 +48,13 @@ ConnectorAddon::ConnectorAddon(const speckle::utility::String& name) : Addon{nam
|
||||
} //ConnectorAddon::ConnectorAddon
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the account database
|
||||
|
||||
return: The account database
|
||||
--------------------------------------------------------------------*/
|
||||
const AccountDatabase* ConnectorInstance::getAccountDatabase() const {
|
||||
if (!m_account) {
|
||||
auto speckleDirectory = getAppDataDirectory();
|
||||
if (!speckleDirectory)
|
||||
return nullptr;
|
||||
m_account = std::make_unique<AccountDatabase>(speckleDirectory->getPath() / accountDBaseName);
|
||||
}
|
||||
return m_account.get();
|
||||
} //ConnectorInstance::getAccounts
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get an object representing the connector instance
|
||||
@return The active connector instance (nullptr if no connector is running)
|
||||
--------------------------------------------------------------------*/
|
||||
ConnectorAddon* connector::connector() {
|
||||
return m_addonInstance.get();
|
||||
} //connector::connector
|
||||
|
||||
|
||||
|
||||
#ifdef ARCHICAD
|
||||
/*!
|
||||
The following is the C interface for the plugin to Archicad as specified by the API
|
||||
*/
|
||||
|
||||
#include <ACAPinc.h>
|
||||
#include <APIdefs_Registration.h>
|
||||
#include "ACAPinc.h"
|
||||
#include "APIdefs_Registration.h"
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm that the plugin is able to run in the current environment
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::database {
|
||||
class AccountDatabase;
|
||||
}
|
||||
namespace connector::database {
|
||||
|
||||
class ModelCardDatabase;
|
||||
|
||||
}
|
||||
|
||||
namespace connector {
|
||||
@@ -20,12 +19,7 @@ namespace connector {
|
||||
Get the model card database
|
||||
@return The model card database
|
||||
*/
|
||||
const virtual database::ModelCardDatabase* getModelCardDatabase() const = 0;
|
||||
/*!
|
||||
Get the account database
|
||||
@return The account database
|
||||
*/
|
||||
const virtual speckle::database::AccountDatabase* getAccountDatabase() const = 0;
|
||||
const virtual database::ModelCardDatabase* getModelCards() const = 0;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace {
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"models"},
|
||||
Identity{"model"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Speckle/Database/AccountDatabase.h"
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
using namespace active::container;
|
||||
@@ -21,7 +19,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetAccounts::GetAccounts() : BridgeMethod{"GetAccounts", [&]() {
|
||||
GetAccounts::GetAccounts() : JSBridgeMethod{"GetAccounts", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -31,9 +29,8 @@ GetAccounts::GetAccounts() : BridgeMethod{"GetAccounts", [&]() {
|
||||
|
||||
return: The accounts (empty array when none defined)
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetAccounts::run() const {
|
||||
std::unique_ptr<Cargo> GetAccounts::run(void) const {
|
||||
Vector<Account> accounts;
|
||||
if (auto accountDBase = connector()->getAccountDatabase(); accountDBase != nullptr)
|
||||
accounts = accountDBase->getAccounts();
|
||||
///TODO: Get the accounts here - returning an empty array for testing only
|
||||
return std::make_unique<WrappedValue>(accounts);
|
||||
} //GetAccounts::run
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_ACCOUNTS
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_ACCOUNTS
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetAccounts : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetAccounts : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Get the accounts
|
||||
@return The accounts (empty array when none defined)
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
std::unique_ptr<active::serialise::Cargo> run(void) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace {
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"location"},
|
||||
Identity{"name"},
|
||||
Identity{"id"},
|
||||
Identity{"Location"},
|
||||
Identity{"Name"},
|
||||
Identity{"Id"},
|
||||
};
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
@@ -58,4 +58,4 @@ namespace connector::interfac::browser::bridge {
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
@@ -19,7 +19,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetConnectorVersion::GetConnectorVersion() : BridgeMethod{"GetConnectorVersion", [&]() {
|
||||
GetConnectorVersion::GetConnectorVersion() : JSBridgeMethod{"GetConnectorVersion", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace connector::interfac::browser::bridge {
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetConnectorVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetConnectorVersion : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/GetDocumentInfo.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
@@ -17,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetDocumentInfo::GetDocumentInfo() : BridgeMethod{"GetDocumentInfo", [&]() {
|
||||
GetDocumentInfo::GetDocumentInfo() : JSBridgeMethod{"GetDocumentInfo", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -27,7 +28,7 @@ GetDocumentInfo::GetDocumentInfo() : BridgeMethod{"GetDocumentInfo", [&]() {
|
||||
|
||||
return: The document info
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetDocumentInfo::run() const {
|
||||
std::unique_ptr<Cargo> GetDocumentInfo::run(void) const {
|
||||
///TODO: Get the document info here - returning mocked values for now
|
||||
DocumentInfo docInfo{"Somewhere", "Something", String{active::utility::Guid{true}.operator active::utility::String()}};
|
||||
return std::make_unique<WrappedValue>(docInfo);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_INFO
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_INFO
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the information about the active document
|
||||
*/
|
||||
class GetDocumentInfo : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetDocumentInfo : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Get the document info
|
||||
@return The document info
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
std::unique_ptr<active::serialise::Cargo> run(void) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/GetDocumentState.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
|
||||
using namespace active::container;
|
||||
@@ -18,7 +20,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
|
||||
GetDocumentState::GetDocumentState() : JSBridgeMethod{"GetDocumentState", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,7 +30,7 @@ GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
|
||||
|
||||
return: The document info
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetDocumentState::run() const {
|
||||
std::unique_ptr<Cargo> GetDocumentState::run(void) const {
|
||||
///TODO: Retrieve the model card database from connector()->getModelCards() in future (when implemented)
|
||||
ModelCardDatabase modelCards; //This is just a temp so something can be sent back to the JS for the interim
|
||||
return std::make_unique<WrappedValue>(modelCards);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_STATE
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_STATE
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the information about the active document
|
||||
*/
|
||||
class GetDocumentState : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetDocumentState : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Get the document info
|
||||
@return The document info
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
std::unique_ptr<active::serialise::Cargo> run(void) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSourceApplicationName::GetSourceApplicationName() : BridgeMethod{"GetSourceApplicationName", [&]() {
|
||||
GetSourceApplicationName::GetSourceApplicationName() : JSBridgeMethod{"GetSourceApplicationName", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,7 +28,7 @@ GetSourceApplicationName::GetSourceApplicationName() : BridgeMethod{"GetSourceAp
|
||||
|
||||
return: The application name
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetSourceApplicationName::run() const {
|
||||
std::unique_ptr<Cargo> GetSourceApplicationName::run(void) const {
|
||||
//Implement other platforms as required
|
||||
#ifdef ARCHICAD
|
||||
String result{"Archicad"};
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_APP_NAME
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_APP_NAME
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the host application name
|
||||
*/
|
||||
class GetSourceApplicationName : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetSourceApplicationName : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSourceApplicationVersion::GetSourceApplicationVersion() : BridgeMethod{"GetSourceApplicationVersion", [&]() {
|
||||
GetSourceApplicationVersion::GetSourceApplicationVersion() : JSBridgeMethod{"GetSourceApplicationVersion", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_APP_VERSION
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_APP_VERSION
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace connector::interfac::browser::bridge {
|
||||
/*!
|
||||
JS Function class to get the host application version
|
||||
*/
|
||||
class GetSourceApplicationVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetSourceApplicationVersion : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Config/GetConfig.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/UpdateConfig.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/GetIsDevMode.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
@@ -13,5 +12,4 @@ ConfigBridge::ConfigBridge() : BrowserBridge{"configBinding"} {
|
||||
//Add bridge methods
|
||||
addMethod<GetConfig>();
|
||||
addMethod<UpdateConfig>();
|
||||
addMethod<GetIsDevMode>();
|
||||
} //ConfigBridge::ConfigBridge
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -17,7 +16,7 @@ namespace {
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"darkTheme"},
|
||||
Identity{"DarkTheme"},
|
||||
};
|
||||
|
||||
}
|
||||
+1
-2
@@ -2,7 +2,6 @@
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/ArgumentBase.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
@@ -25,7 +24,7 @@ namespace connector::interfac::browser::bridge {
|
||||
|
||||
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
|
||||
|
||||
///True if the UI renders in dark mode
|
||||
///?
|
||||
bool isDarkTheme = true;
|
||||
|
||||
// MARK: - Serialisation
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/GetConfig.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetConfig::GetConfig() : BridgeMethod{"GetConfig", [&]() {
|
||||
GetConfig::GetConfig() : JSBridgeMethod{"GetConfig", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,8 +28,8 @@ GetConfig::GetConfig() : BridgeMethod{"GetConfig", [&]() {
|
||||
|
||||
return: The settings
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetConfig::run() const {
|
||||
std::unique_ptr<Cargo> GetConfig::run(void) const {
|
||||
ConnectorConfig config;
|
||||
///TODO: Get the accounts here - returning an empty array for testing only
|
||||
///TODO: Get the accounts here - returning an empty array for testing only
|
||||
return std::make_unique<WrappedValue>(config);
|
||||
} //GetConfig::run
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetConfig : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetConfig : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetConfig();
|
||||
|
||||
@@ -24,7 +26,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Get the configuration settings
|
||||
@return The settings
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
std::unique_ptr<active::serialise::Cargo> run(void) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/GetIsDevMode.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Return type for retrieving the current configuration
|
||||
using WrappedValue = CargoHold<ValueWrap<bool>, bool>;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetIsDevMode::GetIsDevMode() : BridgeMethod{"GetIsDevMode", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the DEBUG mode
|
||||
|
||||
return: true for DEBUG, false otherwise
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetIsDevMode::run() const {
|
||||
|
||||
#if DEBUG
|
||||
bool value = true;
|
||||
#else
|
||||
bool value = false;
|
||||
#endif
|
||||
|
||||
return std::make_unique<WrappedValue>(value);
|
||||
} //GetIsDevMode::run
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve IsDebugMode
|
||||
*/
|
||||
class GetIsDevMode : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
*/
|
||||
GetIsDevMode();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the DEBUG mode
|
||||
@return true for DEBUG, false otherwise
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/UpdateConfig.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
@@ -10,8 +11,8 @@ using namespace speckle::utility;
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
UpdateConfig::UpdateConfig() : BridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
|
||||
run(args);
|
||||
UpdateConfig::UpdateConfig() : JSBridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
|
||||
run(args.value);
|
||||
}} {}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_UPDATE_CONFIG
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace connector::interfac::browser::bridge {
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class UpdateConfig : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
|
||||
class UpdateConfig : public speckle::interfac::browser::bridge::JSBridgeMethod<UpdateArgs, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendFilter.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
nameID,
|
||||
summaryID,
|
||||
defaultID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"name"},
|
||||
Identity{"summary"},
|
||||
Identity{"isDefault"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool SendFilter::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[summaryID], summaryID, element },
|
||||
{ fieldID[defaultID], defaultID, element },
|
||||
},
|
||||
}.withType(&typeid(SendFilter)));
|
||||
return true;
|
||||
} //SendFilter::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique SendFilter::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(SendFilter))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(name);
|
||||
case summaryID:
|
||||
return std::make_unique<ValueWrap<String>>(summary);
|
||||
case defaultID:
|
||||
return std::make_unique<ValueWrap<bool>>(isDefault);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //SendFilter::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void SendFilter::setDefault() {
|
||||
name.clear();
|
||||
summary.clear();
|
||||
isDefault = false;
|
||||
} //SendFilter::setDefault
|
||||
@@ -1,67 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Utility/Cloner.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
A connector send filter
|
||||
*/
|
||||
class SendFilter : public active::serialise::Package, public active::utility::Cloner {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param nm The filter name
|
||||
@param sum A summary
|
||||
@param isDef True if this is the default filter
|
||||
*/
|
||||
SendFilter(const speckle::utility::String& nm = {}, const speckle::utility::String& sum = {}, bool isDef = false) :
|
||||
name{nm}, summary{sum}, isDefault{isDef} {}
|
||||
/*!
|
||||
Record cloning
|
||||
@return A clone of this record
|
||||
*/
|
||||
virtual SendFilter* clonePtr() const override { return new SendFilter(*this); };
|
||||
|
||||
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
|
||||
|
||||
///The filter name
|
||||
speckle::utility::String name;
|
||||
///A summary
|
||||
speckle::utility::String summary;
|
||||
///True if this is the default filter
|
||||
bool isDefault = false;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/GetSendFilters.h"
|
||||
|
||||
#include "Active/Container/Vector.h"
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendFilter.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
using WrappedValue = active::serialise::CargoHold<ContainerWrap<Vector, SendFilter>, Vector<SendFilter>>;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSendFilters::GetSendFilters() : BridgeMethod{"GetSendFilters", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the send filters
|
||||
|
||||
return: The send filters
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetSendFilters::run() const {
|
||||
Vector<SendFilter> filters;
|
||||
///TODO: Get real filters
|
||||
return std::make_unique<WrappedValue>(filters);
|
||||
} //GetSendFilters::run
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
class ConnectorConfig;
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the send filters
|
||||
*/
|
||||
class GetSendFilters : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetSendFilters();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the send filters
|
||||
@return The send filters
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
@@ -1,25 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Send.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
Send::Send() : BridgeMethod{"Send", [&](UpdateArgs args) {
|
||||
run(args);
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Send a specified model
|
||||
|
||||
modelCardID: The ID of the madel to send
|
||||
--------------------------------------------------------------------*/
|
||||
void Send::run(const String& modelCardID) const {
|
||||
///TODO: Send the requested model
|
||||
} //Send::run
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
class ConnectorConfig;
|
||||
|
||||
///Argument for a JS call to update the configuration
|
||||
using UpdateArgs = speckle::interfac::browser::bridge::JSArgType<speckle::utility::String>;
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class Send : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
Send();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Send a specified model
|
||||
@param modelCardID The ID of the madel to send
|
||||
*/
|
||||
void run(const speckle::utility::String& modelCardID) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Send/GetSendFilters.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Send.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
|
||||
//Add bridge methods
|
||||
addMethod<GetSendFilters>();
|
||||
addMethod<Send>();
|
||||
} //SendBridge::SendBridge
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
A browser bridge to support sending model data to a Speckle server
|
||||
*/
|
||||
class SendBridge : public speckle::interfac::browser::bridge::BrowserBridge {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = speckle::interfac::browser::bridge::BrowserBridge;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
SendBridge();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/Arg/SayHiArg.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
nameID,
|
||||
countID,
|
||||
isHelloID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs. NB: This structure is never exported, so we only define the incoming argument indices
|
||||
static std::array fieldID = {
|
||||
Identity{"0"},
|
||||
Identity{"1"},
|
||||
Identity{"2"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool SayHiArg::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[countID], countID, element },
|
||||
{ fieldID[isHelloID], isHelloID, element },
|
||||
},
|
||||
}.withType(&typeid(SayHiArg)));
|
||||
return true;
|
||||
} //SayHiArg::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique SayHiArg::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(SayHiArg))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(name);
|
||||
case countID:
|
||||
return std::make_unique<ValueWrap<int32_t>>(count);
|
||||
case isHelloID:
|
||||
return std::make_unique<ValueWrap<bool>>(isHello);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //SayHiArg::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void SayHiArg::setDefault() {
|
||||
name.clear();
|
||||
count = 0;
|
||||
isHello = false;
|
||||
} //SayHiArg::setDefault
|
||||
@@ -1,55 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Object for testing JS comms (with TestBridge binding)
|
||||
*/
|
||||
class SayHiArg : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
SayHiArg() = default;
|
||||
|
||||
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
|
||||
|
||||
///Sample parameters for testing only
|
||||
speckle::utility::String name;
|
||||
int32_t count = 0;
|
||||
bool isHello = false;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
|
||||
@@ -1,133 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/GetComplexType.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
unID,
|
||||
countID,
|
||||
isTestID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"id"},
|
||||
Identity{"count"},
|
||||
Identity{"thisIsABoolean"},
|
||||
};
|
||||
|
||||
/*!
|
||||
Object for testing Javascript communication (with TestBridge binding)
|
||||
*/
|
||||
class ComplexType final : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
ComplexType();
|
||||
|
||||
// MARK: - Public variables
|
||||
|
||||
///Sample parameters for testing only
|
||||
speckle::utility::String ID;
|
||||
int32_t count = 0;
|
||||
bool testBool = false;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[unID], unID, element, !ID.empty() },
|
||||
{ fieldID[countID], countID, element, count != 0 },
|
||||
{ fieldID[isTestID], isTestID, element, testBool },
|
||||
},
|
||||
}.withType(&typeid(ComplexType)));
|
||||
return true;
|
||||
}
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override {
|
||||
if (item.ownerType != &typeid(ComplexType))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case unID:
|
||||
return std::make_unique<ValueWrap<String>>(ID);
|
||||
case countID:
|
||||
return std::make_unique<ValueWrap<int32_t>>(count);
|
||||
case isTestID:
|
||||
return std::make_unique<ValueWrap<bool>>(testBool);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
///Return type for retrieving the current configuration
|
||||
using WrappedValue = CargoHold<PackageWrap, ComplexType>;
|
||||
|
||||
}
|
||||
|
||||
//Hashing specialisation
|
||||
template<>
|
||||
struct std::hash<ComplexType> {
|
||||
auto operator()(const ComplexType& obj) const {
|
||||
return hash<std::string>()(obj.ID) ^ rotl(hash<int32_t>()(obj.count), 1) ^ rotl(hash<bool>()(obj.testBool), 2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
ComplexType::ComplexType() {
|
||||
//This is the required test values
|
||||
count = static_cast<int32_t>(std::hash<ComplexType>()(*this));
|
||||
ID = String{count} + " - I am a string";
|
||||
} //ComplexType::ComplexType
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetComplexType::GetComplexType() : BridgeMethod{"GetComplexType", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the required object type
|
||||
|
||||
return: The required object
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetComplexType::run() const {
|
||||
ComplexType object;
|
||||
return std::make_unique<WrappedValue>(object);
|
||||
} //GetComplexType::run
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to return a specific object type
|
||||
*/
|
||||
class GetComplexType : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetComplexType();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the required object type
|
||||
@return The required object
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
@@ -1,20 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/GoAway.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
#include <iostream>
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GoAway::GoAway() : BridgeMethod{"GoAway", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Write a message to the console
|
||||
--------------------------------------------------------------------*/
|
||||
void GoAway::run() const {
|
||||
std::cout << "Okay, going away.";
|
||||
} //GoAway::run
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to print a fixed message to the console
|
||||
*/
|
||||
class GoAway : public speckle::interfac::browser::bridge::BridgeMethod<void, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
GoAway();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Write a message to the console
|
||||
*/
|
||||
void run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
|
||||
@@ -1,38 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/SayHi.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace active::setting;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Return type for the test message
|
||||
using WrappedValue = CargoHold<ValueWrap<String>, String>;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
SayHi::SayHi() : BridgeMethod{"SayHi", [&](SayHiWrapper arg) {
|
||||
return run(arg);
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Return a message based on sample data
|
||||
|
||||
arg: The sample data
|
||||
|
||||
return: The message based on sample data
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> SayHi::run(SayHiArg arg) const {
|
||||
String result, baseGreeting{(arg.isHello ? "Hello" : "Hi") + arg.name + "!\n"};
|
||||
for (auto i = arg.count; i--; )
|
||||
result += baseGreeting;
|
||||
return std::make_unique<WrappedValue>(result);
|
||||
} //SayHi::run
|
||||
@@ -1,37 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SAYHI
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SAYHI
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Test/Arg/SayHiArg.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
///Argument for the parameters of a test message
|
||||
using SayHiWrapper = speckle::interfac::browser::bridge::JSArgType<SayHiArg, 3>;
|
||||
|
||||
/*!
|
||||
JS Function class to return a test message based on sample data
|
||||
*/
|
||||
class SayHi : public speckle::interfac::browser::bridge::BridgeMethod<SayHiWrapper, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
SayHi();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Return a message based on sample data
|
||||
@param arg The sample data
|
||||
@return The message based on sample data
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run(SayHiArg arg) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SAYHI
|
||||
@@ -1,19 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/TestBridge.h"
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Test/GetComplexType.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Test/GoAway.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Test/SayHi.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Test/TriggerEvent.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
TestBridge::TestBridge() : BrowserBridge{"testBinding"} {
|
||||
//Add bridge methods
|
||||
addMethod<GetComplexType>();
|
||||
addMethod<GoAway>();
|
||||
addMethod<SayHi>();
|
||||
addMethod<TriggerEvent>();
|
||||
} //TestBridge::TestBridge
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
A browser bridge to provide configuration settings
|
||||
*/
|
||||
class TestBridge : public speckle::interfac::browser::bridge::BrowserBridge {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = speckle::interfac::browser::bridge::BrowserBridge;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
TestBridge();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
|
||||
@@ -1,105 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/TriggerEvent.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace active::setting;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
okID,
|
||||
nameID,
|
||||
countID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"isOk"},
|
||||
Identity{"name"},
|
||||
Identity{"count"},
|
||||
};
|
||||
|
||||
/*!
|
||||
Object for testing sending events to JS
|
||||
*/
|
||||
class TestObject final : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Public variables
|
||||
|
||||
///Sample parameters for testing only
|
||||
bool isOK = true;
|
||||
speckle::utility::String name = "foo";
|
||||
int32_t count = 42;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[okID], okID, element },
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[countID], countID, element },
|
||||
},
|
||||
}.withType(&typeid(TestObject)));
|
||||
return true;
|
||||
}
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override {
|
||||
if (item.ownerType != &typeid(TestObject))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case okID:
|
||||
return std::make_unique<ValueWrap<bool>>(isOK);
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(name);
|
||||
case countID:
|
||||
return std::make_unique<ValueWrap<int32_t>>(count);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
TriggerEvent::TriggerEvent() : BridgeMethod{"TriggerEvent", [&](TriggerEventWrapper arg) {
|
||||
return run(arg);
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Trigger an event based on a specified name
|
||||
|
||||
eventName: The event name
|
||||
--------------------------------------------------------------------*/
|
||||
void TriggerEvent::run(speckle::utility::String eventName) const {
|
||||
if (!hasBridge())
|
||||
return;
|
||||
if (eventName == "emptyTestEvent")
|
||||
getBridge()->sendEvent(eventName);
|
||||
else if (eventName == "testEvent")
|
||||
getBridge()->sendEvent(eventName, std::make_unique<TestObject>());
|
||||
} //TriggerEvent::run
|
||||
@@ -1,39 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
///Argument parameter for a string
|
||||
using StringHold = active::serialise::CargoHold<active::serialise::ValueWrap<speckle::utility::String>, speckle::utility::String>;
|
||||
///Argument type for this method
|
||||
using TriggerEventWrapper = speckle::interfac::browser::bridge::JSArgType<StringHold>;
|
||||
|
||||
/*!
|
||||
JS Function class to emit specified events as directed by JS
|
||||
*/
|
||||
class TriggerEvent : public speckle::interfac::browser::bridge::BridgeMethod<TriggerEventWrapper, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
TriggerEvent();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Trigger an event based on a specified name
|
||||
@param eventName The event name
|
||||
*/
|
||||
void run(speckle::utility::String eventName) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
|
||||
@@ -4,10 +4,7 @@
|
||||
#include "Connector/ConnectorResource.h"
|
||||
#include "Connector/Event/ConnectorEventID.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Account/AccountBridge.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/BaseBridge.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConfigBridge.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Test/TestBridge.h"
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Event/Type/MenuEvent.h"
|
||||
#include "Speckle/Interface/Browser/JSPortal.h"
|
||||
@@ -19,9 +16,9 @@
|
||||
using namespace active::environment;
|
||||
using namespace active::event;
|
||||
using namespace connector;
|
||||
using namespace speckle::interfac::browser;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::event;
|
||||
//using namespace speckle::interfac::browser;
|
||||
|
||||
|
||||
//NB: Following is placeholder from GS example code - will be refactored to better suit our purposes
|
||||
@@ -37,7 +34,7 @@ namespace {
|
||||
|
||||
// --- Class declaration: BrowserPalette ------------------------------------------
|
||||
|
||||
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public JSPortal<> {
|
||||
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public speckle::interfac::browser::JSPortal<> {
|
||||
public:
|
||||
enum SelectionModification { RemoveFromSelection, AddToSelection };
|
||||
|
||||
@@ -129,7 +126,7 @@ bool ConnectorPalette::start() {
|
||||
--------------------------------------------------------------------*/
|
||||
bool ConnectorPalette::receive(const active::event::Event& event) {
|
||||
if (BrowserPalette::HasInstance() && BrowserPalette::GetInstance().IsVisible()) {
|
||||
BrowserPalette::GetInstance().Hide ();
|
||||
BrowserPalette::GetInstance ().Hide ();
|
||||
} else {
|
||||
if (!BrowserPalette::HasInstance())
|
||||
BrowserPalette::CreateInstance();
|
||||
@@ -163,11 +160,8 @@ BrowserPalette::BrowserPalette() :
|
||||
Attach(*this);
|
||||
BeginEventProcessing();
|
||||
//Install required connector bridges
|
||||
install<AccountBridge>();
|
||||
install<BaseBridge>();
|
||||
install<ConfigBridge>();
|
||||
install<SendBridge>();
|
||||
install<TestBridge>();
|
||||
install(std::make_shared<AccountBridge>());
|
||||
install(std::make_shared<ConfigBridge>());
|
||||
InitBrowserControl();
|
||||
}
|
||||
|
||||
@@ -205,11 +199,7 @@ void BrowserPalette::Hide() {
|
||||
}
|
||||
|
||||
void BrowserPalette::InitBrowserControl() {
|
||||
#ifdef TESTING_MODE
|
||||
browser->LoadURL("https://boisterous-douhua-e3cefb.netlify.app/test");
|
||||
#else
|
||||
browser->LoadURL("https://boisterous-douhua-e3cefb.netlify.app/");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace connector {
|
||||
|
||||
static const unsigned int versionMajor = 0;
|
||||
|
||||
static const unsigned int versionMinor = 2;
|
||||
static const unsigned int versionMinor = 1;
|
||||
|
||||
static const unsigned int versionPatch = 2;
|
||||
static const unsigned int versionPatch = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#include "ActiveLibDoctest/TestingPlatforms.h"
|
||||
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Utility/BufferIn.h"
|
||||
#include "Active/Utility/BufferOut.h"
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace active::serialise::json;
|
||||
using namespace active::serialise::json;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
const char* accountJSON = "{\"id\":\"d4468f8d6f1e4c48a899518795326ea8\",\"token\":\"42986a57b3304baa8773f937aa0b7bcd42986a57b3\",\"refreshToken\":\"00b01c421de4404889f30947de1506d3440c476432\",\"isDefault\":true,\"isOnline\":false,\"serverInfo\":{\"name\":\"My new Speckle Server\",\"company\":\"Unknown Company\",\"version\":\"2.20.2-branch.testing.138676-e8c8291\",\"adminContact\":\"n/a\",\"description\":\"This a community deployment of a Speckle Server.\",\"frontend2\":true,\"url\":\"https://testing.speckle.dev\",\"migration\":null},\"userInfo\":{\"id\":\"00b01c421d\",\"name\":\"someone@speckle.systems\",\"email\":\"someone@speckle.systems\",\"company\":null,\"avatar\":null,\"streams\":{\"totalCount\":2},\"commits\":{\"totalCount\":5}}}";
|
||||
}
|
||||
|
||||
|
||||
TEST_SUITE(TESTQ(AccountTests)) TEST_SUITE_OPEN
|
||||
|
||||
//Test to receive account serialised as JSON from SQLite dbase
|
||||
TEST_CASE(TESTQ(testAccountReceive)) {
|
||||
Account account;
|
||||
JSONTransport transport;
|
||||
try {
|
||||
transport.receive(PackageWrap{account}, Identity{}, String{accountJSON});
|
||||
} catch(...) {
|
||||
FAIL_CHECK(TEST_MESSAGE(Account deserialisation failed));
|
||||
}
|
||||
String accountOut;
|
||||
try {
|
||||
transport.send(PackageWrap{account}, Identity{}, accountOut);
|
||||
} catch(...) {
|
||||
FAIL_CHECK(TEST_MESSAGE(Account serialisation failed));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST_SUITE_CLOSE
|
||||
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,6 @@ REM AC Resource build script
|
||||
ECHO "Building AC Resources"
|
||||
|
||||
if not exist "%RES_OUTPUT%" MD "%RES_OUTPUT%"
|
||||
python "%HEADER_PATH_5%\Tools\CompileResources.py" "INT" "%HEADER_PATH_5%\.." "%HEADER_PATH_6%Source" "%SYMROOT%\" "%RES_OUTPUT%" "%RES_SOURCE%\CodesignImport.apx.mui"
|
||||
python "%HEADER_PATH_5%\Tools\CompileResources.py" "INT" "%HEADER_PATH_5%/.." "%HEADER_PATH_6%Source" %SYMROOT% %RES_OUTPUT% "%RES_SOURCE%/CodesignImport.apx.mui"
|
||||
|
||||
ECHO "Finished AC Resource"
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "Active/Database/Storage/SQLite/SQLiteEngine.h"
|
||||
#include "Active/Database/Storage/Storage.h"
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
#include "Active/Setting/Values/StringValue.h"
|
||||
#include "Speckle/Database/AccountDatabase.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::database;
|
||||
using namespace active::serialise::json;
|
||||
using namespace active::setting;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
//Account field indices
|
||||
enum Fields {
|
||||
hashID = 0,
|
||||
contentID,
|
||||
};
|
||||
|
||||
///Internal name of the accounts dbase
|
||||
const char* accountsDBaseName = "accounts";
|
||||
///Accounts table name
|
||||
const char* accountsTableName = "objects";
|
||||
///Hash field name
|
||||
const char* hashFieldName = "hash";
|
||||
///Content field name
|
||||
const char* contentFieldName = "content";
|
||||
|
||||
}
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
///Accounts database engine declaration
|
||||
using AccountsEngine = SQLiteEngine<Account, Account, JSONTransport, active::utility::String, active::utility::String>;
|
||||
|
||||
///Accounts database storage declaration
|
||||
class AccountDatabase::Store : public active::database::Storage<speckle::record::cred::Account, active::serialise::json::JSONTransport,
|
||||
active::utility::String, active::utility::String, active::utility::String, active::utility::String> {
|
||||
using base = active::database::Storage<speckle::record::cred::Account, active::serialise::json::JSONTransport,
|
||||
active::utility::String, active::utility::String, active::utility::String, active::utility::String>;
|
||||
using base::base;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
path: Path to the database file
|
||||
--------------------------------------------------------------------*/
|
||||
AccountDatabase::AccountDatabase(const active::file::Path& path) {
|
||||
//Create accounts database storage (with schema)
|
||||
m_store = std::make_unique<Store>(
|
||||
//Engine
|
||||
std::make_unique<AccountsEngine>(path,
|
||||
//Schema
|
||||
DBaseSchema{active::utility::String{accountsDBaseName},
|
||||
//Tables
|
||||
{
|
||||
//Account table
|
||||
{
|
||||
accountsTableName, Fields::hashID, Fields::contentID, {
|
||||
ValueSetting{StringValue{}, hashFieldName},
|
||||
ValueSetting{StringValue{}, contentFieldName},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
} //AccountDatabase::AccountDatabase
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Destructor
|
||||
--------------------------------------------------------------------*/
|
||||
AccountDatabase::~AccountDatabase() {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get all accounts
|
||||
|
||||
return: All the accounts
|
||||
--------------------------------------------------------------------*/
|
||||
Vector<Account> AccountDatabase::getAccounts() const {
|
||||
return m_store->getObjects();
|
||||
} //AccountDatabase::getAccounts
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifndef SPECKLE_DATABASE_ACCOUNT_DBASE
|
||||
#define SPECKLE_DATABASE_ACCOUNT_DBASE
|
||||
|
||||
#include "Active/File/Path.h"
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
/*!
|
||||
A base class for an addon
|
||||
*/
|
||||
class AccountDatabase {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param path Path to the database file
|
||||
*/
|
||||
AccountDatabase(const active::file::Path& path);
|
||||
AccountDatabase(const AccountDatabase&) = delete;
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~AccountDatabase();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get all accounts
|
||||
@return All the accounts
|
||||
*/
|
||||
active::container::Vector<record::cred::Account> getAccounts() const;
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
private:
|
||||
class Store;
|
||||
///Accounts database storage
|
||||
std::unique_ptr<Store> m_store;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_DATABASE_ACCOUNT_DBASE
|
||||
+10
-4
@@ -1,8 +1,7 @@
|
||||
#ifndef SPECKLE_DATABASE_INDEX
|
||||
#define SPECKLE_DATABASE_INDEX
|
||||
|
||||
#include "Active/Database/Identity/Link.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
@@ -13,16 +12,23 @@ namespace speckle::database {
|
||||
this is typically a guid, for Revit a string and for Vectorworks a handle. Note that this index is not necessarily persistent between
|
||||
sessions.
|
||||
*/
|
||||
class Index : public active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
class Index : public speckle::utility::Guid {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
using base = speckle::utility::Guid;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
|
||||
Index(speckle::utility::Guid ID, speckle::utility::Guid dbaseID) : base{ID}, databaseID{dbaseID} {}
|
||||
|
||||
// MARK: - Public variables
|
||||
|
||||
///ID of the source database (not defined in every case, undefined = null guid)
|
||||
speckle::utility::Guid databaseID;
|
||||
};
|
||||
|
||||
}
|
||||
+3
-5
@@ -1,8 +1,6 @@
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::utility;
|
||||
|
||||
#ifdef ARCHICAD
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -10,9 +8,9 @@ using namespace speckle::utility;
|
||||
|
||||
selected: Information about a selected Archicad element
|
||||
--------------------------------------------------------------------*/
|
||||
//Link::Link(const API_Neig& selected) : base{Guid{selected.guid}} {
|
||||
Link::Link(const API_Neig& selected) : recordID{selected.guid} {
|
||||
//More info should be extracted from API_Neig in future (as required)
|
||||
//} //Link::Link
|
||||
} //Link::Link
|
||||
#endif
|
||||
|
||||
|
||||
+25
-6
@@ -2,7 +2,7 @@
|
||||
#define SPECKLE_DATABASE_LINK
|
||||
|
||||
#include "Active/Setting/SettingList.h"
|
||||
#include "Speckle/Database/Identity/Index.h"
|
||||
#include "Speckle/Database/Content/Index.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
@@ -17,18 +17,30 @@ namespace speckle::database {
|
||||
A link may optionally carry any number of settings. In the context of a user selection (for example) there might be settings describing where
|
||||
the user made the selection (e.g. the hole in a floor slab), allowing a tool working on that selection to be more precise.
|
||||
*/
|
||||
class Link : public active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
class Link : public active::setting::SettingList {
|
||||
public:
|
||||
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
|
||||
using base = active::setting::SettingList;
|
||||
///Unique pointer
|
||||
using Unique = std::unique_ptr<Link>;
|
||||
///Shared pointer
|
||||
using Shared = std::shared_ptr<Link>;
|
||||
///Optional
|
||||
using Option = std::optional<Link>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
|
||||
Link() = default;
|
||||
/*!
|
||||
Constructor
|
||||
@param index An element index
|
||||
@param origIndex The index of the original element (when the preceding index is to a proxy element)
|
||||
*/
|
||||
Link(const Index& index, const Index& origIndex = Index{}) : recordID{index}, originalID{origIndex} {}
|
||||
|
||||
#ifdef ARCHICAD
|
||||
/*!
|
||||
Constructor
|
||||
@@ -36,6 +48,13 @@ namespace speckle::database {
|
||||
*/
|
||||
Link(const API_Neig& selected);
|
||||
#endif
|
||||
|
||||
// MARK: - Public variables
|
||||
|
||||
///ID of the linked record (defaults to null guid = undefined)
|
||||
Index recordID;
|
||||
///ID of the original record (in the case where the record is proxy for another - null guid = undefined)
|
||||
Index originalID;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -8,17 +8,40 @@ using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool Record::fillInventory(active::serialise::Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ Identity{"id"}, active::database::record::FieldIndex::idIndex, element },
|
||||
},
|
||||
}.withType(&typeid(base)));
|
||||
bool Record::fillInventory(Inventory& inventory) const {
|
||||
//TODO: Complete
|
||||
return true;
|
||||
} //Record::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique Record::getCargo(const Inventory::Item& item) const {
|
||||
//TODO: Complete
|
||||
return nullptr;
|
||||
} //Record::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void Record::setDefault() {
|
||||
//TODO: Complete
|
||||
} //Record::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Validate the cargo data
|
||||
|
||||
return: True if the data has been validated
|
||||
--------------------------------------------------------------------*/
|
||||
bool Record::validate() {
|
||||
//TODO: Complete
|
||||
return true;
|
||||
} //Record::validate
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
#ifndef SPECKLE_DATABASE_RECORD
|
||||
#define SPECKLE_DATABASE_RECORD
|
||||
|
||||
#include "Active/Database/Content/Record.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
/*!
|
||||
Base class for a database record
|
||||
*/
|
||||
class Record : public active::database::Record<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
class Record : public active::serialise::Package, public active::utility::Cloner {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Record<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
///Unique pointer
|
||||
using Unique = std::unique_ptr<Record>;
|
||||
///Shared pointer
|
||||
using Shared = std::shared_ptr<Record>;
|
||||
@@ -28,17 +26,47 @@ namespace speckle::database {
|
||||
Constructor
|
||||
@param ID The record ID
|
||||
*/
|
||||
Record(speckle::utility::String ID) : base{ID} {}
|
||||
Record(speckle::utility::Guid ID) : m_ID{ID} {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~Record() {}
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
|
||||
/*!
|
||||
Get the record ID
|
||||
@return The record ID
|
||||
*/
|
||||
speckle::utility::Guid getID() const { return m_ID; }
|
||||
/*!
|
||||
Get the record unique ID
|
||||
@return The record unique ID
|
||||
*/
|
||||
speckle::utility::Guid getUniqueID() const { return m_uniqueID; }
|
||||
/*!
|
||||
Get the record index
|
||||
@return The record index
|
||||
*/
|
||||
virtual Index getIndex() const { return Index{m_ID, m_ownerID}; }
|
||||
/*!
|
||||
Get the record link
|
||||
@return The record link
|
||||
*/
|
||||
virtual Link getLink() const { return Link{getIndex()}; }
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
|
||||
/*!
|
||||
Set the record ID
|
||||
@param ID The record ID
|
||||
*/
|
||||
void setID(speckle::utility::Guid ID) { m_ID = ID; }
|
||||
/*!
|
||||
Set the record unique ID
|
||||
@param ID The record unique ID
|
||||
*/
|
||||
void setUniqueID(speckle::utility::Guid ID) { m_uniqueID = ID; }
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
@@ -48,6 +76,31 @@ namespace speckle::database {
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
/*!
|
||||
Validate the cargo data
|
||||
@return True if the data has been validated
|
||||
*/
|
||||
bool validate() override;
|
||||
|
||||
private:
|
||||
///The record ID (may not be unique across models)
|
||||
speckle::utility::Guid m_ID = speckle::utility::Guid{true};
|
||||
///The record unique ID
|
||||
speckle::utility::Guid m_uniqueID = speckle::utility::Guid{true};
|
||||
///The record owner ID (null guid if unspecified)
|
||||
speckle::utility::Guid m_ownerID;
|
||||
///The last edit time
|
||||
active::utility::Time editTime = active::utility::Time{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "Speckle/Environment/Platform.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace speckle::environment;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
//An object representing the active addon
|
||||
Platform m_platformInstance;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Write a message to the console
|
||||
|
||||
message: The message to write
|
||||
--------------------------------------------------------------------*/
|
||||
void Platform::writeToConsole(const active::utility::String& message) {
|
||||
#ifdef WINDOWS
|
||||
//NB: std::cout doesn't write to the console in Windows by default
|
||||
OutputDebugString((LPCTSTR)message.operator std::u16string().data());
|
||||
#else
|
||||
std::cout << message.data();
|
||||
#endif
|
||||
} //Platform::writeToConsole
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get an object representing the parent process/application
|
||||
|
||||
return: The active application instance
|
||||
--------------------------------------------------------------------*/
|
||||
speckle::environment::Platform* speckle::environment::platform() {
|
||||
return &m_platformInstance;
|
||||
} //speckle::environment::platform
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef SPECKLE_ENVIRONMENT_PLATFORM
|
||||
#define SPECKLE_ENVIRONMENT_PLATFORM
|
||||
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::environment {
|
||||
|
||||
/*!
|
||||
A class representing the host platform/opterating system
|
||||
*/
|
||||
class Platform {
|
||||
public:
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Write a message to the console
|
||||
@param message The message to write
|
||||
*/
|
||||
void writeToConsole(const active::utility::String& message);
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
Get an object representing the host platform
|
||||
@return The host platform
|
||||
*/
|
||||
speckle::environment::Platform* platform();
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_ENVIRONMENT_PLATFORM
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Speckle/Event/Subscriber/SelectionSubscriber.h"
|
||||
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
#include "Speckle/Event/Type/SelectionEvent.h"
|
||||
|
||||
using namespace active::environment;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "Active/Utility/Guid.h"
|
||||
#include "Active/Utility/String.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
|
||||
namespace speckle::event {
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Interface for objects used as arguments for JS bridge arguments
|
||||
|
||||
Enables deserialisation to recognise individual parameters in the serialised JS method aergument, e.g. "0", "1", etc
|
||||
*/
|
||||
class ArgumentBase {
|
||||
public:
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~ArgumentBase() {}
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Determine if the object is used as an argument template
|
||||
@return True if the object is used as an argument template
|
||||
*/
|
||||
bool isArgumentTemplate() const { return m_isArgumentTemplate; }
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
/*!
|
||||
Set whether the object is used as an argument template
|
||||
@param state True if the object is used as an argument template
|
||||
*/
|
||||
void setArgumentTemplate(bool state) { m_isArgumentTemplate = state; }
|
||||
|
||||
private:
|
||||
///True if the object is used as an argument template
|
||||
bool m_isArgumentTemplate = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
|
||||
@@ -1,133 +0,0 @@
|
||||
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/ArgumentBase.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Base class for the argments passed from JavaScript to a named C++ method in a Speckle bridging object
|
||||
|
||||
NB: The BridgeArgumentWrap class will:
|
||||
- Deserialise the essential attributes for determining the target method and arguments;
|
||||
- Create the correct BridgeArgument subclass for the emthod/argument and populate it with the collected attributes
|
||||
Therefore, there is no need for this class to handle any deserialisation, and subclasses should only handle the core arguments data
|
||||
*/
|
||||
class BridgeArgument : public active::serialise::Cargo {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
BridgeArgument() {}
|
||||
/*!
|
||||
Constructor
|
||||
@param methodName The name of the method to receive the argument
|
||||
@param requestID An ID to be paired with the method return value
|
||||
@param errorMessage Optional error message - populate on failure (method will not be called in this case)
|
||||
|
||||
*/
|
||||
BridgeArgument(const speckle::utility::String& methodName,
|
||||
const speckle::utility::String& requestID,
|
||||
const speckle::utility::String::Option& errorMessage = std::nullopt) :
|
||||
m_methodName{methodName}, m_requestID{requestID}, m_errorMessage{errorMessage} {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~BridgeArgument() {}
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the name of the method to receive the arguments
|
||||
@return The method name
|
||||
*/
|
||||
const speckle::utility::String& getMethodName() const { return m_methodName; }
|
||||
/*!
|
||||
Get the request ID from the JS caller (to be paired with the method result)
|
||||
@return The request ID
|
||||
*/
|
||||
const speckle::utility::String& getRequestID() const { return m_requestID; }
|
||||
/*!
|
||||
Determine if the argument contains an error
|
||||
@return True if the argument contains an error
|
||||
*/
|
||||
bool hasError() const { return m_errorMessage.operator bool(); }
|
||||
/*!
|
||||
Get the number of parameters in the argument
|
||||
@return The number of parameters
|
||||
*/
|
||||
virtual uint32_t parameterCount() const { return 1; }
|
||||
|
||||
/*!
|
||||
Get any error message relating to the arguments
|
||||
@return The error message (nullopt if no errors occurred)
|
||||
*/
|
||||
speckle::utility::String::Option errorMessage() const { return m_errorMessage; }
|
||||
/*!
|
||||
Fill an inventory with the cargo items
|
||||
@param inventory The inventory to receive the cargo items
|
||||
@return True if items have been added to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
private:
|
||||
///The name of the method to receive the argument
|
||||
speckle::utility::String m_methodName;
|
||||
///An ID to be paired with the method return value
|
||||
speckle::utility::String m_requestID;
|
||||
///Optional error message - only populated on failure to obtain a valid argument (method will not be called in this case)
|
||||
speckle::utility::String::Option m_errorMessage;
|
||||
};
|
||||
|
||||
///Definition of the argument for a JS callable method (enclosing the local function argument)
|
||||
template<typename T, uint32_t Params = 1>
|
||||
class JSArgType : public BridgeArgument, public T {
|
||||
public:
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param methodName The name of the method to receive the argument
|
||||
@param requestID An ID to be paired with the method return value
|
||||
@param errorMessage Optional error message - populate on failure (method will not be called in this case)
|
||||
*/
|
||||
JSArgType(const speckle::utility::String& methodName,
|
||||
const speckle::utility::String& requestID,
|
||||
const speckle::utility::String::Option& errorMessage = std::nullopt) : BridgeArgument{methodName, requestID, errorMessage} {
|
||||
//Tag the argument object as a template where possible
|
||||
if (auto arg = dynamic_cast<ArgumentBase*>(this); arg != nullptr)
|
||||
arg->setArgumentTemplate(true);
|
||||
}
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
JSArgType(const JSArgType& source) : BridgeArgument{source}, T{source} {}
|
||||
|
||||
/*!
|
||||
Get the number of parameters in the argument
|
||||
@return The number of parameters
|
||||
*/
|
||||
uint32_t parameterCount() const override { return Params; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
@@ -1,188 +0,0 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
|
||||
#include "Active/Serialise/Inventory/Inventory.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ValueSettingWrap.h"
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Active/Utility/BufferIn.h"
|
||||
#include "Speckle/Utility/Exception.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace active::serialise::json;
|
||||
using namespace active::setting;
|
||||
using namespace speckle::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
///Factory functions to construct arguments from linked bridge/method names
|
||||
std::unordered_map<String, BridgeArgumentWrap::Production> BridgeArgumentWrap::m_argumentFactory;
|
||||
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
using enum active::serialise::Entry::Type;
|
||||
|
||||
///The indices of the package items
|
||||
enum FieldIndex {
|
||||
args,
|
||||
};
|
||||
|
||||
|
||||
///The indices of the arguments array rows
|
||||
enum RowIndex {
|
||||
methodName,
|
||||
requestID,
|
||||
argsJSON,
|
||||
};
|
||||
|
||||
|
||||
///The package inventory
|
||||
auto myInventory = Inventory {
|
||||
{
|
||||
{ {"arg"}, args, 0, std::nullopt, true }, //The JS arguments are expressed as a flat array - use the array indices to map to expected vars
|
||||
},
|
||||
}.withType(&typeid(BridgeArgumentWrap));;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Destructor
|
||||
--------------------------------------------------------------------*/
|
||||
BridgeArgumentWrap::~BridgeArgumentWrap() {
|
||||
} //BridgeArgumentWrap::~BridgeArgumentWrap
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the cargo items
|
||||
|
||||
inventory: The inventory to receive the cargo items
|
||||
|
||||
return: True if items have been added to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool BridgeArgumentWrap::fillInventory(Inventory& inventory) const {
|
||||
inventory.merge(myInventory);
|
||||
return true;
|
||||
} //BridgeArgumentWrap::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique BridgeArgumentWrap::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(BridgeArgumentWrap))
|
||||
return nullptr;
|
||||
switch (item.index) {
|
||||
case FieldIndex::args: {
|
||||
switch (item.available - 1) { //NB: Args are not labelled - in this instance we use the array row index to couple to an argument var
|
||||
case RowIndex::methodName:
|
||||
return std::make_unique<ValueWrap<String>>(m_methodName);
|
||||
case RowIndex::requestID:
|
||||
return std::make_unique<ValueWrap<String>>(m_requestID);
|
||||
case RowIndex::argsJSON:
|
||||
return std::make_unique<ValueWrap<String>>(m_argsJSON);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //BridgeArgumentWrap::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void BridgeArgumentWrap::setDefault() {
|
||||
m_methodName.clear();
|
||||
m_requestID.clear();
|
||||
m_argsJSON.clear();
|
||||
m_argument.reset(); //This will be populated once the target bridge and method are known (and hence the required argument type)
|
||||
} //BridgeArgumentWrap::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Validate the cargo data
|
||||
|
||||
return: True if the data has been validated
|
||||
--------------------------------------------------------------------*/
|
||||
bool BridgeArgumentWrap::validate() {
|
||||
//Build an argument with the attributes obtained of none exists
|
||||
if (!m_argument)
|
||||
finaliseArgument();
|
||||
//Then ensure the argument object is valid
|
||||
return m_argument->validate();
|
||||
} //BridgeArgumentWrap::validate
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Make an argument object for a specified bridge method
|
||||
|
||||
methodID: The name of the target method
|
||||
requestID: The ID of the request
|
||||
argument: The method argument data (serialised)
|
||||
|
||||
return: An argument object (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<BridgeArgument> BridgeArgumentWrap::makeArgument(const String& methodID, const String& requestID, const String& argument) {
|
||||
if (auto maker = m_argumentFactory.find(methodID); (maker != m_argumentFactory.end())) {
|
||||
if (auto result = reinterpret_cast<BridgeArgument*>(maker->second(methodID, requestID)); result != nullptr) {
|
||||
try {
|
||||
//The argument is passed as an array of stringified JSON - first unpack the array
|
||||
JSONTransport transport;
|
||||
ValueSetting args;
|
||||
transport.receive(ValueSettingWrap{args}, Identity{}, argument);
|
||||
if (args.size() != result->parameterCount())
|
||||
throw Exception{"Function called with wrong number of parameters"};
|
||||
String unifiedArgument;
|
||||
if ((args.size() > 1) && dynamic_cast<Package*>(result) != nullptr) {
|
||||
//Unify the argument strings into a single JSON argument
|
||||
unifiedArgument = "{";
|
||||
int32_t argIndex = 0;
|
||||
bool isFirst = true;
|
||||
for (auto& arg : args.operator std::vector<active::utility::String>()) {
|
||||
if (isFirst)
|
||||
isFirst = false;
|
||||
else
|
||||
unifiedArgument += ",";
|
||||
unifiedArgument += "\"" + String{argIndex++} + "\":" + JSONTransport::convertFromJSONString(arg);
|
||||
}
|
||||
unifiedArgument += "}";
|
||||
} else {
|
||||
//An item can only receive a single parameter
|
||||
if (args.size() > 1)
|
||||
throw Exception{"Function called with wrong number of parameters"};
|
||||
unifiedArgument = args;
|
||||
}
|
||||
//And receive the unified argument into the method argument
|
||||
transport.receive(std::forward<Cargo&&>(*result), Identity{}, unifiedArgument);
|
||||
return std::unique_ptr<BridgeArgument>{result};
|
||||
} catch(std::runtime_error e) {
|
||||
//Populating the error cancels the method
|
||||
return std::make_unique<BridgeArgument>(methodID, requestID, String{e.what()});
|
||||
} catch(...) {
|
||||
//Populating the error cancels the method
|
||||
return std::make_unique<BridgeArgument>(methodID, requestID, String{"An unexpected error occurred parsing the method argument"});
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
} //BridgeArgumentWrap::makeArgument
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Finalise the output argument object based on the current object, method etc
|
||||
--------------------------------------------------------------------*/
|
||||
void BridgeArgumentWrap::finaliseArgument() const {
|
||||
//Use the deserialised target bridge and method to establish the required arguments (if any)
|
||||
m_argument = BridgeArgumentWrap::makeArgument(m_methodName, m_requestID, m_argsJSON);
|
||||
//If the function doesn't take an argument, we still need to pass along the base class with object name, method etc
|
||||
if (!m_argument)
|
||||
m_argument = std::make_unique<BridgeArgument>(m_methodName, m_requestID);
|
||||
} //BridgeArgumentWrap::finaliseArgument
|
||||
@@ -1,44 +0,0 @@
|
||||
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
class BrowserBridge;
|
||||
|
||||
/*!
|
||||
Interface for any function operating within a browser bridge
|
||||
|
||||
As a child of a bridge, it may need to facilitate operations through the browser portal - this interface allows the the parent
|
||||
browser bridge to provide access.
|
||||
*/
|
||||
class BridgeChild {
|
||||
public:
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
/*!
|
||||
Set the parent bridge
|
||||
@param bridge The parent bridge
|
||||
*/
|
||||
void setBridge(BrowserBridge* bridge) { m_bridge = bridge; }
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Set the parent bridge
|
||||
@return The parent bridge
|
||||
*/
|
||||
bool hasBridge() const { return m_bridge != nullptr; }
|
||||
/*!
|
||||
Set the parent bridge
|
||||
@return The parent bridge
|
||||
*/
|
||||
BrowserBridge* getBridge() const { return m_bridge; }
|
||||
|
||||
private:
|
||||
///The parent browser bridge
|
||||
BrowserBridge* m_bridge = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
#include "Active/Setting/Values/StringValue.h"
|
||||
#include "Active/Utility/BufferOut.h"
|
||||
#include "Speckle/Interface/Browser/JSPortal.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/GetBindingsMethodNames.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/RunMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/GetCallResult.h"
|
||||
#include "Speckle/Utility/Guid64.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
@@ -38,9 +36,9 @@ namespace speckle::interfac::browser::bridge {
|
||||
BrowserBridge::BrowserBridge(const String& name) : JSObject{name} {
|
||||
m_result = std::make_unique<ResultCache>();
|
||||
//Populate the required browser bridge functions callable from JS
|
||||
addFunction<GetBindingsMethodNames>();
|
||||
addFunction<RunMethod>();
|
||||
addFunction<GetCallResult>();
|
||||
emplace_back(std::make_shared<GetBindingsMethodNames>(*this));
|
||||
emplace_back(std::make_shared<RunMethod>(*this));
|
||||
emplace_back(std::make_shared<GetCallResult>(*this));
|
||||
} //BrowserBridge::BrowserBridge
|
||||
|
||||
|
||||
@@ -77,43 +75,18 @@ Functional<>* BrowserBridge::getMethod(const String& name) const {
|
||||
} //BrowserBridge::getMethod
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Send a named event through the JS portal
|
||||
|
||||
eventName: The result cargo to send back to the JS
|
||||
data: Optional data to send with the event (nullptr = send event without data)
|
||||
--------------------------------------------------------------------*/
|
||||
void BrowserBridge::sendEvent(speckle::utility::String eventName, std::unique_ptr<active::serialise::Cargo> data) {
|
||||
if (m_portal == nullptr)
|
||||
throw; //TODO: Add exception detail
|
||||
if (!data) {
|
||||
//Just send an event with no data
|
||||
m_portal->execute(getName() + ".emit('" + eventName + "')");
|
||||
return;
|
||||
}
|
||||
//Generate a custom requestID for the data
|
||||
String requestID{Guid64{true} + String{"_"} + eventName};
|
||||
cacheResult(std::move(data), requestID, false);
|
||||
//Send a notification using the event name and request ID to signal that the data is available
|
||||
m_portal->execute(getName() + ".emitResponseReady('" + eventName + "','" + requestID + "')");
|
||||
} //BrowserBridge::sendEvent
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Cache the result from a method function for the JS caller to retrieve
|
||||
|
||||
result: The result cargo to send back to the JS
|
||||
requestID: The resquest ID from the JS caller (to correctly pair up the caller and result)
|
||||
isNotified: True if notification of the result availability should be sent to the JS portal
|
||||
--------------------------------------------------------------------*/
|
||||
void BrowserBridge::cacheResult(std::unique_ptr<Cargo> result, String requestID, bool isNotified) {
|
||||
void BrowserBridge::cacheResult(std::unique_ptr<Cargo> result, String requestID) {
|
||||
if (m_portal == nullptr)
|
||||
throw; //TODO: Add exception detail
|
||||
const std::lock_guard<std::mutex> lock(m_result->mutex);
|
||||
(*m_result)[requestID] = std::move(result);
|
||||
//Notify that the result is available when required
|
||||
if (isNotified)
|
||||
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
|
||||
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
|
||||
} //BrowserBridge::cacheResult
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/JSObject.h"
|
||||
#include "Speckle/Interface/Browser/Functional.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
|
||||
namespace active::setting {
|
||||
class ValueSetting;
|
||||
@@ -45,12 +46,6 @@ namespace speckle::interfac::browser::bridge {
|
||||
@return A pointer to the requested method (owner does not take ownership, nullptr = failure)
|
||||
*/
|
||||
Functional<>* getMethod(const speckle::utility::String& name) const;
|
||||
/*!
|
||||
Send a named event through the JS portal
|
||||
@param eventName The result cargo to send back to the JS
|
||||
@param data Optional data to send with the event (nullptr = send event without data)
|
||||
*/
|
||||
void sendEvent(speckle::utility::String eventName, std::unique_ptr<active::serialise::Cargo> data = nullptr);
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
@@ -58,9 +53,8 @@ namespace speckle::interfac::browser::bridge {
|
||||
Cache the result from a method function for the JS caller to retrieve
|
||||
@param result The result cargo to send back to the JS
|
||||
@param requestID The resquest ID from the JS caller (to correctly pair up the caller and result)
|
||||
@param isNotified True if notification of the result availability should be sent to the JS portal
|
||||
*/
|
||||
void cacheResult(std::unique_ptr<active::serialise::Cargo> result, speckle::utility::String requestID, bool isNotified = true);
|
||||
void cacheResult(std::unique_ptr<active::serialise::Cargo> result, speckle::utility::String requestID);
|
||||
/*!
|
||||
Release the results linked to a specified request ID
|
||||
@param requestID The required result ID
|
||||
@@ -69,28 +63,15 @@ namespace speckle::interfac::browser::bridge {
|
||||
std::unique_ptr<active::serialise::Cargo> releaseResult(speckle::utility::String requestID);
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Add a bridge function
|
||||
@tparam T The function type
|
||||
*/
|
||||
template<typename T> requires (std::is_base_of_v<Functional<>, T>)
|
||||
void addFunction() {
|
||||
//The argument type is registered against the bridge to enable an appropriate object to be deserialised from the JS args
|
||||
auto function = std::make_shared<T>();
|
||||
if (auto child = dynamic_cast<BridgeChild*>(function.get()); child != nullptr)
|
||||
child->setBridge(this);
|
||||
emplace_back(function);
|
||||
}
|
||||
/*!
|
||||
Add a browser method
|
||||
@tparam T The method type (which also defines the argument type)
|
||||
*/
|
||||
template<typename T> requires (std::is_base_of_v<BridgeMethodBase, T>)
|
||||
void addMethod() {
|
||||
template<typename T> requires (std::is_base_of_v<JSBridgeMethodBase, T>)
|
||||
void addMethod() const {
|
||||
//The argument type is registered against the bridge to enable an appropriate object to be deserialised from the JS args
|
||||
auto method = std::make_shared<T>();
|
||||
method->registerArgument(getName());
|
||||
method->setBridge(this);
|
||||
m_methods->insert(m_methods->end(), method);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/ErrorReport.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
errMessage,
|
||||
errInfo,
|
||||
errTrace,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"message"},
|
||||
Identity{"error"},
|
||||
Identity{"stackTrace"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool ErrorReport::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[errMessage], errMessage, element },
|
||||
{ fieldID[errInfo], errInfo, element },
|
||||
{ fieldID[errTrace], errTrace, element },
|
||||
},
|
||||
}.withType(&typeid(ErrorReport)));
|
||||
return true;
|
||||
} //ErrorReport::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique ErrorReport::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(ErrorReport))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case errMessage:
|
||||
return std::make_unique<ValueWrap<String>>(message);
|
||||
case errInfo:
|
||||
return std::make_unique<ValueWrap<String>>(error);
|
||||
case errTrace:
|
||||
return std::make_unique<ValueWrap<String>>(stackTrace);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //ErrorReport::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void ErrorReport::setDefault() {
|
||||
message.clear();
|
||||
error.clear();
|
||||
stackTrace.clear();
|
||||
} //ErrorReport::setDefault
|
||||
@@ -1,61 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Information about a runtime error, typically extracted from an exception
|
||||
*/
|
||||
class ErrorReport : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param mess The project location
|
||||
@param err The project name
|
||||
@param trace A unique, persistent ID for the project document
|
||||
*/
|
||||
ErrorReport(const speckle::utility::String& mess = {}, const speckle::utility::String& err = {}, const speckle::utility::String& trace = {}) :
|
||||
base{}, message{mess}, error{err}, stackTrace{trace} {}
|
||||
|
||||
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
|
||||
|
||||
///The exception message, i.e. what happened
|
||||
speckle::utility::String message;
|
||||
///The exception details (name? - use is not clear)
|
||||
speckle::utility::String error;
|
||||
///Stack trace to where the exception was thrown
|
||||
speckle::utility::String stackTrace; //TODO: Not currently implemented - can add when required
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
|
||||
#define SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
|
||||
|
||||
#include "Speckle/Interface/Browser/JSBinding.h"
|
||||
|
||||
#ifdef ARCHICAD
|
||||
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
|
||||
|
||||
#include <Ref.hpp>
|
||||
#include <JSValues.hpp>
|
||||
#else
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#endif
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
///Define the bridge binding protocols according to platform
|
||||
#ifdef ARCHICAD
|
||||
//Archicad uses a proprietary JS::Base type for JS values
|
||||
using PlatformBinding = JSBinding<GS::Ref<JS::Base>, speckle::serialise::jsbase::JSBaseTransport>;
|
||||
#else
|
||||
//All others will use JSON (in a String)
|
||||
using PlatformBinding = JSBinding<String, JSONTransport>;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
|
||||
@@ -12,9 +12,10 @@ using namespace speckle::interfac::browser::bridge;
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
GetBindingsMethodNames::GetBindingsMethodNames() : JSFunction{"GetBindingsMethodNames", [&]() {
|
||||
return getMethodNames();
|
||||
}} {
|
||||
GetBindingsMethodNames::GetBindingsMethodNames(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"GetBindingsMethodNames", [&]() {
|
||||
return getMethodNames();
|
||||
}} {
|
||||
} //GetBindingsMethodNames::GetBindingsMethodNames
|
||||
|
||||
|
||||
@@ -24,5 +25,5 @@ GetBindingsMethodNames::GetBindingsMethodNames() : JSFunction{"GetBindingsMethod
|
||||
return: The supported method names
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<WrappedValue> GetBindingsMethodNames::getMethodNames() const {
|
||||
return (hasBridge()) ? std::make_unique<WrappedValue>(getBridge()->getMethodNames()) : nullptr;
|
||||
return std::make_unique<WrappedValue>(m_bridge.getMethodNames());
|
||||
} //GetBindingsMethodNames::getMethodNames
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "Active/Serialise/Package/Wrapper/ValueSettingWrap.h"
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Interface/Browser/JSFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
@@ -16,15 +15,16 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetBindingsMethodNames : public JSFunction<void, WrappedValue, PlatformBinding>, public BridgeChild {
|
||||
class GetBindingsMethodNames : public JSFunction<void, WrappedValue, PlatformBinding> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetBindingsMethodNames();
|
||||
GetBindingsMethodNames(BrowserBridge& bridge);
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -32,6 +32,9 @@ namespace speckle::interfac::browser::bridge {
|
||||
@return The supported method names
|
||||
*/
|
||||
std::unique_ptr<WrappedValue> getMethodNames() const;
|
||||
|
||||
///Methods supported by the bridge
|
||||
BrowserBridge& m_bridge;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,10 +20,13 @@ using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
GetCallResult::GetCallResult() : JSFunction{"GetCallResult", [&](auto args) {
|
||||
return getResult(args);
|
||||
}} {
|
||||
GetCallResult::GetCallResult(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"GetCallResult", [&](auto args) {
|
||||
return getResult(args);
|
||||
}} {
|
||||
} //GetCallResult::GetCallResult
|
||||
|
||||
|
||||
@@ -35,15 +38,12 @@ GetCallResult::GetCallResult() : JSFunction{"GetCallResult", [&](auto args) {
|
||||
return: The requested result (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<WrappedResultArg> GetCallResult::getResult(WrappedResultArg& argument) const {
|
||||
if (!hasBridge())
|
||||
return nullptr;
|
||||
//Retrieve the requested result
|
||||
using namespace json;
|
||||
auto result = getBridge()->releaseResult(argument);
|
||||
//Confirm argument type
|
||||
auto result = m_bridge.releaseResult(argument);
|
||||
auto item = dynamic_cast<Cargo*>(result.get());
|
||||
if (!item)
|
||||
return nullptr;
|
||||
String jsonOutput;
|
||||
JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
|
||||
json::JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
|
||||
return std::make_unique<WrappedResultArg>(jsonOutput);
|
||||
} //GetCallResult::getResult
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Interface/Browser/JSFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
@@ -18,15 +17,21 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Function to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding>, public BridgeChild {
|
||||
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetCallResult();
|
||||
GetCallResult(BrowserBridge& bridge);
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
GetCallResult(const GetCallResult& source) = default;
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -35,6 +40,9 @@ namespace speckle::interfac::browser::bridge {
|
||||
@return The requested result (nullptr on failure)
|
||||
*/
|
||||
std::unique_ptr<WrappedResultArg> getResult(WrappedResultArg& argument) const;
|
||||
|
||||
///The parent browser bridge
|
||||
BrowserBridge& m_bridge;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/RunMethod.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Null.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/ErrorReport.h"
|
||||
#include "Speckle/Utility/Exception.h"
|
||||
|
||||
#ifdef ARCHICAD
|
||||
#include <ACAPinc.h>
|
||||
@@ -13,65 +8,12 @@
|
||||
#endif
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::serialise::jsbase;
|
||||
using namespace speckle::interfac::browser;
|
||||
using namespace speckle::interfac::browser::bridge;
|
||||
using namespace speckle::serialise::jsbase;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Default error message used when no description is available from the exception
|
||||
const char* defaultError = "An unidentified exception was thrown";
|
||||
|
||||
/*!
|
||||
Format the error message from an exception thrown during bridge method execution
|
||||
@param message The exception error message (what happened)
|
||||
@param argument The method argument (also carries the method name etc)
|
||||
@return The formatted message
|
||||
*/
|
||||
String formattedErrorMessage(const String& message, const BridgeArgument& argument) {
|
||||
return "Exception thrown by the Speckle connector executing method '" + argument.getMethodName() + "': \"" + message + "\"";
|
||||
} //formattedErrorMessage
|
||||
|
||||
|
||||
/*!
|
||||
Execute a bridge method using a specified argument
|
||||
@param bridge The bridge
|
||||
@param method The bridge method to execute
|
||||
@param argument The method argument
|
||||
*/
|
||||
void executeMethod(BrowserBridge& bridge, Functional<>& method, BridgeArgument& argument) {
|
||||
std::optional<ErrorReport> errorReport;
|
||||
//If the argument validation failed (during deserialisation) then we simply fill in the exception report without running the method
|
||||
if (argument.hasError())
|
||||
errorReport = ErrorReport{argument.errorMessage().value_or(String{})};
|
||||
else {
|
||||
try {
|
||||
//Execute the method with the supplied argument
|
||||
auto result = method.execute(argument);
|
||||
//Cache the result in the bridge as required (when we have a request ID and a non-void result)
|
||||
if (!argument.getRequestID().empty()) {
|
||||
if (!result)
|
||||
result = std::make_unique<Null>(); //Callers need a null response even if the function has no return value
|
||||
bridge.cacheResult(std::move(result), argument.getRequestID());
|
||||
}
|
||||
return;
|
||||
} catch(std::runtime_error e) {
|
||||
//NB: This will capture the response from both Speckle and low-level system/runtime error exceptions
|
||||
errorReport = ErrorReport{e.what(), typeid(e).name()};
|
||||
} catch(...) {}
|
||||
}
|
||||
//This point is only reached in error conditions - ensure a response is provided if it hasn't been establishd already
|
||||
if (!errorReport)
|
||||
errorReport = ErrorReport{defaultError};
|
||||
errorReport->message = formattedErrorMessage(errorReport->message, argument);
|
||||
//Cache the error report to be sent back to the JS caller against the request ID
|
||||
bridge.cacheResult(std::make_unique<CargoHold<PackageWrap, ErrorReport>>(*errorReport), argument.getRequestID());
|
||||
} //executeMethod
|
||||
|
||||
|
||||
///NB: The following is an Archicad-specific method for executing a function asynchronously within the app event queue
|
||||
///Implement for other platforms as required
|
||||
#ifdef ARCHICAD
|
||||
/*!
|
||||
Scheduled task to execute a browser bridge method in the Archicad event queue
|
||||
@@ -84,15 +26,17 @@ namespace {
|
||||
@param method The bridge method to execute
|
||||
@param argument The method argument
|
||||
*/
|
||||
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<BridgeArgument> argument) :
|
||||
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<JSBridgeArgument> argument) :
|
||||
m_bridge{bridge}, m_method{method}, m_argument{argument} {}
|
||||
|
||||
/*!
|
||||
Execute the function and (when required) cache the result or an error report
|
||||
Execute the function and (when required) cache the result
|
||||
*/
|
||||
void Run() override {
|
||||
if (m_argument)
|
||||
executeMethod(m_bridge, m_method, *m_argument);
|
||||
auto result = m_method.execute(*m_argument);
|
||||
//Cache the result in the bridge as required
|
||||
if (result && !m_argument->getRequestID().empty())
|
||||
m_bridge.cacheResult(std::move(result), m_argument->getRequestID());
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -101,7 +45,7 @@ namespace {
|
||||
///The bridge method to execute
|
||||
Functional<>& m_method;
|
||||
///The method argument
|
||||
std::shared_ptr<BridgeArgument> m_argument;
|
||||
std::shared_ptr<JSBridgeArgument> m_argument;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -109,10 +53,11 @@ namespace {
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
RunMethod::RunMethod() : JSFunction{"RunMethod", [&](auto args) {
|
||||
runMethod(args);
|
||||
}} {
|
||||
RunMethod::RunMethod(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"RunMethod", [&](auto args) { runMethod(args); }} {
|
||||
} //RunMethod::RunMethod
|
||||
|
||||
|
||||
@@ -121,18 +66,18 @@ RunMethod::RunMethod() : JSFunction{"RunMethod", [&](auto args) {
|
||||
|
||||
arguments: The method arguments
|
||||
--------------------------------------------------------------------*/
|
||||
void RunMethod::runMethod(BridgeArgumentWrap& argument) const {
|
||||
void RunMethod::runMethod(JSBridgeArgumentWrap& argument) const {
|
||||
//Confirm argument and function validity
|
||||
if (!argument || !hasBridge())
|
||||
if (!argument)
|
||||
return;
|
||||
auto method = getBridge()->getMethod(argument.getMethodName());
|
||||
auto method = m_bridge.getMethod(argument.getMethodName());
|
||||
if (method == nullptr)
|
||||
return;
|
||||
//NB: Implement the equivalent run scheduling for other platforms as required
|
||||
#ifdef ARCHICAD
|
||||
GS::MessageLoopExecutor executor;
|
||||
try {
|
||||
executor.Execute(new RunBrowserMethod(*getBridge(), *method, argument.get()));
|
||||
executor.Execute(new RunBrowserMethod(m_bridge, *method, argument.get()));
|
||||
}
|
||||
catch (...) {}
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Interface/Browser/JSFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
@@ -13,22 +12,31 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Function to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class RunMethod : public JSFunction<BridgeArgumentWrap, void, PlatformBinding>, public BridgeChild {
|
||||
class RunMethod : public JSFunction<JSBridgeArgumentWrap, void, PlatformBinding> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
RunMethod();
|
||||
RunMethod(BrowserBridge& bridge);
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
RunMethod(const RunMethod& source) = default;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Run a specified bridge method
|
||||
@param argument The method arguments
|
||||
*/
|
||||
void runMethod(BridgeArgumentWrap& argument) const;
|
||||
void runMethod(JSBridgeArgumentWrap& argument) const;
|
||||
|
||||
///The parent browser bridge
|
||||
BrowserBridge& m_bridge;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::interfac::browser::bridge;
|
||||
@@ -11,9 +11,9 @@ using namespace speckle::interfac::browser::bridge;
|
||||
|
||||
return: True if items have been added to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool BridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
|
||||
bool JSBridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
|
||||
return true;
|
||||
} //BridgeArgument::fillInventory
|
||||
} //JSBridgeArgument::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -23,13 +23,13 @@ bool BridgeArgument::fillInventory(active::serialise::Inventory& inventory) cons
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique BridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
|
||||
Cargo::Unique JSBridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
|
||||
return nullptr;
|
||||
} //BridgeArgument::getCargo
|
||||
} //JSBridgeArgument::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void BridgeArgument::setDefault() {
|
||||
} //BridgeArgument::setDefault
|
||||
void JSBridgeArgument::setDefault() {
|
||||
} //JSBridgeArgument::setDefault
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Base class for the argments passed from JavaScript to a named C++ method in a Speckle bridging object
|
||||
|
||||
NB: The JSBridgeArgumentWrap class will:
|
||||
- Deserialise the essential attributes for determining the target method and arguments;
|
||||
- Create the correct JSBridgeArgument subclass for the emthod/argument and populate it with the collected attributes
|
||||
Therefore, there is no need for this class to handle any deserialisation, and subclasses should only handle the core arguments data
|
||||
*/
|
||||
class JSBridgeArgument : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
JSBridgeArgument() {}
|
||||
/*!
|
||||
Constructor
|
||||
@param methodName The name of the method to receive the argument
|
||||
@param requestID An ID to be paired with the method return value
|
||||
*/
|
||||
JSBridgeArgument(const speckle::utility::String& methodName,
|
||||
const speckle::utility::String& requestID) : m_methodName{methodName}, m_requestID{requestID} {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~JSBridgeArgument() {}
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the name of the method to receive the arguments
|
||||
@return The method name
|
||||
*/
|
||||
const speckle::utility::String& getMethodName() const { return m_methodName; }
|
||||
/*!
|
||||
Get the request ID from the JS caller (to be paired with the method result)
|
||||
@return The request ID
|
||||
*/
|
||||
const speckle::utility::String& getRequestID() const { return m_requestID; }
|
||||
/*!
|
||||
Fill an inventory with the cargo items
|
||||
@param inventory The inventory to receive the cargo items
|
||||
@return True if items have been added to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
private:
|
||||
///The name of the method to receive the argument
|
||||
speckle::utility::String m_methodName;
|
||||
///An ID to be paired with the method return value
|
||||
speckle::utility::String m_requestID;
|
||||
};
|
||||
|
||||
///Definition of the argument for a JS callable method (enclosing the local function argument)
|
||||
template<typename T>
|
||||
class JSArgType : public JSBridgeArgument {
|
||||
public:
|
||||
using JSBridgeArgument::JSBridgeArgument;
|
||||
T value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
|
||||
@@ -0,0 +1,127 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
|
||||
#include "Active/Serialise/Inventory/Inventory.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
///Factory functions to construct arguments from linked bridge/method names
|
||||
std::unordered_map<speckle::utility::String, JSBridgeArgumentWrap::Production> JSBridgeArgumentWrap::m_argumentFactory;
|
||||
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
using enum active::serialise::Entry::Type;
|
||||
|
||||
///The indices of the package items
|
||||
enum FieldIndex {
|
||||
args,
|
||||
};
|
||||
|
||||
|
||||
///The indices of the arguments array rows
|
||||
enum RowIndex {
|
||||
methodName,
|
||||
requestID,
|
||||
argsJSON,
|
||||
};
|
||||
|
||||
|
||||
///The package inventory
|
||||
auto myInventory = Inventory {
|
||||
{
|
||||
{ {"arg"}, args, 0, std::nullopt, true }, //The JS arguments are expressed as a flat array - use the array indices to map to expected vars
|
||||
},
|
||||
}.withType(&typeid(JSBridgeArgumentWrap));;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Destructor
|
||||
--------------------------------------------------------------------*/
|
||||
JSBridgeArgumentWrap::~JSBridgeArgumentWrap() {
|
||||
} //JSBridgeArgumentWrap::~JSBridgeArgumentWrap
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the cargo items
|
||||
|
||||
inventory: The inventory to receive the cargo items
|
||||
|
||||
return: True if items have been added to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool JSBridgeArgumentWrap::fillInventory(Inventory& inventory) const {
|
||||
inventory.merge(myInventory);
|
||||
return true;
|
||||
} //JSBridgeArgumentWrap::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique JSBridgeArgumentWrap::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(JSBridgeArgumentWrap))
|
||||
return nullptr;
|
||||
switch (item.index) {
|
||||
case FieldIndex::args: {
|
||||
switch (item.available - 1) { //NB: Args are not labelled - in this instance we use the array row index to couple to an argument var
|
||||
case RowIndex::methodName:
|
||||
return std::make_unique<ValueWrap<String>>(m_methodName);
|
||||
case RowIndex::requestID:
|
||||
return std::make_unique<ValueWrap<String>>(m_requestID);
|
||||
case RowIndex::argsJSON:
|
||||
return std::make_unique<ValueWrap<String>>(m_argsJSON);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //JSBridgeArgumentWrap::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void JSBridgeArgumentWrap::setDefault() {
|
||||
m_methodName.clear();
|
||||
m_requestID.clear();
|
||||
m_argsJSON.clear();
|
||||
m_argument.reset(); //This will be populated once the target bridge and method are known (and hence the required argument type)
|
||||
} //JSBridgeArgumentWrap::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Validate the cargo data
|
||||
|
||||
return: True if the data has been validated
|
||||
--------------------------------------------------------------------*/
|
||||
bool JSBridgeArgumentWrap::validate() {
|
||||
//Build an argument with the attributes obtained of none exists
|
||||
if (!m_argument)
|
||||
finaliseArgument();
|
||||
//Then ensure the argument object is valid
|
||||
return m_argument->validate();
|
||||
} //JSBridgeArgumentWrap::validate
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Finalise the output argument object based on the current object, method etc
|
||||
--------------------------------------------------------------------*/
|
||||
void JSBridgeArgumentWrap::finaliseArgument() const {
|
||||
//Use the deserialised target bridge and method to establish the required arguments (if any)
|
||||
m_argument.reset(JSBridgeArgumentWrap::makeArgument(m_requestID, m_argsJSON));
|
||||
//If the function doesn't take an argument, we still need to pass along the base class with object name, method etc
|
||||
if (!m_argument)
|
||||
m_argument = std::make_unique<JSBridgeArgument>(m_methodName, m_requestID);
|
||||
} //JSBridgeArgumentWrap::finaliseArgument
|
||||
+25
-24
@@ -2,13 +2,13 @@
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_WRAP
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
class BridgeArgument;
|
||||
class JSBridgeArgument;
|
||||
|
||||
/*!
|
||||
Factory function to make an argument object
|
||||
@@ -19,11 +19,7 @@ namespace speckle::interfac::browser::bridge {
|
||||
template<typename T>
|
||||
void* constructArgument(const speckle::utility::String& method, const speckle::utility::String& request) {
|
||||
try {
|
||||
auto result = new T(method, request);
|
||||
//Tag the argument object as a template where possible
|
||||
if (auto arg = dynamic_cast<ArgumentBase*>(result); arg != nullptr)
|
||||
arg->setArgumentTemplate(true);
|
||||
return result;
|
||||
return new T(method, request);
|
||||
} catch(...) {
|
||||
return nullptr; //Object constructors should throw an exception if incoming data isn't viable (NB: only use for unrecoverable problems)
|
||||
}
|
||||
@@ -32,7 +28,7 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Wrapper for bridge function arguments, determing the target requirement on demand
|
||||
*/
|
||||
class BridgeArgumentWrap : public active::serialise::Package {
|
||||
class JSBridgeArgumentWrap : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -40,31 +36,31 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
BridgeArgumentWrap() {}
|
||||
JSBridgeArgumentWrap() {}
|
||||
/*!
|
||||
Copy constructor
|
||||
*/
|
||||
BridgeArgumentWrap(const BridgeArgumentWrap&) = default;
|
||||
JSBridgeArgumentWrap(const JSBridgeArgumentWrap&) = default;
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~BridgeArgumentWrap();
|
||||
~JSBridgeArgumentWrap();
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
/*!
|
||||
Conversion operator
|
||||
@return True if the argument is populated
|
||||
@return True if the arguments are populated
|
||||
*/
|
||||
operator bool() { return m_argument.operator bool(); }
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the bridge function argument
|
||||
@return The bridge argument (nullptr on failure)
|
||||
Get the bridge function arguments
|
||||
@return The bridge arguments (nullptr on failure)
|
||||
*/
|
||||
std::shared_ptr<BridgeArgument> get() const { return m_argument; }
|
||||
std::shared_ptr<JSBridgeArgument> get() const { return m_argument; }
|
||||
/*!
|
||||
Get the associated method name for the argument
|
||||
@return The method name (empty on failure)
|
||||
@@ -75,6 +71,11 @@ namespace speckle::interfac::browser::bridge {
|
||||
@return The request ID (empty on failure)
|
||||
*/
|
||||
speckle::utility::String getRequestID() const { return m_argument ? m_argument->getRequestID() : speckle::utility::String{}; }
|
||||
/*!
|
||||
Get the function argument (as a JSON string, expected to contain the argument values in an array)
|
||||
@return The function argument (expressed as "[]" for functions that take no arguments)
|
||||
*/
|
||||
speckle::utility::String getArgJSON() const { return m_argsJSON; }
|
||||
|
||||
// MARK: - Functions (serialisation)
|
||||
|
||||
@@ -102,20 +103,20 @@ namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Make an argument object for a specified bridge method
|
||||
@param methodID The name of the target method
|
||||
@param requestID The ID of the request
|
||||
@param argument The method argument data (serialised)
|
||||
@param method The name of the target method
|
||||
@return An argument object (nullptr on failure)
|
||||
*/
|
||||
static std::unique_ptr<BridgeArgument> makeArgument(const speckle::utility::String& methodID,
|
||||
const speckle::utility::String& requestID,
|
||||
const speckle::utility::String& argument);
|
||||
static JSBridgeArgument* makeArgument(const speckle::utility::String& method, const speckle::utility::String& request) {
|
||||
if (auto maker = m_argumentFactory.find(method); (maker != m_argumentFactory.end()))
|
||||
return reinterpret_cast<JSBridgeArgument*>(maker->second(method, request));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
Add a factory method for constructing the arguments of a specified bridge method
|
||||
@param method The name of the target method
|
||||
*/
|
||||
template<typename T> requires std::is_base_of_v<BridgeArgument, T>
|
||||
template<typename T> requires std::is_base_of_v<JSBridgeArgument, T>
|
||||
static void defineArgument(const speckle::utility::String& method) {
|
||||
m_argumentFactory[method] = constructArgument<T>;
|
||||
}
|
||||
@@ -135,10 +136,10 @@ namespace speckle::interfac::browser::bridge {
|
||||
speckle::utility::String m_methodName;
|
||||
///An ID to be paired with the method return value
|
||||
speckle::utility::String m_requestID;
|
||||
///The function arguments as JSON
|
||||
///the function arguments as JSON
|
||||
speckle::utility::String m_argsJSON;
|
||||
///The wrapped function arguments
|
||||
mutable std::shared_ptr<BridgeArgument> m_argument;
|
||||
mutable std::shared_ptr<JSBridgeArgument> m_argument;
|
||||
};
|
||||
|
||||
}
|
||||
+8
-9
@@ -3,9 +3,8 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/JSObject.h"
|
||||
#include "Speckle/Interface/Browser/NamedFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethodBase.h"
|
||||
|
||||
#ifdef ARCHICAD
|
||||
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
|
||||
@@ -19,12 +18,12 @@
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Base class for any method provided by a Speckle JS bridge object
|
||||
A class to provide JS bridging for Speckle connectors using a table of defined methods
|
||||
@tparam Argument The function parameter type
|
||||
@tparam Return The function return type
|
||||
*/
|
||||
template<typename Argument, typename Return>
|
||||
class BridgeMethod : public NamedFunction<Argument, Return>, public virtual BridgeMethodBase {
|
||||
class JSBridgeMethod : public NamedFunction<Argument, Return>, public virtual JSBridgeMethodBase {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
@@ -40,12 +39,12 @@ namespace speckle::interfac::browser::bridge {
|
||||
@param name The function name
|
||||
@param function The C++ function bound to the name
|
||||
*/
|
||||
BridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
|
||||
JSBridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
BridgeMethod(const BridgeMethod& source) = default;
|
||||
JSBridgeMethod(const JSBridgeMethod& source) = default;
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
@@ -54,9 +53,9 @@ namespace speckle::interfac::browser::bridge {
|
||||
@param bridge The target bridge name
|
||||
@return A reference to this
|
||||
*/
|
||||
BridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
|
||||
JSBridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
|
||||
if constexpr(!std::same_as<Argument, void>)
|
||||
BridgeArgumentWrap::defineArgument<Argument>(base::getName());
|
||||
JSBridgeArgumentWrap::defineArgument<Argument>(base::getName());
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
+2
-3
@@ -2,21 +2,20 @@
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_METHOD_BASE
|
||||
|
||||
#include "Speckle/Utility/String.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Interface for methods supporting a JS bridge
|
||||
*/
|
||||
class BridgeMethodBase : public BridgeChild {
|
||||
class JSBridgeMethodBase {
|
||||
public:
|
||||
/*!
|
||||
Register the method argument type for a specified bridge
|
||||
@param bridge The target bridge name
|
||||
@return A reference to this
|
||||
*/
|
||||
virtual BridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
|
||||
virtual JSBridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Active/Serialise/Inventory/Identity.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ItemWrap.h"
|
||||
#include "Active/Serialise/Package/NullPackage.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Speckle/Interface/Browser/JSBinding.h"
|
||||
#include "Speckle/Interface/Browser/NamedFunction.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
@@ -19,7 +19,7 @@ namespace speckle::interfac::browser {
|
||||
Interface for a C++ function binding to a JavaScript function
|
||||
@tparam Argument The function parameter type
|
||||
@tparam Return The function return type
|
||||
@tparam Binding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
|
||||
@tparam Binding The platform JS binding
|
||||
*/
|
||||
template<typename Argument, typename Return, typename Binding>
|
||||
class JSFunction : public NamedFunction<Argument, Return>, public Binding {
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace speckle::interfac::browser {
|
||||
|
||||
/*!
|
||||
Interface for a JavaScript object binding to C++ functions
|
||||
@tparam FunctionBinding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
|
||||
@tparam FunctionBinding The platform JS binding
|
||||
*/
|
||||
template<typename FunctionBinding = PlatformBinding>
|
||||
class JSObject : public std::vector<std::shared_ptr<FunctionBinding>> {
|
||||
@@ -56,7 +56,7 @@ namespace speckle::interfac::browser {
|
||||
void setPortal(const JSPortal<FunctionBinding>& portal) { m_portal = &portal; }
|
||||
|
||||
protected:
|
||||
///The parent JS portal for this object
|
||||
///The
|
||||
const JSPortal<FunctionBinding>* m_portal = nullptr;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef SPECKLE_INTERFACE_JS_PORTAL
|
||||
#define SPECKLE_INTERFACE_JS_PORTAL
|
||||
|
||||
#include "Speckle/Environment/Platform.h"
|
||||
#include "Speckle/Interface/Browser/JSObject.h"
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
@@ -10,8 +9,6 @@
|
||||
#include <JavascriptEngine.hpp>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace speckle::interfac::browser {
|
||||
|
||||
/*!
|
||||
@@ -49,13 +46,6 @@ namespace speckle::interfac::browser {
|
||||
@return True if the object was successfully installed
|
||||
*/
|
||||
bool install(std::shared_ptr<JSObject<FunctionBinding>> object);
|
||||
/*!
|
||||
Install a JS function object
|
||||
@return True if the object was successfully installed
|
||||
@tparam T The type of object to install
|
||||
*/
|
||||
template<typename T> requires std::is_base_of_v<JSObject<FunctionBinding>, T>
|
||||
bool install() { return install(std::make_shared<T>()); }
|
||||
|
||||
protected:
|
||||
#ifdef ARCHICAD
|
||||
@@ -80,9 +70,6 @@ namespace speckle::interfac::browser {
|
||||
#ifdef ARCHICAD
|
||||
try {
|
||||
auto engine = getJSEngine();
|
||||
#ifdef DEBUG
|
||||
speckle::environment::platform()->writeToConsole("\nExecuted:\n" + code + "\n");
|
||||
#endif
|
||||
auto result = engine ? engine->ExecuteJS(code) : false;
|
||||
return result;
|
||||
} catch(...) {
|
||||
@@ -107,13 +94,10 @@ namespace speckle::interfac::browser {
|
||||
auto engine = getJSEngine();
|
||||
if (!engine)
|
||||
return false;
|
||||
//Define the JS object
|
||||
JS::Object* acObject = new JS::Object(object->getName());
|
||||
//Add all the functions supported by this object
|
||||
for (auto& function : *object) {
|
||||
acObject->AddItem(new JS::Function(function->getName(), [&](GS::Ref<JS::Base> args) {
|
||||
acObject->AddItem(new JS::Function(function->getName(), [&] (GS::Ref<JS::Base> args) {
|
||||
try {
|
||||
//NB: All JS functions enter at this point
|
||||
return function->execute(args);
|
||||
} catch(...) {
|
||||
///TODO: Need to discuss the best course of action to notify of a failure
|
||||
@@ -121,7 +105,6 @@ namespace speckle::interfac::browser {
|
||||
return GS::Ref<JS::Base>{};
|
||||
}));
|
||||
}
|
||||
//And finally register the object
|
||||
if (engine->RegisterAsynchJSObject(acObject)) {
|
||||
base::push_back(object);
|
||||
object->setPortal(*this);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace speckle::interfac::browser {
|
||||
|
||||
///Define the bridge binding protocols according to platform (argument/result serialisation and transport for (de)serialisation)
|
||||
///Define the bridge binding protocols according to platform
|
||||
#ifdef ARCHICAD
|
||||
//Archicad uses a proprietary JS::Base type for JS values
|
||||
using PlatformBinding = JSBinding<GS::Ref<JS::Base>, speckle::serialise::jsbase::JSBaseTransport>;
|
||||
|
||||
@@ -1,97 +1,38 @@
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::utility;
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
tokenID,
|
||||
refreshTokenID,
|
||||
isDefaultID,
|
||||
isOnlineID,
|
||||
serverInfoID,
|
||||
userInfoID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"token"},
|
||||
Identity{"refreshToken"},
|
||||
Identity{"isDefault"},
|
||||
Identity{"isOnline"},
|
||||
Identity{"serverInfo"},
|
||||
Identity{"userInfo"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
Account::Account(const String& ID) : base{ID} {
|
||||
Account::Account(Guid ID) : Record{ID} {
|
||||
//TODO: Complete
|
||||
} //Account::Account
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool Account::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[tokenID], tokenID, element },
|
||||
{ fieldID[refreshTokenID], refreshTokenID, element },
|
||||
{ fieldID[isDefaultID], isDefaultID, element },
|
||||
{ fieldID[isOnlineID], isOnlineID, element },
|
||||
{ fieldID[serverInfoID], serverInfoID, element },
|
||||
{ fieldID[userInfoID], userInfoID, element },
|
||||
},
|
||||
}.withType(&typeid(Account)));
|
||||
return base::fillInventory(inventory);
|
||||
//TODO: Complete
|
||||
return true;
|
||||
} //Account::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(Account))
|
||||
return base::getCargo(item);
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case tokenID:
|
||||
return std::make_unique<ValueWrap<String>>(m_token);
|
||||
case refreshTokenID:
|
||||
return std::make_unique<ValueWrap<String>>(m_refreshToken);
|
||||
case isDefaultID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_isDefault);
|
||||
case isOnlineID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_isOnline);
|
||||
case serverInfoID:
|
||||
return std::make_unique<PackageWrap>(m_serverInfo);
|
||||
case userInfoID:
|
||||
return std::make_unique<PackageWrap>(m_userInfo);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
//TODO: Complete
|
||||
return nullptr;
|
||||
} //Account::getCargo
|
||||
|
||||
|
||||
@@ -99,8 +40,16 @@ Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void Account::setDefault() {
|
||||
m_token.clear();
|
||||
m_refreshToken.clear();
|
||||
m_isDefault = false;
|
||||
m_isOnline = true;
|
||||
//TODO: Complete
|
||||
} //Account::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Validate the cargo data
|
||||
|
||||
return: True if the data has been validated
|
||||
--------------------------------------------------------------------*/
|
||||
bool Account::validate() {
|
||||
//TODO: Complete
|
||||
return true;
|
||||
} //Account::validate
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include "Active/Setting/SettingList.h"
|
||||
#include "Speckle/Database/Content/Record.h"
|
||||
#include "Speckle/Record/Credentials/ServerInfo.h"
|
||||
#include "Speckle/Record/Credentials/UserInfo.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::record::cred {
|
||||
@@ -33,19 +31,13 @@ namespace speckle::record::cred {
|
||||
Default constructor
|
||||
@param ID The account record ID
|
||||
*/
|
||||
Account(const speckle::utility::String& ID = speckle::utility::String{});
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
Account(const Account&) = default;
|
||||
Account(speckle::utility::Guid ID = speckle::utility::Guid{});
|
||||
/*!
|
||||
Object cloning
|
||||
@return A clone of this object
|
||||
*/
|
||||
Account* clonePtr() const override { return new Account{*this}; }
|
||||
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
@@ -68,6 +60,11 @@ namespace speckle::record::cred {
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
/*!
|
||||
Validate the cargo data
|
||||
@return True if the data has been validated
|
||||
*/
|
||||
bool validate() override;
|
||||
|
||||
private:
|
||||
///Authorisation token
|
||||
@@ -79,9 +76,9 @@ namespace speckle::record::cred {
|
||||
///True if the account is online
|
||||
bool m_isOnline = true;
|
||||
///Account server info
|
||||
ServerInfo m_serverInfo;
|
||||
///Account user info
|
||||
UserInfo m_userInfo;
|
||||
//std::unique_ptr<ServerInfo> m_serverInfo;
|
||||
///Account server info
|
||||
//std::unique_ptr<UserInfo> m_userInfo;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
#include "Speckle/Record/Credentials/ServerInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageUnoWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
nameID,
|
||||
companyID,
|
||||
versionID,
|
||||
contactID,
|
||||
descriptionID,
|
||||
frontEndID,
|
||||
urlID,
|
||||
migrationID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"name"},
|
||||
Identity{"company"},
|
||||
Identity{"version"},
|
||||
Identity{"adminContact"},
|
||||
Identity{"description"},
|
||||
Identity{"frontend2"},
|
||||
Identity{"url"},
|
||||
Identity{"migration"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool ServerInfo::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[companyID], companyID, element },
|
||||
{ fieldID[versionID], versionID, element },
|
||||
{ fieldID[contactID], contactID, element },
|
||||
{ fieldID[descriptionID], descriptionID, element },
|
||||
{ fieldID[frontEndID], frontEndID, element },
|
||||
{ fieldID[urlID], urlID, element },
|
||||
{ fieldID[migrationID], migrationID, element },
|
||||
},
|
||||
}.withType(&typeid(ServerInfo)));
|
||||
return true;
|
||||
} //ServerInfo::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique ServerInfo::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(ServerInfo))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<StringWrap>(m_name);
|
||||
case companyID:
|
||||
return std::make_unique<StringOptWrap>(m_company);
|
||||
case versionID:
|
||||
return std::make_unique<StringOptWrap>(m_version);
|
||||
case contactID:
|
||||
return std::make_unique<StringOptWrap>(m_adminContact);
|
||||
case descriptionID:
|
||||
return std::make_unique<StringOptWrap>(m_description);
|
||||
case frontEndID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_frontend2);
|
||||
case urlID:
|
||||
return std::make_unique<StringOptWrap>(m_url);
|
||||
case migrationID:
|
||||
return std::make_unique<PackageUnoWrap<ServerMigration>>(m_migration);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //ServerInfo::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void ServerInfo::setDefault() {
|
||||
m_name.clear();
|
||||
m_frontend2 = false;
|
||||
} //ServerInfo::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Copy from another object
|
||||
|
||||
source: The object to copy
|
||||
--------------------------------------------------------------------*/
|
||||
void ServerInfo::copy(const ServerInfo& source) {
|
||||
if (this == &source)
|
||||
return;
|
||||
m_name = source.m_name;
|
||||
m_version = source.m_version;
|
||||
m_adminContact = source.m_adminContact;
|
||||
m_description = source.m_description;
|
||||
m_frontend2 = source.m_frontend2;
|
||||
m_url = source.m_url;
|
||||
m_migration = (source.m_migration) ? std::make_unique<ServerMigration>(*source.m_migration) : nullptr;
|
||||
} //ServerInfo::copy
|
||||
@@ -1,153 +0,0 @@
|
||||
#ifndef SPECKLE_RECORD_CRED_SERVER_INFO
|
||||
#define SPECKLE_RECORD_CRED_SERVER_INFO
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Record/Credentials/ServerMigration.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::record::cred {
|
||||
|
||||
/*!
|
||||
Account server info
|
||||
*/
|
||||
class ServerInfo : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
ServerInfo() {}
|
||||
/*!
|
||||
Constructor
|
||||
@param name The server name
|
||||
@param company The company name
|
||||
@param version The server version
|
||||
@param contact Admin contact email
|
||||
@param description The server description
|
||||
@param url The server URL
|
||||
@param isFrontEnd ?
|
||||
@param migration Server migration record
|
||||
*/
|
||||
ServerInfo(const utility::String& name, const utility::String::Option company = std::nullopt,
|
||||
const utility::String::Option version = std::nullopt, const utility::String::Option contact = std::nullopt,
|
||||
const utility::String::Option description = std::nullopt, const utility::String::Option url = std::nullopt,
|
||||
bool isFrontEnd = false, std::unique_ptr<ServerMigration> migration = nullptr) :
|
||||
m_name{name}, m_company{company}, m_version{version}, m_adminContact{contact}, m_description{description},
|
||||
m_url{url}, m_frontend2{isFrontEnd}, m_migration{std::move(migration)} {}
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
ServerInfo(const ServerInfo& source) { copy(source); }
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~ServerInfo() {}
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
/*!
|
||||
Assignment operator
|
||||
@param source The object to copy
|
||||
*/
|
||||
ServerInfo& operator=(const ServerInfo& source) { copy(source); return *this; }
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the server name
|
||||
@return The server name
|
||||
*/
|
||||
const utility::String& getName() const { return m_name; }
|
||||
/*!
|
||||
Get the company name
|
||||
@return The company name
|
||||
*/
|
||||
const utility::String::Option& getCompany() const { return m_company; }
|
||||
/*!
|
||||
Get the version
|
||||
@return The version
|
||||
*/
|
||||
const utility::String::Option& getVersion() const { return m_version; }
|
||||
/*!
|
||||
Get the admin contact email
|
||||
@return The admin contact email
|
||||
*/
|
||||
const utility::String::Option& getAdminContact() const { return m_adminContact; }
|
||||
/*!
|
||||
Get the description
|
||||
@return The description
|
||||
*/
|
||||
const utility::String::Option& getDescription() const { return m_description; }
|
||||
/*!
|
||||
Determine if ?
|
||||
@return ?
|
||||
*/
|
||||
bool isFrontEnd() const { return m_frontend2; }
|
||||
/*!
|
||||
Get the URL
|
||||
@return The URL
|
||||
*/
|
||||
const utility::String::Option& getURL() const { return m_url; }
|
||||
/*!
|
||||
Get the migration history
|
||||
@return The migration history (nullptr = no history)
|
||||
*/
|
||||
const ServerMigration* getMigration() const { return m_migration.get(); }
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Copy from another object
|
||||
@param source The object to copy
|
||||
*/
|
||||
void copy(const ServerInfo& source);
|
||||
|
||||
///Server name
|
||||
utility::String m_name;
|
||||
///Company name
|
||||
utility::String::Option m_company;
|
||||
///Server version
|
||||
utility::String::Option m_version;
|
||||
///Admin contact email
|
||||
utility::String::Option m_adminContact;
|
||||
///Server description
|
||||
utility::String::Option m_description;
|
||||
/*!
|
||||
This field is not returned from the GQL API, it should be populated after construction from the response headers.
|
||||
See "Speckle.Core.Credentials.AccountManager"
|
||||
*/
|
||||
bool m_frontend2 = false;
|
||||
/*!
|
||||
Server URL
|
||||
This field is not returned from the GQL API, it should be populated after construction.
|
||||
See "Speckle.Core.Credentials.AccountManager"
|
||||
*/
|
||||
utility::String::Option m_url;
|
||||
///Server migration record
|
||||
std::unique_ptr<ServerMigration> m_migration;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_RECORD_CRED_SERVER_INFO
|
||||
@@ -1,66 +0,0 @@
|
||||
#include "Speckle/Record/Credentials/ServerMigration.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::utility;
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
movedToID,
|
||||
movedFromID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"movedTo"},
|
||||
Identity{"movedFrom"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool ServerMigration::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[movedToID], movedToID, element },
|
||||
{ fieldID[movedFromID], movedFromID, element },
|
||||
},
|
||||
}.withType(&typeid(ServerMigration)));
|
||||
return true;
|
||||
} //ServerMigration::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique ServerMigration::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(ServerMigration))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case movedToID:
|
||||
return std::make_unique<StringOptWrap>(movedTo);
|
||||
case movedFromID:
|
||||
return std::make_unique<StringOptWrap>(movedFrom);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //ServerMigration::getCargo
|
||||
@@ -1,60 +0,0 @@
|
||||
#ifndef SPECKLE_RECORD_CRED_SERVER_MIGRATION
|
||||
#define SPECKLE_RECORD_CRED_SERVER_MIGRATION
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::record::cred {
|
||||
|
||||
/*!
|
||||
User account record class
|
||||
*/
|
||||
class ServerMigration : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
///Unique pointer
|
||||
using Unique = std::unique_ptr<ServerMigration>;
|
||||
///Shared pointer
|
||||
using Shared = std::shared_ptr<ServerMigration>;
|
||||
///Optional
|
||||
using Option = std::optional<ServerMigration>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param mvTo New URI where this server is now deployed
|
||||
@param mvFm Previous URI where this server used to be deployed
|
||||
*/
|
||||
ServerMigration(const speckle::utility::String& mvTo = speckle::utility::String{},
|
||||
const speckle::utility::String& mvFm = speckle::utility::String{}) : movedTo{mvTo}, movedFrom{mvFm} {}
|
||||
|
||||
// MARK: - Public variables
|
||||
|
||||
///New URI where this server is now deployed
|
||||
speckle::utility::String::Option movedTo;
|
||||
///Previous URI where this server used to be deployed
|
||||
speckle::utility::String::Option movedFrom;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_RECORD_CRED_SERVER_MIGRATION
|
||||
@@ -1,92 +0,0 @@
|
||||
#include "Speckle/Record/Credentials/UserInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::record::cred;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
idID,
|
||||
nameID,
|
||||
emailID,
|
||||
companyID,
|
||||
avatarID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"id"},
|
||||
Identity{"name"},
|
||||
Identity{"email"},
|
||||
Identity{"company"},
|
||||
Identity{"avatar"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool UserInfo::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[idID], idID, element },
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[emailID], emailID, element },
|
||||
{ fieldID[companyID], companyID, element },
|
||||
{ fieldID[avatarID], avatarID, element },
|
||||
},
|
||||
}.withType(&typeid(UserInfo)));
|
||||
return true;
|
||||
} //UserInfo::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique UserInfo::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(UserInfo))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case idID:
|
||||
return std::make_unique<ValueWrap<String>>(m_id);
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(m_name);
|
||||
case emailID:
|
||||
return std::make_unique<ValueWrap<String>>(m_email);
|
||||
case companyID:
|
||||
return std::make_unique<StringOptWrap>(m_company);
|
||||
case avatarID:
|
||||
return std::make_unique<StringOptWrap>(m_avatar);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //UserInfo::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void UserInfo::setDefault() {
|
||||
m_id.clear();
|
||||
m_name.clear();
|
||||
m_email.clear();
|
||||
} //UserInfo::setDefault
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user