Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eede544f69 | |||
| 7ffe7e3a82 | |||
| e18d967c07 | |||
| 7a3f46f54d | |||
| 05b8e0343c | |||
| 3f285a0fc7 | |||
| 5a2d12e33c | |||
| 03e8798128 | |||
| c64596fb57 | |||
| 4209afa9fa | |||
| 7a01feab57 | |||
| 471e2d5312 | |||
| bb451fbc90 | |||
| bee15b4e77 | |||
| 8b00e88f63 | |||
| 85f12793de | |||
| 485f021c6f | |||
| da9e9c1a67 | |||
| 48d2e11194 | |||
| 2911afa3e7 | |||
| 49aae8d44f | |||
| ec85f534b3 | |||
| d1c314f2ad | |||
| 9a8087b180 | |||
| cf3aa86ee4 | |||
| fca1f0b999 | |||
| 9e22d3b3b8 | |||
| bd0be2bb42 | |||
| c218da359f | |||
| 4202e9f92c | |||
| 9232b205d9 | |||
| 8e0d0f5c27 | |||
| 550e9caa9c | |||
| 2ca1713766 | |||
| 3c5097e950 | |||
| c0e46f1d23 | |||
| 674ef928e0 | |||
| 696a4ea870 |
@@ -21,3 +21,4 @@ CMakeFiles/
|
||||
XCBuildData/
|
||||
**/*.xcsettings
|
||||
*.log
|
||||
.idea
|
||||
@@ -96,17 +96,24 @@
|
||||
<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\UpdateConfig.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>
|
||||
@@ -117,17 +124,24 @@
|
||||
<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\UpdateConfig.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" />
|
||||
@@ -564,7 +578,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<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>
|
||||
<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>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
@@ -593,7 +607,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;%(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;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<IgnoreSpecificDefaultLibraries>msvcrt.lib</IgnoreSpecificDefaultLibraries>
|
||||
@@ -751,7 +765,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<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>
|
||||
<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>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
@@ -781,7 +795,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;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;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;msvcrt.lib;msvcprt.lib;IPHLPAPI.lib;Wininet.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(HEADER_PATH_5)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
|
||||
@@ -38,6 +38,21 @@
|
||||
<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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RFIX.win\Connector.rc2">
|
||||
@@ -80,9 +95,6 @@
|
||||
<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>
|
||||
@@ -92,9 +104,6 @@
|
||||
<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>
|
||||
@@ -113,6 +122,33 @@
|
||||
<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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connector\ConnectorResource.h">
|
||||
@@ -136,9 +172,6 @@
|
||||
<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>
|
||||
@@ -148,9 +181,6 @@
|
||||
<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>
|
||||
@@ -175,5 +205,32 @@
|
||||
<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>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -22,6 +22,7 @@
|
||||
/* 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 */; };
|
||||
@@ -31,10 +32,17 @@
|
||||
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 */; };
|
||||
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 */; };
|
||||
@@ -196,7 +204,6 @@
|
||||
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 */
|
||||
@@ -259,11 +266,13 @@
|
||||
/* 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.vwlibrary */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.vwlibrary"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.bundle"; 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>"; };
|
||||
@@ -275,8 +284,6 @@
|
||||
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>"; };
|
||||
@@ -284,6 +291,22 @@
|
||||
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>"; };
|
||||
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>"; };
|
||||
@@ -461,8 +484,6 @@
|
||||
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 */
|
||||
@@ -644,7 +665,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
213CC3A52B1101F500088049 /* Speckle Connector.bundle */,
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */,
|
||||
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -862,10 +883,9 @@
|
||||
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 */,
|
||||
@@ -905,6 +925,60 @@
|
||||
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 = (
|
||||
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */,
|
||||
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */,
|
||||
);
|
||||
path = Send;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D1EA472BF14B6C00957EAA /* Archicad */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -986,6 +1060,8 @@
|
||||
21F69F852C70D2C4008B6A06 /* Account */,
|
||||
21B67CAB2C77329800FD64FC /* Base */,
|
||||
21F69FB82C762EF0008B6A06 /* Config */,
|
||||
21D0BD5D2C89BFEA0077E104 /* Send */,
|
||||
21B67CD82C78C83800FD64FC /* Test */,
|
||||
);
|
||||
path = Bridge;
|
||||
sourceTree = "<group>";
|
||||
@@ -1001,10 +1077,9 @@
|
||||
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 */,
|
||||
21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */,
|
||||
@@ -1067,7 +1142,7 @@
|
||||
);
|
||||
name = "Connector-AC27-Test";
|
||||
productName = "Connector-AC27-Test";
|
||||
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */;
|
||||
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -1218,22 +1293,29 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21B67CBD2C77537C00FD64FC /* DocumentInfo.cpp in Sources */,
|
||||
21F69FC22C7632B7008B6A06 /* ConnectorConfig.cpp in Sources */,
|
||||
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */,
|
||||
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */,
|
||||
21F69F8A2C70D2C4008B6A06 /* AccountBridge.cpp in Sources */,
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */,
|
||||
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */,
|
||||
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */,
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */,
|
||||
21B67CAC2C77329800FD64FC /* BaseBridge.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;
|
||||
@@ -1333,7 +1415,6 @@
|
||||
"\"$(HEADER_PATH_6)\"",
|
||||
"\"$(HEADER_PATH_8)\"",
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1398,7 +1479,6 @@
|
||||
"\"$(HEADER_PATH_6)\"",
|
||||
"\"$(HEADER_PATH_8)\"",
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1438,6 +1518,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
TESTING_MODE,
|
||||
ARCHICAD,
|
||||
AddOn_EXPORTS,
|
||||
"'macintosh=1'",
|
||||
@@ -1508,7 +1589,6 @@
|
||||
"-multiply_defined",
|
||||
suppress,
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1549,6 +1629,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
TESTING_MODE,
|
||||
ARCHICAD,
|
||||
AddOn_EXPORTS,
|
||||
"'macintosh=1'",
|
||||
@@ -1616,7 +1697,6 @@
|
||||
"-multiply_defined",
|
||||
suppress,
|
||||
);
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1776,7 +1856,7 @@
|
||||
OBJROOT = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PLUGIN_FOLDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
|
||||
PRODUCT_NAME = "$(BASE_NAME)";
|
||||
RESOURCE_EXTENSION = "";
|
||||
REZ_SEARCH_PATHS = (
|
||||
@@ -1803,7 +1883,7 @@
|
||||
suppress,
|
||||
);
|
||||
WORD_SIZE = 64;
|
||||
WRAPPER_EXTENSION = vwlibrary;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1882,7 +1962,7 @@
|
||||
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
|
||||
OBJROOT = "";
|
||||
PLUGIN_FOLDER = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
|
||||
PRODUCT_NAME = "$(BASE_NAME)";
|
||||
RESOURCE_EXTENSION = "";
|
||||
REZ_SEARCH_PATHS = (
|
||||
@@ -1905,7 +1985,7 @@
|
||||
);
|
||||
USE_HEADERMAP = YES;
|
||||
WORD_SIZE = 64;
|
||||
WRAPPER_EXTENSION = vwlibrary;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "219F30342C768F0A009834E9"
|
||||
BuildableName = "Connector-AC27-Test.vwlibrary"
|
||||
BuildableName = "Connector-AC27-Test.bundle"
|
||||
BlueprintName = "Connector-AC27-Test"
|
||||
ReferencedContainer = "container:Connector.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "219F30342C768F0A009834E9"
|
||||
BuildableName = "Connector-AC27-Test.vwlibrary"
|
||||
BuildableName = "Connector-AC27-Test.bundle"
|
||||
BlueprintName = "Connector-AC27-Test"
|
||||
ReferencedContainer = "container:Connector.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
#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:
|
||||
@@ -28,15 +37,34 @@ namespace {
|
||||
Get the model card database
|
||||
@return The model card database
|
||||
*/
|
||||
const ModelCardDatabase* getModelCards() const override { return &m_modelCards; }
|
||||
const ModelCardDatabase* getModelCardDatabase() const override { return &m_modelCards; }
|
||||
/*!
|
||||
Get the account database
|
||||
@return The account database
|
||||
*/
|
||||
const AccountDatabase* getAccountDatabase() const override;
|
||||
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -48,6 +76,32 @@ 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
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::database {
|
||||
class AccountDatabase;
|
||||
}
|
||||
namespace connector::database {
|
||||
|
||||
class ModelCardDatabase;
|
||||
|
||||
}
|
||||
|
||||
namespace connector {
|
||||
@@ -19,7 +20,12 @@ namespace connector {
|
||||
Get the model card database
|
||||
@return The model card database
|
||||
*/
|
||||
const virtual database::ModelCardDatabase* getModelCards() const = 0;
|
||||
const virtual database::ModelCardDatabase* getModelCardDatabase() const = 0;
|
||||
/*!
|
||||
Get the account database
|
||||
@return The account database
|
||||
*/
|
||||
const virtual speckle::database::AccountDatabase* getAccountDatabase() const = 0;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace {
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"model"},
|
||||
Identity{"models"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#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;
|
||||
@@ -19,7 +21,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetAccounts::GetAccounts() : JSBridgeMethod{"GetAccounts", [&]() {
|
||||
GetAccounts::GetAccounts() : BridgeMethod{"GetAccounts", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -29,8 +31,9 @@ GetAccounts::GetAccounts() : JSBridgeMethod{"GetAccounts", [&]() {
|
||||
|
||||
return: The accounts (empty array when none defined)
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetAccounts::run(void) const {
|
||||
std::unique_ptr<Cargo> GetAccounts::run() const {
|
||||
Vector<Account> accounts;
|
||||
///TODO: Get the accounts here - returning an empty array for testing only
|
||||
if (auto accountDBase = connector()->getAccountDatabase(); accountDBase != nullptr)
|
||||
accounts = accountDBase->getAccounts();
|
||||
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/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.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::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetAccounts : public speckle::interfac::browser::bridge::BridgeMethod<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(void) const;
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/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"},
|
||||
};
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetConnectorVersion::GetConnectorVersion() : JSBridgeMethod{"GetConnectorVersion", [&]() {
|
||||
GetConnectorVersion::GetConnectorVersion() : BridgeMethod{"GetConnectorVersion", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
|
||||
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.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::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetConnectorVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/GetDocumentInfo.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
@@ -18,7 +17,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetDocumentInfo::GetDocumentInfo() : JSBridgeMethod{"GetDocumentInfo", [&]() {
|
||||
GetDocumentInfo::GetDocumentInfo() : BridgeMethod{"GetDocumentInfo", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,7 +27,7 @@ GetDocumentInfo::GetDocumentInfo() : JSBridgeMethod{"GetDocumentInfo", [&]() {
|
||||
|
||||
return: The document info
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetDocumentInfo::run(void) const {
|
||||
std::unique_ptr<Cargo> GetDocumentInfo::run() 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/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the information about the active document
|
||||
*/
|
||||
class GetDocumentInfo : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetDocumentInfo : public speckle::interfac::browser::bridge::BridgeMethod<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(void) const;
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#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;
|
||||
@@ -20,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetDocumentState::GetDocumentState() : JSBridgeMethod{"GetDocumentState", [&]() {
|
||||
GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -30,7 +28,7 @@ GetDocumentState::GetDocumentState() : JSBridgeMethod{"GetDocumentState", [&]()
|
||||
|
||||
return: The document info
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetDocumentState::run(void) const {
|
||||
std::unique_ptr<Cargo> GetDocumentState::run() 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/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the information about the active document
|
||||
*/
|
||||
class GetDocumentState : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetDocumentState : public speckle::interfac::browser::bridge::BridgeMethod<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(void) const;
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSourceApplicationName::GetSourceApplicationName() : JSBridgeMethod{"GetSourceApplicationName", [&]() {
|
||||
GetSourceApplicationName::GetSourceApplicationName() : BridgeMethod{"GetSourceApplicationName", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,7 +28,7 @@ GetSourceApplicationName::GetSourceApplicationName() : JSBridgeMethod{"GetSource
|
||||
|
||||
return: The application name
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetSourceApplicationName::run(void) const {
|
||||
std::unique_ptr<Cargo> GetSourceApplicationName::run() 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/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the host application name
|
||||
*/
|
||||
class GetSourceApplicationName : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetSourceApplicationName : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSourceApplicationVersion::GetSourceApplicationVersion() : JSBridgeMethod{"GetSourceApplicationVersion", [&]() {
|
||||
GetSourceApplicationVersion::GetSourceApplicationVersion() : BridgeMethod{"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/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.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::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetSourceApplicationVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -16,7 +17,7 @@ namespace {
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"DarkTheme"},
|
||||
Identity{"darkTheme"},
|
||||
};
|
||||
|
||||
}
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/ArgumentBase.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
@@ -24,7 +25,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
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
@@ -18,7 +18,7 @@ namespace {
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetConfig::GetConfig() : JSBridgeMethod{"GetConfig", [&]() {
|
||||
GetConfig::GetConfig() : BridgeMethod{"GetConfig", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
@@ -28,8 +28,8 @@ GetConfig::GetConfig() : JSBridgeMethod{"GetConfig", [&]() {
|
||||
|
||||
return: The settings
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetConfig::run(void) const {
|
||||
std::unique_ptr<Cargo> GetConfig::run() 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,15 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.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::JSBridgeMethod<void, active::serialise::Cargo> {
|
||||
class GetConfig : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -26,7 +25,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Get the configuration settings
|
||||
@return The settings
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run(void) const;
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.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;
|
||||
@@ -11,8 +10,8 @@ using namespace speckle::utility;
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
UpdateConfig::UpdateConfig() : JSBridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
|
||||
run(args.value);
|
||||
UpdateConfig::UpdateConfig() : BridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
|
||||
run(args);
|
||||
}} {}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_UPDATE_CONFIG
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.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::JSBridgeMethod<UpdateArgs, void> {
|
||||
class UpdateConfig : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
|
||||
//Add bridge methods
|
||||
} //SendBridge::SendBridge
|
||||
@@ -0,0 +1,29 @@
|
||||
#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
|
||||
@@ -0,0 +1,80 @@
|
||||
#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
|
||||
@@ -0,0 +1,55 @@
|
||||
#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
|
||||
@@ -0,0 +1,133 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Test/GetComplexType.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/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
|
||||
@@ -0,0 +1,33 @@
|
||||
#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
|
||||
@@ -0,0 +1,20 @@
|
||||
#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
|
||||
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
@@ -0,0 +1,38 @@
|
||||
#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
|
||||
@@ -0,0 +1,37 @@
|
||||
#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
|
||||
@@ -0,0 +1,19 @@
|
||||
#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
|
||||
@@ -0,0 +1,29 @@
|
||||
#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
|
||||
@@ -0,0 +1,105 @@
|
||||
#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
|
||||
@@ -0,0 +1,39 @@
|
||||
#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
|
||||
@@ -6,6 +6,8 @@
|
||||
#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"
|
||||
@@ -17,9 +19,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
|
||||
@@ -35,7 +37,7 @@ namespace {
|
||||
|
||||
// --- Class declaration: BrowserPalette ------------------------------------------
|
||||
|
||||
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public speckle::interfac::browser::JSPortal<> {
|
||||
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public JSPortal<> {
|
||||
public:
|
||||
enum SelectionModification { RemoveFromSelection, AddToSelection };
|
||||
|
||||
@@ -127,7 +129,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();
|
||||
@@ -164,6 +166,8 @@ BrowserPalette::BrowserPalette() :
|
||||
install(std::make_shared<AccountBridge>());
|
||||
install(std::make_shared<BaseBridge>());
|
||||
install(std::make_shared<ConfigBridge>());
|
||||
//install(std::make_shared<SendBridge>());
|
||||
install(std::make_shared<TestBridge>());
|
||||
InitBrowserControl();
|
||||
}
|
||||
|
||||
@@ -201,7 +205,11 @@ 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 = 1;
|
||||
static const unsigned int versionMinor = 2;
|
||||
|
||||
static const unsigned int versionPatch = 0;
|
||||
static const unsigned int versionPatch = 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#include "Active/Database/Storage/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
|
||||
@@ -0,0 +1,46 @@
|
||||
#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
|
||||
@@ -8,40 +8,17 @@ using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
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
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool Record::fillInventory(Inventory& inventory) const {
|
||||
//TODO: Complete
|
||||
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)));
|
||||
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,19 +1,21 @@
|
||||
#ifndef SPECKLE_DATABASE_RECORD
|
||||
#define SPECKLE_DATABASE_RECORD
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
#include "Active/Database/Content/Record.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
/*!
|
||||
Base class for a database record
|
||||
*/
|
||||
class Record : public active::serialise::Package, public active::utility::Cloner {
|
||||
class Record : public active::database::Record<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
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>;
|
||||
@@ -26,47 +28,17 @@ namespace speckle::database {
|
||||
Constructor
|
||||
@param ID The record ID
|
||||
*/
|
||||
Record(speckle::utility::Guid ID) : m_ID{ID} {}
|
||||
Record(speckle::utility::String ID) : base{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
|
||||
|
||||
@@ -76,31 +48,6 @@ 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{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+4
-10
@@ -1,7 +1,8 @@
|
||||
#ifndef SPECKLE_DATABASE_INDEX
|
||||
#define SPECKLE_DATABASE_INDEX
|
||||
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
#include "Active/Database/Identity/Link.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
@@ -12,23 +13,16 @@ 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 speckle::utility::Guid {
|
||||
class Index : public active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = speckle::utility::Guid;
|
||||
using base = active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
}
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
#include "Speckle/Database/Content/Link.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::utility;
|
||||
|
||||
#ifdef ARCHICAD
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -8,9 +10,9 @@ using namespace speckle::database;
|
||||
|
||||
selected: Information about a selected Archicad element
|
||||
--------------------------------------------------------------------*/
|
||||
Link::Link(const API_Neig& selected) : recordID{selected.guid} {
|
||||
//Link::Link(const API_Neig& selected) : base{Guid{selected.guid}} {
|
||||
//More info should be extracted from API_Neig in future (as required)
|
||||
} //Link::Link
|
||||
//} //Link::Link
|
||||
#endif
|
||||
|
||||
|
||||
+6
-25
@@ -2,7 +2,7 @@
|
||||
#define SPECKLE_DATABASE_LINK
|
||||
|
||||
#include "Active/Setting/SettingList.h"
|
||||
#include "Speckle/Database/Content/Index.h"
|
||||
#include "Speckle/Database/Identity/Index.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
@@ -17,30 +17,18 @@ 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::setting::SettingList {
|
||||
class Link : public active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
|
||||
public:
|
||||
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
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>;
|
||||
|
||||
using base = active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
|
||||
/*!
|
||||
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} {}
|
||||
|
||||
Link() = default;
|
||||
#ifdef ARCHICAD
|
||||
/*!
|
||||
Constructor
|
||||
@@ -48,13 +36,6 @@ 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;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#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
|
||||
@@ -0,0 +1,32 @@
|
||||
#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/Content/Link.h"
|
||||
#include "Speckle/Database/Identity/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/Content/Link.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
|
||||
namespace speckle::event {
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#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
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.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 JSBridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
|
||||
bool BridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
|
||||
return true;
|
||||
} //JSBridgeArgument::fillInventory
|
||||
} //BridgeArgument::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -23,13 +23,13 @@ bool JSBridgeArgument::fillInventory(active::serialise::Inventory& inventory) co
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique JSBridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
|
||||
Cargo::Unique BridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
|
||||
return nullptr;
|
||||
} //JSBridgeArgument::getCargo
|
||||
} //BridgeArgument::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void JSBridgeArgument::setDefault() {
|
||||
} //JSBridgeArgument::setDefault
|
||||
void BridgeArgument::setDefault() {
|
||||
} //BridgeArgument::setDefault
|
||||
@@ -0,0 +1,133 @@
|
||||
#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
|
||||
@@ -0,0 +1,188 @@
|
||||
#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
|
||||
+24
-25
@@ -2,13 +2,13 @@
|
||||
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_WRAP
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
class JSBridgeArgument;
|
||||
class BridgeArgument;
|
||||
|
||||
/*!
|
||||
Factory function to make an argument object
|
||||
@@ -19,7 +19,11 @@ namespace speckle::interfac::browser::bridge {
|
||||
template<typename T>
|
||||
void* constructArgument(const speckle::utility::String& method, const speckle::utility::String& request) {
|
||||
try {
|
||||
return new T(method, request);
|
||||
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;
|
||||
} catch(...) {
|
||||
return nullptr; //Object constructors should throw an exception if incoming data isn't viable (NB: only use for unrecoverable problems)
|
||||
}
|
||||
@@ -28,7 +32,7 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Wrapper for bridge function arguments, determing the target requirement on demand
|
||||
*/
|
||||
class JSBridgeArgumentWrap : public active::serialise::Package {
|
||||
class BridgeArgumentWrap : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
@@ -36,31 +40,31 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
JSBridgeArgumentWrap() {}
|
||||
BridgeArgumentWrap() {}
|
||||
/*!
|
||||
Copy constructor
|
||||
*/
|
||||
JSBridgeArgumentWrap(const JSBridgeArgumentWrap&) = default;
|
||||
BridgeArgumentWrap(const BridgeArgumentWrap&) = default;
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~JSBridgeArgumentWrap();
|
||||
~BridgeArgumentWrap();
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
/*!
|
||||
Conversion operator
|
||||
@return True if the arguments are populated
|
||||
@return True if the argument is populated
|
||||
*/
|
||||
operator bool() { return m_argument.operator bool(); }
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the bridge function arguments
|
||||
@return The bridge arguments (nullptr on failure)
|
||||
Get the bridge function argument
|
||||
@return The bridge argument (nullptr on failure)
|
||||
*/
|
||||
std::shared_ptr<JSBridgeArgument> get() const { return m_argument; }
|
||||
std::shared_ptr<BridgeArgument> get() const { return m_argument; }
|
||||
/*!
|
||||
Get the associated method name for the argument
|
||||
@return The method name (empty on failure)
|
||||
@@ -71,11 +75,6 @@ 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)
|
||||
|
||||
@@ -103,20 +102,20 @@ namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
Make an argument object for a specified bridge method
|
||||
@param method The name of the target method
|
||||
@param methodID The name of the target method
|
||||
@param requestID The ID of the request
|
||||
@param argument The method argument data (serialised)
|
||||
@return An argument object (nullptr on failure)
|
||||
*/
|
||||
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;
|
||||
}
|
||||
static std::unique_ptr<BridgeArgument> makeArgument(const speckle::utility::String& methodID,
|
||||
const speckle::utility::String& requestID,
|
||||
const speckle::utility::String& argument);
|
||||
|
||||
/*!
|
||||
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<JSBridgeArgument, T>
|
||||
template<typename T> requires std::is_base_of_v<BridgeArgument, T>
|
||||
static void defineArgument(const speckle::utility::String& method) {
|
||||
m_argumentFactory[method] = constructArgument<T>;
|
||||
}
|
||||
@@ -136,10 +135,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<JSBridgeArgument> m_argument;
|
||||
mutable std::shared_ptr<BridgeArgument> m_argument;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#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
|
||||
+9
-8
@@ -3,8 +3,9 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/JSObject.h"
|
||||
#include "Speckle/Interface/Browser/NamedFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethodBase.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
|
||||
|
||||
#ifdef ARCHICAD
|
||||
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
|
||||
@@ -18,12 +19,12 @@
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
A class to provide JS bridging for Speckle connectors using a table of defined methods
|
||||
Base class for any method provided by a Speckle JS bridge object
|
||||
@tparam Argument The function parameter type
|
||||
@tparam Return The function return type
|
||||
*/
|
||||
template<typename Argument, typename Return>
|
||||
class JSBridgeMethod : public NamedFunction<Argument, Return>, public virtual JSBridgeMethodBase {
|
||||
class BridgeMethod : public NamedFunction<Argument, Return>, public virtual BridgeMethodBase {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
@@ -39,12 +40,12 @@ namespace speckle::interfac::browser::bridge {
|
||||
@param name The function name
|
||||
@param function The C++ function bound to the name
|
||||
*/
|
||||
JSBridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
|
||||
BridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
JSBridgeMethod(const JSBridgeMethod& source) = default;
|
||||
BridgeMethod(const BridgeMethod& source) = default;
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
@@ -53,9 +54,9 @@ namespace speckle::interfac::browser::bridge {
|
||||
@param bridge The target bridge name
|
||||
@return A reference to this
|
||||
*/
|
||||
JSBridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
|
||||
BridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
|
||||
if constexpr(!std::same_as<Argument, void>)
|
||||
JSBridgeArgumentWrap::defineArgument<Argument>(base::getName());
|
||||
BridgeArgumentWrap::defineArgument<Argument>(base::getName());
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
+3
-2
@@ -2,20 +2,21 @@
|
||||
#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 JSBridgeMethodBase {
|
||||
class BridgeMethodBase : public BridgeChild {
|
||||
public:
|
||||
/*!
|
||||
Register the method argument type for a specified bridge
|
||||
@param bridge The target bridge name
|
||||
@return A reference to this
|
||||
*/
|
||||
virtual JSBridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
|
||||
virtual BridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -2,10 +2,12 @@
|
||||
|
||||
#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>
|
||||
@@ -36,9 +38,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
|
||||
emplace_back(std::make_shared<GetBindingsMethodNames>(*this));
|
||||
emplace_back(std::make_shared<RunMethod>(*this));
|
||||
emplace_back(std::make_shared<GetCallResult>(*this));
|
||||
addFunction<GetBindingsMethodNames>();
|
||||
addFunction<RunMethod>();
|
||||
addFunction<GetCallResult>();
|
||||
} //BrowserBridge::BrowserBridge
|
||||
|
||||
|
||||
@@ -75,18 +77,43 @@ 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) {
|
||||
void BrowserBridge::cacheResult(std::unique_ptr<Cargo> result, String requestID, bool isNotified) {
|
||||
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);
|
||||
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
|
||||
//Notify that the result is available when required
|
||||
if (isNotified)
|
||||
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
|
||||
} //BrowserBridge::cacheResult
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/JSObject.h"
|
||||
#include "Speckle/Interface/Browser/Functional.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
|
||||
|
||||
namespace active::setting {
|
||||
class ValueSetting;
|
||||
@@ -46,6 +45,12 @@ 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)
|
||||
|
||||
@@ -53,8 +58,9 @@ 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);
|
||||
void cacheResult(std::unique_ptr<active::serialise::Cargo> result, speckle::utility::String requestID, bool isNotified = true);
|
||||
/*!
|
||||
Release the results linked to a specified request ID
|
||||
@param requestID The required result ID
|
||||
@@ -63,15 +69,28 @@ 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<JSBridgeMethodBase, T>)
|
||||
void addMethod() const {
|
||||
template<typename T> requires (std::is_base_of_v<BridgeMethodBase, T>)
|
||||
void addMethod() {
|
||||
//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);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#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
|
||||
@@ -0,0 +1,61 @@
|
||||
#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
|
||||
@@ -1,28 +0,0 @@
|
||||
#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,10 +12,9 @@ using namespace speckle::interfac::browser::bridge;
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
GetBindingsMethodNames::GetBindingsMethodNames(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"GetBindingsMethodNames", [&]() {
|
||||
return getMethodNames();
|
||||
}} {
|
||||
GetBindingsMethodNames::GetBindingsMethodNames() : JSFunction{"GetBindingsMethodNames", [&]() {
|
||||
return getMethodNames();
|
||||
}} {
|
||||
} //GetBindingsMethodNames::GetBindingsMethodNames
|
||||
|
||||
|
||||
@@ -25,5 +24,5 @@ GetBindingsMethodNames::GetBindingsMethodNames(BrowserBridge& bridge) : m_bridge
|
||||
return: The supported method names
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<WrappedValue> GetBindingsMethodNames::getMethodNames() const {
|
||||
return std::make_unique<WrappedValue>(m_bridge.getMethodNames());
|
||||
return (hasBridge()) ? std::make_unique<WrappedValue>(getBridge()->getMethodNames()) : nullptr;
|
||||
} //GetBindingsMethodNames::getMethodNames
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#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 {
|
||||
|
||||
@@ -15,16 +16,15 @@ 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> {
|
||||
class GetBindingsMethodNames : public JSFunction<void, WrappedValue, PlatformBinding>, public BridgeChild {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
Default constructor
|
||||
*/
|
||||
GetBindingsMethodNames(BrowserBridge& bridge);
|
||||
GetBindingsMethodNames();
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -32,9 +32,6 @@ 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,13 +20,10 @@ using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
GetCallResult::GetCallResult(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"GetCallResult", [&](auto args) {
|
||||
return getResult(args);
|
||||
}} {
|
||||
GetCallResult::GetCallResult() : JSFunction{"GetCallResult", [&](auto args) {
|
||||
return getResult(args);
|
||||
}} {
|
||||
} //GetCallResult::GetCallResult
|
||||
|
||||
|
||||
@@ -38,12 +35,15 @@ GetCallResult::GetCallResult(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
return: The requested result (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<WrappedResultArg> GetCallResult::getResult(WrappedResultArg& argument) const {
|
||||
//Confirm argument type
|
||||
auto result = m_bridge.releaseResult(argument);
|
||||
if (!hasBridge())
|
||||
return nullptr;
|
||||
//Retrieve the requested result
|
||||
using namespace json;
|
||||
auto result = getBridge()->releaseResult(argument);
|
||||
auto item = dynamic_cast<Cargo*>(result.get());
|
||||
if (!item)
|
||||
return nullptr;
|
||||
String jsonOutput;
|
||||
json::JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
|
||||
JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
|
||||
return std::make_unique<WrappedResultArg>(jsonOutput);
|
||||
} //GetCallResult::getResult
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Interface/Browser/JSFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
@@ -17,21 +18,15 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Function to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding> {
|
||||
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding>, public BridgeChild {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
Default constructor
|
||||
*/
|
||||
GetCallResult(BrowserBridge& bridge);
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
GetCallResult(const GetCallResult& source) = default;
|
||||
GetCallResult();
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -40,9 +35,6 @@ 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,6 +1,11 @@
|
||||
#include "Speckle/Interface/Browser/Bridge/Functions/RunMethod.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Null.h"
|
||||
#include "Active/Serialise/Package/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>
|
||||
@@ -8,12 +13,65 @@
|
||||
#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
|
||||
@@ -26,17 +84,15 @@ namespace {
|
||||
@param method The bridge method to execute
|
||||
@param argument The method argument
|
||||
*/
|
||||
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<JSBridgeArgument> argument) :
|
||||
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<BridgeArgument> argument) :
|
||||
m_bridge{bridge}, m_method{method}, m_argument{argument} {}
|
||||
|
||||
/*!
|
||||
Execute the function and (when required) cache the result
|
||||
Execute the function and (when required) cache the result or an error report
|
||||
*/
|
||||
void Run() override {
|
||||
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());
|
||||
if (m_argument)
|
||||
executeMethod(m_bridge, m_method, *m_argument);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -45,7 +101,7 @@ namespace {
|
||||
///The bridge method to execute
|
||||
Functional<>& m_method;
|
||||
///The method argument
|
||||
std::shared_ptr<JSBridgeArgument> m_argument;
|
||||
std::shared_ptr<BridgeArgument> m_argument;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -53,11 +109,10 @@ namespace {
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
bridge: The parent bridge object (provides access to bridge methods)
|
||||
--------------------------------------------------------------------*/
|
||||
RunMethod::RunMethod(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
JSFunction{"RunMethod", [&](auto args) { runMethod(args); }} {
|
||||
RunMethod::RunMethod() : JSFunction{"RunMethod", [&](auto args) {
|
||||
runMethod(args);
|
||||
}} {
|
||||
} //RunMethod::RunMethod
|
||||
|
||||
|
||||
@@ -66,18 +121,18 @@ RunMethod::RunMethod(BrowserBridge& bridge) : m_bridge{bridge},
|
||||
|
||||
arguments: The method arguments
|
||||
--------------------------------------------------------------------*/
|
||||
void RunMethod::runMethod(JSBridgeArgumentWrap& argument) const {
|
||||
void RunMethod::runMethod(BridgeArgumentWrap& argument) const {
|
||||
//Confirm argument and function validity
|
||||
if (!argument)
|
||||
if (!argument || !hasBridge())
|
||||
return;
|
||||
auto method = m_bridge.getMethod(argument.getMethodName());
|
||||
auto method = getBridge()->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(m_bridge, *method, argument.get()));
|
||||
executor.Execute(new RunBrowserMethod(*getBridge(), *method, argument.get()));
|
||||
}
|
||||
catch (...) {}
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "Speckle/Interface/Browser/PlatformBinding.h"
|
||||
#include "Speckle/Interface/Browser/JSFunction.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
|
||||
|
||||
namespace speckle::interfac::browser::bridge {
|
||||
|
||||
@@ -12,31 +13,22 @@ namespace speckle::interfac::browser::bridge {
|
||||
/*!
|
||||
Function to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class RunMethod : public JSFunction<JSBridgeArgumentWrap, void, PlatformBinding> {
|
||||
class RunMethod : public JSFunction<BridgeArgumentWrap, void, PlatformBinding>, public BridgeChild {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
Default constructor
|
||||
*/
|
||||
RunMethod(BrowserBridge& bridge);
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
RunMethod(const RunMethod& source) = default;
|
||||
RunMethod();
|
||||
|
||||
private:
|
||||
/*!
|
||||
Run a specified bridge method
|
||||
@param argument The method arguments
|
||||
*/
|
||||
void runMethod(JSBridgeArgumentWrap& argument) const;
|
||||
|
||||
///The parent browser bridge
|
||||
BrowserBridge& m_bridge;
|
||||
void runMethod(BridgeArgumentWrap& argument) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#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
|
||||
@@ -1,127 +0,0 @@
|
||||
#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
|
||||
@@ -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
|
||||
@tparam Binding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
|
||||
*/
|
||||
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
|
||||
@tparam FunctionBinding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
|
||||
*/
|
||||
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
|
||||
///The parent JS portal for this object
|
||||
const JSPortal<FunctionBinding>* m_portal = nullptr;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#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"
|
||||
@@ -9,6 +10,8 @@
|
||||
#include <JavascriptEngine.hpp>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace speckle::interfac::browser {
|
||||
|
||||
/*!
|
||||
@@ -70,6 +73,9 @@ 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(...) {
|
||||
@@ -94,10 +100,13 @@ 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
|
||||
@@ -105,6 +114,7 @@ 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
|
||||
///Define the bridge binding protocols according to platform (argument/result serialisation and transport for (de)serialisation)
|
||||
#ifdef ARCHICAD
|
||||
//Archicad uses a proprietary JS::Base type for JS values
|
||||
using PlatformBinding = JSBinding<GS::Ref<JS::Base>, speckle::serialise::jsbase::JSBaseTransport>;
|
||||
|
||||
@@ -1,38 +1,97 @@
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/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(Guid ID) : Record{ID} {
|
||||
Account::Account(const String& ID) : base{ID} {
|
||||
//TODO: Complete
|
||||
} //Account::Account
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
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
|
||||
|
||||
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 {
|
||||
//TODO: Complete
|
||||
return true;
|
||||
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);
|
||||
} //Account::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
|
||||
//TODO: Complete
|
||||
return nullptr;
|
||||
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
|
||||
}
|
||||
} //Account::getCargo
|
||||
|
||||
|
||||
@@ -40,16 +99,8 @@ Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void Account::setDefault() {
|
||||
//TODO: Complete
|
||||
m_token.clear();
|
||||
m_refreshToken.clear();
|
||||
m_isDefault = false;
|
||||
m_isOnline = true;
|
||||
} //Account::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Validate the cargo data
|
||||
|
||||
return: True if the data has been validated
|
||||
--------------------------------------------------------------------*/
|
||||
bool Account::validate() {
|
||||
//TODO: Complete
|
||||
return true;
|
||||
} //Account::validate
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#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 {
|
||||
@@ -31,13 +33,19 @@ namespace speckle::record::cred {
|
||||
Default constructor
|
||||
@param ID The account record ID
|
||||
*/
|
||||
Account(speckle::utility::Guid ID = speckle::utility::Guid{});
|
||||
Account(const speckle::utility::String& ID = speckle::utility::String{});
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
Account(const Account&) = default;
|
||||
/*!
|
||||
Object cloning
|
||||
@return A clone of this object
|
||||
*/
|
||||
Account* clonePtr() const override { return new Account{*this}; }
|
||||
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
@@ -60,25 +68,20 @@ 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
|
||||
speckle::utility::String m_token;
|
||||
///Authorisation refresh token
|
||||
speckle::utility::String m_refreshToken;
|
||||
///?
|
||||
///The account to have as the default selection in any UI
|
||||
bool m_isDefault = false;
|
||||
///True if the account is online
|
||||
bool m_isOnline = true;
|
||||
///Account server info
|
||||
//std::unique_ptr<ServerInfo> m_serverInfo;
|
||||
///Account server info
|
||||
//std::unique_ptr<UserInfo> m_userInfo;
|
||||
ServerInfo m_serverInfo;
|
||||
///Account user info
|
||||
UserInfo m_userInfo;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
#include "Speckle/Record/Credentials/ServerInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/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 {
|
||||
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<ValueWrap<String>>(m_name);
|
||||
case companyID:
|
||||
return std::make_unique<ValueWrap<String>>(m_company);
|
||||
case versionID:
|
||||
return std::make_unique<ValueWrap<String>>(m_version);
|
||||
case contactID:
|
||||
return std::make_unique<ValueWrap<String>>(m_adminContact);
|
||||
case descriptionID:
|
||||
return std::make_unique<ValueWrap<String>>(m_description);
|
||||
case frontEndID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_frontend2);
|
||||
case urlID:
|
||||
return std::make_unique<ValueWrap<String>>(m_url);
|
||||
case migrationID:
|
||||
return std::make_unique<PackageWrap>(m_migration);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //ServerInfo::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void ServerInfo::setDefault() {
|
||||
m_name.clear();
|
||||
m_company.clear();
|
||||
m_version.clear();
|
||||
m_adminContact.clear();
|
||||
m_description.clear();
|
||||
m_frontend2 = false;
|
||||
m_url.clear();
|
||||
} //ServerInfo::setDefault
|
||||
@@ -0,0 +1,94 @@
|
||||
#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& company, const utility::String& version, const utility::String& contact,
|
||||
const utility::String& description, const utility::String& url, bool isFrontEnd, const ServerMigration& migration) :
|
||||
m_name{name}, m_company{company}, m_version{version}, m_adminContact{contact}, m_description{description},
|
||||
m_url{url}, m_frontend2{isFrontEnd}, m_migration{migration} {}
|
||||
ServerInfo(const ServerInfo&) = default;
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the server name
|
||||
@return The server name
|
||||
*/
|
||||
const utility::String& getName() const { return m_name; }
|
||||
|
||||
// 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:
|
||||
///Server name
|
||||
utility::String m_name;
|
||||
///Company name
|
||||
utility::String m_company;
|
||||
///Server version
|
||||
utility::String m_version;
|
||||
///Admin contact email
|
||||
utility::String m_adminContact;
|
||||
///Server description
|
||||
utility::String 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 m_url;
|
||||
///Server migration record
|
||||
ServerMigration m_migration;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_RECORD_CRED_SERVER_INFO
|
||||
@@ -0,0 +1,75 @@
|
||||
#include "Speckle/Record/Credentials/ServerMigration.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.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<ValueWrap<String>>(movedTo);
|
||||
case movedFromID:
|
||||
return std::make_unique<ValueWrap<String>>(movedFrom);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //ServerMigration::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void ServerMigration::setDefault() {
|
||||
movedTo.clear();
|
||||
movedFrom.clear();
|
||||
} //ServerMigration::setDefault
|
||||
@@ -0,0 +1,54 @@
|
||||
#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: - 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 movedTo;
|
||||
///Previous URI where this server used to be deployed
|
||||
speckle::utility::String 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;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_RECORD_CRED_SERVER_MIGRATION
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "Speckle/Record/Credentials/UserInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/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<ValueWrap<String>>(m_company);
|
||||
case avatarID:
|
||||
return std::make_unique<ValueWrap<String>>(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_company.clear();
|
||||
m_email.clear();
|
||||
m_avatar.clear();
|
||||
} //UserInfo::setDefault
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef SPECKLE_RECORD_CRED_USER_INFO
|
||||
#define SPECKLE_RECORD_CRED_USER_INFO
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::record::cred {
|
||||
|
||||
/*!
|
||||
User info
|
||||
*/
|
||||
class UserInfo : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
UserInfo() {}
|
||||
/*!
|
||||
Constructor
|
||||
@param ID The user ID
|
||||
@param name The user name
|
||||
@param email The user email
|
||||
@param company The company name
|
||||
@param avatar ?
|
||||
*/
|
||||
UserInfo(const utility::String& ID, const utility::String& name, const utility::String& email, const utility::String& company,
|
||||
const utility::String& avatar) :
|
||||
m_id{ID}, m_name{name}, m_email{email}, m_company{company}, m_avatar{avatar} {}
|
||||
UserInfo(const UserInfo&) = default;
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the user ID
|
||||
@return The user ID
|
||||
*/
|
||||
const utility::String& getID() const { return m_id; }
|
||||
/*!
|
||||
Get the user name
|
||||
@return The user name
|
||||
*/
|
||||
const utility::String& getName() const { return m_name; }
|
||||
|
||||
// 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:
|
||||
///User ID
|
||||
utility::String m_id;
|
||||
///User name
|
||||
utility::String m_name;
|
||||
///User email
|
||||
utility::String m_email;
|
||||
///Compsny name
|
||||
utility::String m_company;
|
||||
///Avatar?
|
||||
utility::String m_avatar;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_RECORD_CRED_USER_INFO
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
|
||||
|
||||
#include "Active/Serialise/Item/Item.h"
|
||||
#include "Active/Serialise/Item/Wrapper/AnyValueWrap.h"
|
||||
#include "Active/Serialise/Null.h"
|
||||
#include "Active/Setting/Values/BoolValue.h"
|
||||
#include "Active/Setting/Values/DoubleValue.h"
|
||||
#include "Active/Setting/Values/Int32Value.h"
|
||||
@@ -9,9 +11,13 @@
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Active/Serialise/XML/Item/XMLDateTime.h"
|
||||
#include "Speckle/Environment/Platform.h"
|
||||
|
||||
#include <JSON/JDOMWriter.hpp>
|
||||
#include <JSON/Value.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace active::setting;
|
||||
using namespace speckle::serialise;
|
||||
@@ -21,11 +27,11 @@ using namespace speckle::utility;
|
||||
using enum JSBaseTransport::Status;
|
||||
|
||||
namespace {
|
||||
|
||||
///Category for JSBase processing errors
|
||||
|
||||
///Category for JSBase processing errors
|
||||
class JSBaseCategory : public std::error_category {
|
||||
public:
|
||||
///Category name
|
||||
///Category name
|
||||
const char* name() const noexcept override {
|
||||
return "speckle::serialise::jsbase::category";
|
||||
}
|
||||
@@ -62,22 +68,22 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
///JSBase processing category error instance
|
||||
|
||||
///JSBase processing category error instance
|
||||
static JSBaseCategory instance;
|
||||
|
||||
|
||||
///Make an error code for JSBase processing
|
||||
|
||||
///Make an error code for JSBase processing
|
||||
inline std::error_code makeJSBaseError(JSBaseTransport::Status code) {
|
||||
return std::error_code(static_cast<int>(code), instance);
|
||||
}
|
||||
|
||||
|
||||
///Identification type for JSBase elements
|
||||
|
||||
|
||||
///Identification type for JSBase elements
|
||||
struct JSBaseIdentity : Identity {
|
||||
|
||||
|
||||
// MARK: Types
|
||||
|
||||
|
||||
///Enumeration of JSBase element tag types
|
||||
enum class Type {
|
||||
undefined, ///<No type identified
|
||||
@@ -88,16 +94,16 @@ namespace {
|
||||
arrayEnd, ///<Array end brace, i.e. ]
|
||||
};
|
||||
|
||||
///Enumeration of JSBase parsing stages
|
||||
///Enumeration of JSBase parsing stages
|
||||
enum class Stage {
|
||||
root, ///<A new element is expected, either a new object, array or (unnamed) value
|
||||
array, ///<Within an array - same as root condition, but different terminator expected
|
||||
object, ///<Within an object - a named value is expected
|
||||
root, ///<A new element is expected, either a new object, array or (unnamed) value
|
||||
array, ///<Within an array - same as root condition, but different terminator expected
|
||||
object, ///<Within an object - a named value is expected
|
||||
complete, ///<An element has been read
|
||||
};
|
||||
|
||||
|
||||
// MARK: Constructors
|
||||
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param identity The element identity
|
||||
@@ -107,7 +113,8 @@ namespace {
|
||||
if (const auto* jsonIdentity = dynamic_cast<const JSBaseIdentity*>(&identity); jsonIdentity != nullptr) {
|
||||
type = jsonIdentity->type;
|
||||
stage = jsonIdentity->stage;
|
||||
} else
|
||||
}
|
||||
else
|
||||
type = tagType;
|
||||
}
|
||||
/*!
|
||||
@@ -115,16 +122,16 @@ namespace {
|
||||
@param tagType The tag type
|
||||
*/
|
||||
JSBaseIdentity(Type tagType) : Identity() { type = tagType; }
|
||||
|
||||
|
||||
// MARK: Public variables
|
||||
|
||||
|
||||
///The element type
|
||||
Type type = Type::undefined;
|
||||
///The stage at which the identity is found
|
||||
///The stage at which the identity is found
|
||||
Stage stage = Stage::root;
|
||||
|
||||
|
||||
// MARK: Functions (mutating)
|
||||
|
||||
|
||||
/*!
|
||||
Set the identity tag as the hierarchy root
|
||||
@return A reference to this
|
||||
@@ -133,7 +140,7 @@ namespace {
|
||||
stage = newStage;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Set the identity tag type
|
||||
@param tagType The tag type
|
||||
@@ -144,41 +151,42 @@ namespace {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
using JSElements = std::vector<std::pair<JS::Base*, String::Option>>;
|
||||
|
||||
|
||||
using enum JSBaseIdentity::Type;
|
||||
using enum JSBaseIdentity::Stage;
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Add an item to a JSBase object
|
||||
|
||||
|
||||
item: The item to write
|
||||
destination: The JSBase destination
|
||||
--------------------------------------------------------------------*/
|
||||
void addJSBase(GS::Ref<JS::Base>& item, const String& tag, GS::Ref<JS::Base>& destination) {
|
||||
//Attempt to add to object
|
||||
if (auto object = dynamic_cast<JS::Object*>(destination.operator JS::Base*()); object != nullptr)
|
||||
if (auto object = dynamic_cast<JS::Object*>(destination.operator JS::Base * ()); object != nullptr)
|
||||
object->AddItem(tag, item);
|
||||
//Attempt to add to array
|
||||
else if (auto array = dynamic_cast<JS::Array*>(destination.operator JS::Base*()); array != nullptr)
|
||||
else if (auto array = dynamic_cast<JS::Array*>(destination.operator JS::Base * ()); array != nullptr)
|
||||
array->AddItem(item);
|
||||
else
|
||||
throw std::system_error(makeJSBaseError(badDestination)); //The destination isn't a container
|
||||
return;
|
||||
} //addJSBase
|
||||
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Write an item to a JSBase object
|
||||
|
||||
|
||||
item: The item to write
|
||||
tag: The item tag
|
||||
destination: The JSBase destination
|
||||
--------------------------------------------------------------------*/
|
||||
void writeValue(const Item& item, const String& tag, GS::Ref<JS::Base>& destination) {
|
||||
GS::Ref<JS::Base> newValue;
|
||||
switch(item.type().value_or(Item::text)) {
|
||||
switch (item.type().value_or(Item::text)) {
|
||||
case Item::boolean: {
|
||||
BoolValue value;
|
||||
if (!item.write(value))
|
||||
@@ -197,8 +205,8 @@ namespace {
|
||||
String value;
|
||||
if (!item.write(value))
|
||||
throw std::system_error(makeJSBaseError(badValue));
|
||||
newValue = new JS::Value(value);
|
||||
break;
|
||||
newValue = new JS::Value(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (destination)
|
||||
@@ -207,10 +215,25 @@ namespace {
|
||||
destination = newValue;
|
||||
} //writeValue
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Write a null value to a JSBase object
|
||||
|
||||
tag: The item tag
|
||||
destination: The JSBase destination
|
||||
--------------------------------------------------------------------*/
|
||||
void writeNull(const String& tag, GS::Ref<JS::Base>& destination) {
|
||||
GS::Ref<JS::Base> newValue = new JS::Value{};
|
||||
if (destination)
|
||||
addJSBase(newValue, tag, destination);
|
||||
else
|
||||
destination = newValue;
|
||||
} //writeNull
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Decompose a JSBase into constitient items, paired with a name where possible
|
||||
|
||||
|
||||
source: The source JSBase
|
||||
|
||||
return: The items in the JSBase
|
||||
@@ -220,17 +243,19 @@ namespace {
|
||||
if (auto object = dynamic_cast<JS::Object*>(&source); object != nullptr) {
|
||||
//Decompose an object
|
||||
for (auto& item : object->GetItemTable())
|
||||
result.push_back({item.value->operator JS::Base*(), String{*item.key}});
|
||||
} else if (auto array = dynamic_cast<JS::Array*>(&source); array != nullptr) {
|
||||
result.push_back({ item.value->operator JS::Base * (), String{*item.key} });
|
||||
}
|
||||
else if (auto array = dynamic_cast<JS::Array*>(&source); array != nullptr) {
|
||||
//Decompose an array
|
||||
for (auto& item : array->GetItemArray())
|
||||
result.push_back({item, std::nullopt});
|
||||
} else
|
||||
result.push_back({ item, std::nullopt });
|
||||
}
|
||||
else
|
||||
throw std::system_error(makeJSBaseError(badSource)); //The source isn't a container
|
||||
return result;
|
||||
} //decomposeJSBase
|
||||
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Import a cargo item from a JSBase element
|
||||
|
||||
@@ -264,18 +289,18 @@ namespace {
|
||||
break;
|
||||
}
|
||||
} //doJSBaseItemImport
|
||||
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Import the contents of the specified cargo from JSBase
|
||||
|
||||
|
||||
container: The cargo container to receive the imported data
|
||||
containerIdentity: The container identity
|
||||
source: The JSBase source
|
||||
--------------------------------------------------------------------*/
|
||||
void doJSBaseImport(Cargo& container, const JSBaseIdentity& containerIdentity, JS::Base& source) {
|
||||
if (dynamic_cast<Item*>(&container) != nullptr) {
|
||||
//If we've got a single-value item at the root, import the source value and end
|
||||
//If we've got a single-value item at the root, import the source value and end
|
||||
readValue(container, source);
|
||||
return;
|
||||
}
|
||||
@@ -288,7 +313,7 @@ namespace {
|
||||
if (elements.empty())
|
||||
return;
|
||||
bool isArray = !elements[0].second;
|
||||
Identity parentIdentity{containerIdentity};
|
||||
Identity parentIdentity{ containerIdentity };
|
||||
//Anonymous arrays need an identity
|
||||
if (isArray && parentIdentity.name.empty()) {
|
||||
for (auto& entry : inventory)
|
||||
@@ -300,7 +325,7 @@ namespace {
|
||||
for (auto& element : elements) {
|
||||
Cargo::Unique cargo;
|
||||
Inventory::iterator incomingItem = inventory.end();
|
||||
Identity identity{element.second.value_or(parentIdentity.name)};
|
||||
Identity identity{ element.second.value_or(parentIdentity.name) };
|
||||
if (incomingItem = inventory.registerIncoming(identity); incomingItem != inventory.end()) { //Seek the incoming element in the inventory
|
||||
if (!incomingItem->bumpAvailable())
|
||||
throw std::system_error(makeJSBaseError(inventoryBoundsExceeded));
|
||||
@@ -312,18 +337,18 @@ namespace {
|
||||
doJSBaseImport(*cargo, identity, *element.first);
|
||||
if (incomingItem->isRepeating()) {
|
||||
if (auto package = dynamic_cast<Package*>(&container);
|
||||
(package != nullptr) && !package->insert(std::move(cargo), *incomingItem))
|
||||
(package != nullptr) && !package->insert(std::move(cargo), *incomingItem))
|
||||
throw std::system_error(makeJSBaseError(invalidObject));
|
||||
}
|
||||
}
|
||||
if (!container.validate())
|
||||
throw std::system_error(makeJSBaseError(invalidObject)); //The incoming data was rejected as invalid
|
||||
} //doJSBaseImport
|
||||
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Export cargo to JSBase
|
||||
|
||||
|
||||
cargo: The cargo to export
|
||||
identity: The cargo identity
|
||||
destination: The JSBase destination
|
||||
@@ -333,8 +358,12 @@ namespace {
|
||||
Inventory inventory;
|
||||
//Single-value items won't specify an inventory (no point)
|
||||
if (!cargo.fillInventory(inventory) || (inventory.empty())) {
|
||||
if (item == nullptr)
|
||||
throw std::system_error(makeJSBaseError(badValue)); //Non-items must be named
|
||||
if (item == nullptr) {
|
||||
if (dynamic_cast<const Null*>(&cargo) == nullptr)
|
||||
throw std::system_error(makeJSBaseError(badValue)); //Non-items must be named
|
||||
writeNull(identity.name, destination);
|
||||
return;
|
||||
}
|
||||
writeValue(*item, identity.name, destination);
|
||||
return;
|
||||
}
|
||||
@@ -350,7 +379,7 @@ namespace {
|
||||
auto container = destination;
|
||||
if (isWrapperTag) {
|
||||
auto containerType = cargo.entryType().value_or((inventory.size() == 1) && !(inventory.begin()->maximum() == 1) ?
|
||||
Entry::Type::array : Entry::Type::element);
|
||||
Entry::Type::array : Entry::Type::element);
|
||||
if (containerType == Entry::Type::array)
|
||||
container = new JS::Array();
|
||||
else
|
||||
@@ -369,29 +398,84 @@ namespace {
|
||||
for (item.available = 0; item.available < limit; ++item.available) {
|
||||
if (auto content = cargo.getCargo(item); content) {
|
||||
doJSBaseExport(*content, item.identity(), container);
|
||||
} else
|
||||
}
|
||||
else
|
||||
break; //Discontinue an inventory item when the supply runs out
|
||||
}
|
||||
}
|
||||
} //doJSBaseExport
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Convert a JS::Base object to JSON
|
||||
|
||||
jsBase: The object to convert
|
||||
--------------------------------------------------------------------*/
|
||||
JSON::ValueRef convertToJSONValue(const GS::Ref<JS::Base>& jsBase) {
|
||||
JS::Object* objectJS = dynamic_cast<JS::Object*> ((JS::Base*)jsBase);
|
||||
if (objectJS != nullptr) {
|
||||
JSON::ObjectValueRef objectJSON = new JSON::ObjectValue();
|
||||
for (const auto& member : objectJS->GetItemTable())
|
||||
objectJSON->AddValue(*member.key, convertToJSONValue(*member.value));
|
||||
return objectJSON;
|
||||
}
|
||||
JS::Array* arrayJs = dynamic_cast<JS::Array*> ((JS::Base*)jsBase);
|
||||
if (arrayJs != nullptr) {
|
||||
JSON::ArrayValueRef arrayJSON = new JSON::ArrayValue();
|
||||
for (const auto& item : arrayJs->GetItemArray())
|
||||
arrayJSON->AddValue(convertToJSONValue(item));
|
||||
return arrayJSON;
|
||||
}
|
||||
JS::Value* valueJs = dynamic_cast<JS::Value*> ((JS::Base*)jsBase);
|
||||
if (valueJs != nullptr) {
|
||||
JSON::ValueRef primitiveJSON;
|
||||
switch (valueJs->GetType()) {
|
||||
case JS::Value::DEFAULT:
|
||||
primitiveJSON = new JSON::NullValue();
|
||||
break;
|
||||
case JS::Value::BOOL:
|
||||
primitiveJSON = new JSON::BoolValue(valueJs->GetBool());
|
||||
break;
|
||||
case JS::Value::INTEGER:
|
||||
primitiveJSON = new JSON::NumberValue(valueJs->GetInteger());
|
||||
break;
|
||||
case JS::Value::UINTEGER:
|
||||
primitiveJSON = new JSON::NumberValue(valueJs->GetUInteger());
|
||||
break;
|
||||
case JS::Value::DOUBLE:
|
||||
primitiveJSON = new JSON::NumberValue(valueJs->GetDouble());
|
||||
break;
|
||||
case JS::Value::STRING:
|
||||
primitiveJSON = new JSON::StringValue(valueJs->GetString());
|
||||
break;
|
||||
default:
|
||||
DBBREAK();
|
||||
}
|
||||
return primitiveJSON;
|
||||
}
|
||||
return nullptr;
|
||||
} //convertToJSONValue
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Send cargo as JSBase to a specified destination
|
||||
|
||||
|
||||
cargo: The cargo to be sent as JS::Base
|
||||
identity: The cargo identity (name, optional namespace)
|
||||
destination: A reference to a JS::Base object (will be populated by this function)
|
||||
--------------------------------------------------------------------*/
|
||||
void JSBaseTransport::send(Cargo&& cargo, const Identity& identity, GS::Ref<JS::Base>& destination) const {
|
||||
doJSBaseExport(cargo, JSBaseIdentity(identity).atStage(root), destination);
|
||||
#ifdef DEBUG
|
||||
speckle::environment::platform()->writeToConsole("\nSent:\n" + convertToJSON(destination) + "\n");
|
||||
#endif
|
||||
} //JSBaseTransport::send
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Receive cargo from a specified JSBase source
|
||||
|
||||
|
||||
cargo: The cargo to receive the JS::Base data
|
||||
identity: The cargo identity (name, optional namespace)
|
||||
source: A reference to a JS::Base object
|
||||
@@ -399,5 +483,30 @@ void JSBaseTransport::send(Cargo&& cargo, const Identity& identity, GS::Ref<JS::
|
||||
void JSBaseTransport::receive(Cargo&& cargo, const Identity& identity, GS::Ref<JS::Base> source) const {
|
||||
if (!source)
|
||||
throw std::system_error(makeJSBaseError(badSource));
|
||||
#ifdef DEBUG
|
||||
speckle::environment::platform()->writeToConsole("\nReceived:\n" + convertToJSON(source) + "\n");
|
||||
#endif
|
||||
doJSBaseImport(cargo, JSBaseIdentity(identity).atStage(root), *source);
|
||||
} //JSBaseTransport::receive
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Convert a JS::Base object to JSON
|
||||
|
||||
jsBase: The object to convert
|
||||
--------------------------------------------------------------------*/
|
||||
String JSBaseTransport::convertToJSON(const GS::Ref<JS::Base>& jsBase) {
|
||||
GS::UniString resultString;
|
||||
try {
|
||||
//JDOMStringWriter can't cope with single values
|
||||
if (auto jsValue = dynamic_cast<const JS::Value*>(jsBase.operator JS::Base * ()); jsValue != nullptr) {
|
||||
AnyValueWrap value;
|
||||
readValue(value, *jsBase);
|
||||
String json;
|
||||
value.write(json);
|
||||
return json;
|
||||
} else if (auto jsonRef = convertToJSONValue(jsBase); jsonRef != nullptr)
|
||||
JSON::JDOMStringWriter writer(*jsonRef, resultString);
|
||||
} catch (...) {}
|
||||
return resultString;
|
||||
} //JSBaseTransport::convertToJSON
|
||||
|
||||
@@ -23,6 +23,12 @@ namespace speckle::serialise::jsbase {
|
||||
class JSBaseTransport {
|
||||
public:
|
||||
|
||||
/*!
|
||||
Convert a JS::Base object to JSON
|
||||
@param jsBase The object to convert
|
||||
*/
|
||||
static speckle::utility::String convertToJSON(const GS::Ref<JS::Base>& jsBase);
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
///Status of of the XML transport
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef SPECKLE_UTILITY_EXCEPTION
|
||||
#define SPECKLE_UTILITY_EXCEPTION
|
||||
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace speckle::utility {
|
||||
|
||||
/*!
|
||||
Record index class
|
||||
*/
|
||||
class Exception : public std::runtime_error {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = std::runtime_error;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
using base::base;
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param message The exception message
|
||||
*/
|
||||
Exception(const String& message) : base{message.operator std::string()} {}
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
using base::operator=;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_UTILITY_EXCEPTION
|
||||
@@ -0,0 +1,80 @@
|
||||
#include "Speckle/Utility/Guid64.h"
|
||||
|
||||
#include "Active/Serialise/Generic/Base64Transport.h"
|
||||
#include "Active/Utility/BufferIn.h"
|
||||
#include "Active/Utility/BufferOut.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr unsigned long long maxInt64 = std::numeric_limits<unsigned long long>::max();
|
||||
static const String nullBase64{"AAAAAAAAAAA"};
|
||||
|
||||
uint64_t randomInt64() {
|
||||
std::random_device rd;
|
||||
std::mt19937_64 gen(rd());
|
||||
std::uniform_int_distribution<unsigned long long> dis(0, maxInt64);
|
||||
return static_cast<uint64_t>(dis(gen));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
|
||||
autoGenerate: True to generate a guid value on construction
|
||||
--------------------------------------------------------------------*/
|
||||
Guid64::Guid64(bool autoGenerate) {
|
||||
if (autoGenerate)
|
||||
reset();
|
||||
} //Guid64::Guid64
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
base64String: The guid in string form (encoded as base64)
|
||||
--------------------------------------------------------------------*/
|
||||
Guid64::Guid64(const String& base64String) {
|
||||
using namespace active::utility;
|
||||
auto incoming{base64String};
|
||||
//We need 10 characters for a valid guid
|
||||
if (incoming.size() != 11)
|
||||
return;
|
||||
//Convert the incoming base64 to a 64-bit integer
|
||||
BufferIn source{incoming};
|
||||
Base64Transport transport;
|
||||
if (!transport.receive(Memory{m_value}, source))
|
||||
return;
|
||||
m_value = Memory::fromBigEndian(m_value);
|
||||
} //Guid64::Guid64
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Return a string representation of the guid
|
||||
|
||||
return: A string representation
|
||||
--------------------------------------------------------------------*/
|
||||
String Guid64::string() const {
|
||||
String base64String;
|
||||
using namespace active::utility;
|
||||
//Convert the value to base64
|
||||
auto val = Memory::toBigEndian(m_value);
|
||||
if (!Base64Transport().send(Memory{val}, base64String) || (base64String.length() != 12))
|
||||
base64String = nullBase64;
|
||||
else
|
||||
base64String.erase(11); //Remove the trailing '='
|
||||
return base64String;
|
||||
} //Guid64::string
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Reset the guid with a new value
|
||||
--------------------------------------------------------------------*/
|
||||
void Guid64::reset() {
|
||||
m_value = randomInt64();
|
||||
} //Guid64::reset
|
||||
@@ -0,0 +1,94 @@
|
||||
#ifndef SPECKLE_UTILITY_GUID_64
|
||||
#define SPECKLE_UTILITY_GUID_64
|
||||
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::utility {
|
||||
|
||||
/*!
|
||||
A class representing a 64-bit GUID with base64 text encoding
|
||||
*/
|
||||
class Guid64 {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using Raw = uint64_t;
|
||||
///Optional
|
||||
using Option = std::optional<Guid64>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param autoGenerate True to generate a guid value on construction
|
||||
*/
|
||||
Guid64(bool autoGenerate = false);
|
||||
/*!
|
||||
Constructor
|
||||
@param base64String The guid in string form (encoded as base64)
|
||||
*/
|
||||
explicit Guid64(const String& base64String);
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
friend auto operator<=>(const Guid64&, const Guid64&) = default;
|
||||
friend bool operator==(const Guid64&, const Guid64&) = default;
|
||||
friend bool operator!=(const Guid64&, const Guid64&) = default;
|
||||
friend bool operator<(const Guid64&, const Guid64&) = default;
|
||||
/*!
|
||||
Conversion operator
|
||||
@return The guid as a string
|
||||
*/
|
||||
operator String() const { return string(); }
|
||||
/*!
|
||||
Conversion operator
|
||||
@return The guid as a std::string
|
||||
*/
|
||||
operator std::string() const { return string(); }
|
||||
/*!
|
||||
Conversion operator
|
||||
@return True if the guid has a value (non-nil)
|
||||
*/
|
||||
operator bool() const { return (m_value != 0); }
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Return the raw (native) representation of the guid
|
||||
@return The raw native representation
|
||||
*/
|
||||
const Raw& raw() const { return m_value; }
|
||||
/*!
|
||||
Return a string representation of the guid
|
||||
@return A string representation
|
||||
*/
|
||||
String string() const;
|
||||
|
||||
// MARK: - Functions (mutating)
|
||||
|
||||
/*!
|
||||
Reset the guid with a new value
|
||||
*/
|
||||
void reset();
|
||||
/*!
|
||||
Clear the guid value
|
||||
*/
|
||||
void clear() { m_value = {}; }
|
||||
|
||||
private:
|
||||
//The guid value
|
||||
Raw m_value = {};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
///Hashing for Guid64 class, e.g. to use as a key in unordered_map
|
||||
template<>
|
||||
struct std::hash<speckle::utility::Guid64> {
|
||||
std::size_t operator() (const speckle::utility::Guid64& guid) const {
|
||||
return static_cast<std::size_t>(guid.raw());
|
||||
}
|
||||
};
|
||||
|
||||
#endif //SPECKLE_UTILITY_GUID_64
|
||||
@@ -7,6 +7,13 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
210CC86F2C7E879700610F58 /* ArgumentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 210CC86D2C7E879700610F58 /* ArgumentBase.h */; };
|
||||
210CC8802C80CD2A00610F58 /* BridgeChild.h in Headers */ = {isa = PBXBuildFile; fileRef = 210CC87D2C80CD2A00610F58 /* BridgeChild.h */; };
|
||||
210CC88F2C81A98500610F58 /* Guid64.h in Headers */ = {isa = PBXBuildFile; fileRef = 210CC88D2C81A98500610F58 /* Guid64.h */; };
|
||||
210CC8902C81A98500610F58 /* Guid64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC88E2C81A98500610F58 /* Guid64.cpp */; };
|
||||
210CC8922C81AEBB00610F58 /* Guid32Tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC8912C81AEBB00610F58 /* Guid32Tests.cpp */; };
|
||||
210CC89F2C81E34400610F58 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC89D2C81E34400610F58 /* Platform.cpp */; };
|
||||
210CC8A02C81E34400610F58 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 210CC89E2C81E34400610F58 /* Platform.h */; };
|
||||
212A88132AE48821001EAFE7 /* libArchicad27.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21379E082AE47A6400A1584C /* libArchicad27.a */; platformFilters = (macos, ); };
|
||||
2193517B2C624FC100E5A69C /* MenuSubscriber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219351782C624FC100E5A69C /* MenuSubscriber.cpp */; };
|
||||
2193518C2C62655700E5A69C /* MenuEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 219351892C62655700E5A69C /* MenuEvent.h */; };
|
||||
@@ -14,17 +21,30 @@
|
||||
219351B12C62CC1A00E5A69C /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219351AC2C62CC1A00E5A69C /* Guid.cpp */; };
|
||||
219351B32C62CC1A00E5A69C /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219351AE2C62CC1A00E5A69C /* String.cpp */; };
|
||||
2199881E2BD833830035E5EA /* libArchicad27.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 21379E082AE47A6400A1584C /* libArchicad27.a */; };
|
||||
21F69EBE2C63C954008B6A06 /* Link.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69EBD2C63C954008B6A06 /* Link.cpp */; };
|
||||
21B67D002C7CE15100FD64FC /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = 21B67CFE2C7CE15100FD64FC /* Exception.h */; };
|
||||
21B67D0D2C7E0E8D00FD64FC /* ErrorReport.h in Headers */ = {isa = PBXBuildFile; fileRef = 21B67D092C7E0E8D00FD64FC /* ErrorReport.h */; };
|
||||
21B67D0E2C7E0E8D00FD64FC /* ErrorReport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67D0C2C7E0E8D00FD64FC /* ErrorReport.cpp */; };
|
||||
21D0BD202C86F0280077E104 /* AccountDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD1D2C86F0280077E104 /* AccountDatabase.cpp */; };
|
||||
21D0BD212C86F0280077E104 /* AccountDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD1E2C86F0280077E104 /* AccountDatabase.h */; };
|
||||
21D0BD2B2C86FC350077E104 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD252C86FC350077E104 /* Record.cpp */; };
|
||||
21D0BD2C2C86FC350077E104 /* Record.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD262C86FC350077E104 /* Record.h */; };
|
||||
21D0BD312C86FE090077E104 /* Index.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD2D2C86FE090077E104 /* Index.h */; };
|
||||
21D0BD322C86FE090077E104 /* Link.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD2E2C86FE090077E104 /* Link.cpp */; };
|
||||
21D0BD332C86FE090077E104 /* Link.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD2F2C86FE090077E104 /* Link.h */; };
|
||||
21D0BD4D2C8901A00077E104 /* ServerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD4B2C8901A00077E104 /* ServerInfo.h */; };
|
||||
21D0BD4E2C8901A00077E104 /* ServerInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD4C2C8901A00077E104 /* ServerInfo.cpp */; };
|
||||
21D0BD552C890B1C0077E104 /* ServerMigration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD512C890B1C0077E104 /* ServerMigration.cpp */; };
|
||||
21D0BD562C890B1C0077E104 /* ServerMigration.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD542C890B1C0077E104 /* ServerMigration.h */; };
|
||||
21D0BD592C8910400077E104 /* UserInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD572C8910400077E104 /* UserInfo.cpp */; };
|
||||
21D0BD5A2C8910400077E104 /* UserInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BD582C8910400077E104 /* UserInfo.h */; };
|
||||
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F382C6B880B008B6A06 /* JSBaseTransport.cpp */; };
|
||||
21F69F512C6CCC25008B6A06 /* BrowserBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F4A2C6CCC25008B6A06 /* BrowserBridge.cpp */; };
|
||||
21F69F5A2C6CDB67008B6A06 /* FunctionBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = 21F69F592C6CDB67008B6A06 /* FunctionBinding.h */; };
|
||||
21F69F612C6D0286008B6A06 /* GetBindingsMethodNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F602C6D0286008B6A06 /* GetBindingsMethodNames.cpp */; };
|
||||
21F69F682C6DFB01008B6A06 /* RunMethod.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F662C6DFB01008B6A06 /* RunMethod.cpp */; };
|
||||
21F69F7E2C6FD9FC008B6A06 /* GetCallResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F7A2C6FD9FC008B6A06 /* GetCallResult.cpp */; };
|
||||
21F69F812C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F802C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp */; };
|
||||
21F69F812C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F802C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp */; };
|
||||
21F69F962C71087A008B6A06 /* Account.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F922C71087A008B6A06 /* Account.cpp */; };
|
||||
21F69FA42C729400008B6A06 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA32C729400008B6A06 /* Record.cpp */; };
|
||||
21F69FA62C733EDA008B6A06 /* JSBridgeArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA52C733EDA008B6A06 /* JSBridgeArgument.cpp */; };
|
||||
21F69FA62C733EDA008B6A06 /* BridgeArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */; };
|
||||
21F93AEC2B2F406E009A2C5B /* Addon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F93AEA2B2F406D009A2C5B /* Addon.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -66,6 +86,13 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
210CC86D2C7E879700610F58 /* ArgumentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArgumentBase.h; sourceTree = "<group>"; };
|
||||
210CC87D2C80CD2A00610F58 /* BridgeChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeChild.h; sourceTree = "<group>"; };
|
||||
210CC88D2C81A98500610F58 /* Guid64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Guid64.h; sourceTree = "<group>"; };
|
||||
210CC88E2C81A98500610F58 /* Guid64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Guid64.cpp; sourceTree = "<group>"; };
|
||||
210CC8912C81AEBB00610F58 /* Guid32Tests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = Guid32Tests.cpp; sourceTree = "<group>"; };
|
||||
210CC89D2C81E34400610F58 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.cpp; sourceTree = "<group>"; };
|
||||
210CC89E2C81E34400610F58 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = "<group>"; };
|
||||
212A87EF2AE4868C001EAFE7 /* SpeckleLib-test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SpeckleLib-test.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
21329F472BFA611C00B5C7AF /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
21329F632BFD452C00B5C7AF /* Environment.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Environment.md; sourceTree = "<group>"; };
|
||||
@@ -84,14 +111,27 @@
|
||||
219351982C6278D900E5A69C /* SelectionSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionSubscriber.h; sourceTree = "<group>"; };
|
||||
219351992C6278D900E5A69C /* SelectionSubscriber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionSubscriber.cpp; sourceTree = "<group>"; };
|
||||
2193519C2C627E3100E5A69C /* SelectionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionEvent.h; sourceTree = "<group>"; };
|
||||
219351A72C62CA5300E5A69C /* Index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Index.h; sourceTree = "<group>"; };
|
||||
219351AC2C62CC1A00E5A69C /* Guid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Guid.cpp; sourceTree = "<group>"; };
|
||||
219351AD2C62CC1A00E5A69C /* Guid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Guid.h; sourceTree = "<group>"; };
|
||||
219351AE2C62CC1A00E5A69C /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; };
|
||||
219351AF2C62CC1A00E5A69C /* String.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = String.h; sourceTree = "<group>"; };
|
||||
219712682BE7E2D500D9EF7E /* Serialisation.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Serialisation.md; sourceTree = "<group>"; };
|
||||
21F69EBC2C63944D008B6A06 /* Link.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Link.h; sourceTree = "<group>"; };
|
||||
21F69EBD2C63C954008B6A06 /* Link.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Link.cpp; sourceTree = "<group>"; };
|
||||
21B67CFE2C7CE15100FD64FC /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; };
|
||||
21B67D092C7E0E8D00FD64FC /* ErrorReport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorReport.h; sourceTree = "<group>"; };
|
||||
21B67D0C2C7E0E8D00FD64FC /* ErrorReport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorReport.cpp; sourceTree = "<group>"; };
|
||||
21D0BD1D2C86F0280077E104 /* AccountDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccountDatabase.cpp; sourceTree = "<group>"; };
|
||||
21D0BD1E2C86F0280077E104 /* AccountDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccountDatabase.h; sourceTree = "<group>"; };
|
||||
21D0BD252C86FC350077E104 /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
|
||||
21D0BD262C86FC350077E104 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
|
||||
21D0BD2D2C86FE090077E104 /* Index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Index.h; sourceTree = "<group>"; };
|
||||
21D0BD2E2C86FE090077E104 /* Link.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Link.cpp; sourceTree = "<group>"; };
|
||||
21D0BD2F2C86FE090077E104 /* Link.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Link.h; sourceTree = "<group>"; };
|
||||
21D0BD4B2C8901A00077E104 /* ServerInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerInfo.h; sourceTree = "<group>"; };
|
||||
21D0BD4C2C8901A00077E104 /* ServerInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerInfo.cpp; sourceTree = "<group>"; };
|
||||
21D0BD512C890B1C0077E104 /* ServerMigration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerMigration.cpp; sourceTree = "<group>"; };
|
||||
21D0BD542C890B1C0077E104 /* ServerMigration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerMigration.h; sourceTree = "<group>"; };
|
||||
21D0BD572C8910400077E104 /* UserInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserInfo.cpp; sourceTree = "<group>"; };
|
||||
21D0BD582C8910400077E104 /* UserInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInfo.h; sourceTree = "<group>"; };
|
||||
21F69F012C66C229008B6A06 /* Doxyfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Doxyfile; path = Documentation/Doxyfile; sourceTree = "<group>"; };
|
||||
21F69F192C6A0FE2008B6A06 /* JSBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBinding.h; sourceTree = "<group>"; };
|
||||
21F69F352C6AA9B3008B6A06 /* JSFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSFunction.h; sourceTree = "<group>"; };
|
||||
@@ -102,25 +142,22 @@
|
||||
21F69F492C6CC2B8008B6A06 /* Functional.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Functional.h; sourceTree = "<group>"; };
|
||||
21F69F4A2C6CCC25008B6A06 /* BrowserBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BrowserBridge.cpp; sourceTree = "<group>"; };
|
||||
21F69F4B2C6CCC25008B6A06 /* BrowserBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BrowserBridge.h; sourceTree = "<group>"; };
|
||||
21F69F4D2C6CCC25008B6A06 /* JSBridgeArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBridgeArgument.h; sourceTree = "<group>"; };
|
||||
21F69F4F2C6CCC25008B6A06 /* JSBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBridgeMethod.h; sourceTree = "<group>"; };
|
||||
21F69F4D2C6CCC25008B6A06 /* BridgeArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeArgument.h; sourceTree = "<group>"; };
|
||||
21F69F4F2C6CCC25008B6A06 /* BridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeMethod.h; sourceTree = "<group>"; };
|
||||
21F69F572C6CDAEE008B6A06 /* GetBindingsMethodNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GetBindingsMethodNames.h; sourceTree = "<group>"; };
|
||||
21F69F592C6CDB67008B6A06 /* FunctionBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionBinding.h; sourceTree = "<group>"; };
|
||||
21F69F602C6D0286008B6A06 /* GetBindingsMethodNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetBindingsMethodNames.cpp; sourceTree = "<group>"; };
|
||||
21F69F652C6DFB01008B6A06 /* RunMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunMethod.h; sourceTree = "<group>"; };
|
||||
21F69F662C6DFB01008B6A06 /* RunMethod.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunMethod.cpp; sourceTree = "<group>"; };
|
||||
21F69F692C6E0D59008B6A06 /* JSBridgeArgumentWrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSBridgeArgumentWrap.h; sourceTree = "<group>"; };
|
||||
21F69F692C6E0D59008B6A06 /* BridgeArgumentWrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgeArgumentWrap.h; sourceTree = "<group>"; };
|
||||
21F69F6A2C6E61E1008B6A06 /* JSPortal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPortal.h; sourceTree = "<group>"; };
|
||||
21F69F6D2C6E7D9F008B6A06 /* PlatformBinding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformBinding.h; sourceTree = "<group>"; };
|
||||
21F69F7A2C6FD9FC008B6A06 /* GetCallResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetCallResult.cpp; sourceTree = "<group>"; };
|
||||
21F69F7D2C6FD9FC008B6A06 /* GetCallResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetCallResult.h; sourceTree = "<group>"; };
|
||||
21F69F802C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBridgeArgumentWrap.cpp; sourceTree = "<group>"; };
|
||||
21F69F822C701A8E008B6A06 /* JSBridgeMethodBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSBridgeMethodBase.h; sourceTree = "<group>"; };
|
||||
21F69F8F2C710012008B6A06 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
|
||||
21F69F802C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BridgeArgumentWrap.cpp; sourceTree = "<group>"; };
|
||||
21F69F822C701A8E008B6A06 /* BridgeMethodBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgeMethodBase.h; sourceTree = "<group>"; };
|
||||
21F69F922C71087A008B6A06 /* Account.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Account.cpp; sourceTree = "<group>"; };
|
||||
21F69F932C71087A008B6A06 /* Account.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Account.h; sourceTree = "<group>"; };
|
||||
21F69FA32C729400008B6A06 /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
|
||||
21F69FA52C733EDA008B6A06 /* JSBridgeArgument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBridgeArgument.cpp; sourceTree = "<group>"; };
|
||||
21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BridgeArgument.cpp; sourceTree = "<group>"; };
|
||||
21F93AE92B2F406D009A2C5B /* Addon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Addon.h; sourceTree = "<group>"; };
|
||||
21F93AEA2B2F406D009A2C5B /* Addon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Addon.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -148,7 +185,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
214EA4C52BA374FD008E5358 /* CMakeLists.txt */,
|
||||
219351A92C62CA5300E5A69C /* Database */,
|
||||
21D0BD1F2C86F0280077E104 /* Database */,
|
||||
21F93AE82B2F406D009A2C5B /* Environment */,
|
||||
21F93ACC2B2B67FC009A2C5B /* Event */,
|
||||
21F69F1B2C6A0FE2008B6A06 /* Interface */,
|
||||
@@ -228,31 +265,14 @@
|
||||
path = Type;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
219351A82C62CA5300E5A69C /* Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
219351A72C62CA5300E5A69C /* Index.h */,
|
||||
21F69EBD2C63C954008B6A06 /* Link.cpp */,
|
||||
21F69EBC2C63944D008B6A06 /* Link.h */,
|
||||
21F69FA32C729400008B6A06 /* Record.cpp */,
|
||||
21F69F8F2C710012008B6A06 /* Record.h */,
|
||||
);
|
||||
path = Content;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
219351A92C62CA5300E5A69C /* Database */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
219351A82C62CA5300E5A69C /* Content */,
|
||||
);
|
||||
path = Database;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
219351B02C62CC1A00E5A69C /* Utility */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CFE2C7CE15100FD64FC /* Exception.h */,
|
||||
219351AC2C62CC1A00E5A69C /* Guid.cpp */,
|
||||
219351AD2C62CC1A00E5A69C /* Guid.h */,
|
||||
210CC88E2C81A98500610F58 /* Guid64.cpp */,
|
||||
210CC88D2C81A98500610F58 /* Guid64.h */,
|
||||
219351AE2C62CC1A00E5A69C /* String.cpp */,
|
||||
219351AF2C62CC1A00E5A69C /* String.h */,
|
||||
);
|
||||
@@ -262,11 +282,42 @@
|
||||
219987FA2BD708BC0035E5EA /* SpeckleLibDoctest */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
210CC8912C81AEBB00610F58 /* Guid32Tests.cpp */,
|
||||
218953A92C0F29FB0078F182 /* EventTests */,
|
||||
);
|
||||
path = SpeckleLibDoctest;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD1F2C86F0280077E104 /* Database */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD1D2C86F0280077E104 /* AccountDatabase.cpp */,
|
||||
21D0BD1E2C86F0280077E104 /* AccountDatabase.h */,
|
||||
21D0BD302C86FE090077E104 /* Identity */,
|
||||
21D0BD272C86FC350077E104 /* Content */,
|
||||
);
|
||||
path = Database;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD272C86FC350077E104 /* Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD252C86FC350077E104 /* Record.cpp */,
|
||||
21D0BD262C86FC350077E104 /* Record.h */,
|
||||
);
|
||||
path = Content;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD302C86FE090077E104 /* Identity */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD2D2C86FE090077E104 /* Index.h */,
|
||||
21D0BD2E2C86FE090077E104 /* Link.cpp */,
|
||||
21D0BD2F2C86FE090077E104 /* Link.h */,
|
||||
);
|
||||
path = Identity;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21F69F1A2C6A0FE2008B6A06 /* Browser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -305,12 +356,14 @@
|
||||
21F69F4A2C6CCC25008B6A06 /* BrowserBridge.cpp */,
|
||||
21F69F4B2C6CCC25008B6A06 /* BrowserBridge.h */,
|
||||
21F69F582C6CDAEE008B6A06 /* Functions */,
|
||||
21F69FA52C733EDA008B6A06 /* JSBridgeArgument.cpp */,
|
||||
21F69F4D2C6CCC25008B6A06 /* JSBridgeArgument.h */,
|
||||
21F69F802C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp */,
|
||||
21F69F692C6E0D59008B6A06 /* JSBridgeArgumentWrap.h */,
|
||||
21F69F4F2C6CCC25008B6A06 /* JSBridgeMethod.h */,
|
||||
21F69F822C701A8E008B6A06 /* JSBridgeMethodBase.h */,
|
||||
210CC86D2C7E879700610F58 /* ArgumentBase.h */,
|
||||
21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */,
|
||||
21F69F4D2C6CCC25008B6A06 /* BridgeArgument.h */,
|
||||
21F69F802C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp */,
|
||||
21F69F692C6E0D59008B6A06 /* BridgeArgumentWrap.h */,
|
||||
210CC87D2C80CD2A00610F58 /* BridgeChild.h */,
|
||||
21F69F4F2C6CCC25008B6A06 /* BridgeMethod.h */,
|
||||
21F69F822C701A8E008B6A06 /* BridgeMethodBase.h */,
|
||||
);
|
||||
path = Bridge;
|
||||
sourceTree = "<group>";
|
||||
@@ -318,7 +371,8 @@
|
||||
21F69F582C6CDAEE008B6A06 /* Functions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21F69F592C6CDB67008B6A06 /* FunctionBinding.h */,
|
||||
21B67D0C2C7E0E8D00FD64FC /* ErrorReport.cpp */,
|
||||
21B67D092C7E0E8D00FD64FC /* ErrorReport.h */,
|
||||
21F69F602C6D0286008B6A06 /* GetBindingsMethodNames.cpp */,
|
||||
21F69F572C6CDAEE008B6A06 /* GetBindingsMethodNames.h */,
|
||||
21F69F7A2C6FD9FC008B6A06 /* GetCallResult.cpp */,
|
||||
@@ -334,6 +388,12 @@
|
||||
children = (
|
||||
21F69F922C71087A008B6A06 /* Account.cpp */,
|
||||
21F69F932C71087A008B6A06 /* Account.h */,
|
||||
21D0BD4C2C8901A00077E104 /* ServerInfo.cpp */,
|
||||
21D0BD4B2C8901A00077E104 /* ServerInfo.h */,
|
||||
21D0BD512C890B1C0077E104 /* ServerMigration.cpp */,
|
||||
21D0BD542C890B1C0077E104 /* ServerMigration.h */,
|
||||
21D0BD572C8910400077E104 /* UserInfo.cpp */,
|
||||
21D0BD582C8910400077E104 /* UserInfo.h */,
|
||||
);
|
||||
path = Credentials;
|
||||
sourceTree = "<group>";
|
||||
@@ -363,6 +423,8 @@
|
||||
2167E2782C4911E2000827D3 /* CMakeLists.txt */,
|
||||
21F93AEA2B2F406D009A2C5B /* Addon.cpp */,
|
||||
21F93AE92B2F406D009A2C5B /* Addon.h */,
|
||||
210CC89D2C81E34400610F58 /* Platform.cpp */,
|
||||
210CC89E2C81E34400610F58 /* Platform.h */,
|
||||
21329F632BFD452C00B5C7AF /* Environment.md */,
|
||||
);
|
||||
path = Environment;
|
||||
@@ -375,8 +437,20 @@
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21F69F5A2C6CDB67008B6A06 /* FunctionBinding.h in Headers */,
|
||||
21D0BD212C86F0280077E104 /* AccountDatabase.h in Headers */,
|
||||
210CC86F2C7E879700610F58 /* ArgumentBase.h in Headers */,
|
||||
210CC8A02C81E34400610F58 /* Platform.h in Headers */,
|
||||
21B67D0D2C7E0E8D00FD64FC /* ErrorReport.h in Headers */,
|
||||
21D0BD332C86FE090077E104 /* Link.h in Headers */,
|
||||
21D0BD5A2C8910400077E104 /* UserInfo.h in Headers */,
|
||||
21D0BD562C890B1C0077E104 /* ServerMigration.h in Headers */,
|
||||
210CC88F2C81A98500610F58 /* Guid64.h in Headers */,
|
||||
21B67D002C7CE15100FD64FC /* Exception.h in Headers */,
|
||||
21D0BD2C2C86FC350077E104 /* Record.h in Headers */,
|
||||
210CC8802C80CD2A00610F58 /* BridgeChild.h in Headers */,
|
||||
21D0BD4D2C8901A00077E104 /* ServerInfo.h in Headers */,
|
||||
2193518C2C62655700E5A69C /* MenuEvent.h in Headers */,
|
||||
21D0BD312C86FE090077E104 /* Index.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -493,6 +567,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
210CC8922C81AEBB00610F58 /* Guid32Tests.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -500,20 +575,27 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21F69FA62C733EDA008B6A06 /* JSBridgeArgument.cpp in Sources */,
|
||||
21D0BD552C890B1C0077E104 /* ServerMigration.cpp in Sources */,
|
||||
21F69FA62C733EDA008B6A06 /* BridgeArgument.cpp in Sources */,
|
||||
21F69F682C6DFB01008B6A06 /* RunMethod.cpp in Sources */,
|
||||
21F69F812C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp in Sources */,
|
||||
21F69F812C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp in Sources */,
|
||||
2193517B2C624FC100E5A69C /* MenuSubscriber.cpp in Sources */,
|
||||
21F69F612C6D0286008B6A06 /* GetBindingsMethodNames.cpp in Sources */,
|
||||
21F93AEC2B2F406E009A2C5B /* Addon.cpp in Sources */,
|
||||
21D0BD4E2C8901A00077E104 /* ServerInfo.cpp in Sources */,
|
||||
21B67D0E2C7E0E8D00FD64FC /* ErrorReport.cpp in Sources */,
|
||||
21F69F7E2C6FD9FC008B6A06 /* GetCallResult.cpp in Sources */,
|
||||
2193519B2C6278D900E5A69C /* SelectionSubscriber.cpp in Sources */,
|
||||
21F69EBE2C63C954008B6A06 /* Link.cpp in Sources */,
|
||||
21D0BD2B2C86FC350077E104 /* Record.cpp in Sources */,
|
||||
21D0BD592C8910400077E104 /* UserInfo.cpp in Sources */,
|
||||
210CC8902C81A98500610F58 /* Guid64.cpp in Sources */,
|
||||
21D0BD322C86FE090077E104 /* Link.cpp in Sources */,
|
||||
219351B32C62CC1A00E5A69C /* String.cpp in Sources */,
|
||||
219351B12C62CC1A00E5A69C /* Guid.cpp in Sources */,
|
||||
21F69FA42C729400008B6A06 /* Record.cpp in Sources */,
|
||||
21F69F512C6CCC25008B6A06 /* BrowserBridge.cpp in Sources */,
|
||||
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */,
|
||||
210CC89F2C81E34400610F58 /* Platform.cpp in Sources */,
|
||||
21D0BD202C86F0280077E104 /* AccountDatabase.cpp in Sources */,
|
||||
21F69F962C71087A008B6A06 /* Account.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -19,23 +19,27 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Speckle\Database\Content\Index.h" />
|
||||
<ClInclude Include="Speckle\Database\Content\Link.h" />
|
||||
<ClInclude Include="Speckle\Database\AccountDatabase.h" />
|
||||
<ClInclude Include="Speckle\Database\Content\Record.h" />
|
||||
<ClInclude Include="Speckle\Database\Identity\Index.h" />
|
||||
<ClInclude Include="Speckle\Database\Identity\Link.h" />
|
||||
<ClInclude Include="Speckle\Environment\Addon.h" />
|
||||
<ClInclude Include="Speckle\Environment\Platform.h" />
|
||||
<ClInclude Include="Speckle\Event\Subscriber\MenuSubscriber.h" />
|
||||
<ClInclude Include="Speckle\Event\Subscriber\SelectionSubscriber.h" />
|
||||
<ClInclude Include="Speckle\Event\Type\MenuEvent.h" />
|
||||
<ClInclude Include="Speckle\Event\Type\SelectionEvent.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeArgument.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeArgumentWrap.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeChild.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeMethod.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeMethodBase.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BrowserBridge.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\FunctionBinding.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\ErrorReport.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\PlatformBinding.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\GetBindingsMethodNames.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\GetCallResult.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\RunMethod.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeArgument.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeArgumentWrap.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeMethod.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeMethodBase.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\Functional.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\JSBinding.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\JSFunction.h" />
|
||||
@@ -44,25 +48,37 @@
|
||||
<ClInclude Include="Speckle\Interface\Browser\NamedFunction.h" />
|
||||
<ClInclude Include="Speckle\Interface\Browser\PlatformBinding.h" />
|
||||
<ClInclude Include="Speckle\Record\Credentials\Account.h" />
|
||||
<ClInclude Include="Speckle\Record\Credentials\ServerInfo.h" />
|
||||
<ClInclude Include="Speckle\Record\Credentials\ServerMigration.h" />
|
||||
<ClInclude Include="Speckle\Record\Credentials\UserInfo.h" />
|
||||
<ClInclude Include="Speckle\Serialise\JSBase\JSBaseTransport.h" />
|
||||
<ClInclude Include="Speckle\Utility\Exception.h" />
|
||||
<ClInclude Include="Speckle\Utility\Guid.h" />
|
||||
<ClInclude Include="Speckle\Utility\Guid64.h" />
|
||||
<ClInclude Include="Speckle\Utility\String.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Speckle\Database\Content\Link.cpp" />
|
||||
<ClCompile Include="Speckle\Database\AccountDatabase.cpp" />
|
||||
<ClCompile Include="Speckle\Database\Content\Record.cpp" />
|
||||
<ClCompile Include="Speckle\Database\Identity\Link.cpp" />
|
||||
<ClCompile Include="Speckle\Environment\Addon.cpp" />
|
||||
<ClCompile Include="Speckle\Environment\Platform.cpp" />
|
||||
<ClCompile Include="Speckle\Event\Subscriber\MenuSubscriber.cpp" />
|
||||
<ClCompile Include="Speckle\Event\Subscriber\SelectionSubscriber.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BridgeArgument.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BridgeArgumentWrap.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BrowserBridge.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\ErrorReport.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\GetBindingsMethodNames.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\GetCallResult.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\RunMethod.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\JSBridgeArgument.cpp" />
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\JSBridgeArgumentWrap.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Credentials\Account.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Credentials\ServerInfo.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Credentials\ServerMigration.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Credentials\UserInfo.cpp" />
|
||||
<ClCompile Include="Speckle\Serialise\JSBase\JSBaseTransport.cpp" />
|
||||
<ClCompile Include="Speckle\Utility\Guid.cpp" />
|
||||
<ClCompile Include="Speckle\Utility\Guid64.cpp" />
|
||||
<ClCompile Include="Speckle\Utility\String.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -193,7 +209,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<PreprocessorDefinitions>WINDOWS;ARCHICAD;ACExtension;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>DEBUG;WINDOWS;ARCHICAD;ACExtension;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
|
||||
@@ -53,14 +53,11 @@
|
||||
<Filter Include="Speckle\Serialise\JSBase">
|
||||
<UniqueIdentifier>{8b3f75a2-8538-4f58-bc69-07679e9af863}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Speckle\Database\Identity">
|
||||
<UniqueIdentifier>{ef1710f6-d890-4286-8fb2-f5c432a2c5ac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Speckle\Database\Content\Index.h">
|
||||
<Filter>Speckle\Database\Content</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Database\Content\Link.h">
|
||||
<Filter>Speckle\Database\Content</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Environment\Addon.h">
|
||||
<Filter>Speckle\Environment</Filter>
|
||||
</ClInclude>
|
||||
@@ -106,19 +103,7 @@
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BrowserBridge.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeArgument.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeArgumentWrap.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeMethod.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\JSBridgeMethodBase.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\FunctionBinding.h">
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\PlatformBinding.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge\Functions</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\GetBindingsMethodNames.h">
|
||||
@@ -139,11 +124,53 @@
|
||||
<ClInclude Include="Speckle\Serialise\JSBase\JSBaseTransport.h">
|
||||
<Filter>Speckle\Serialise\JSBase</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Utility\Exception.h">
|
||||
<Filter>Speckle\Utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\ErrorReport.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge\Functions</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeArgument.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeArgumentWrap.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeChild.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeMethod.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Interface\Browser\Bridge\BridgeMethodBase.h">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Utility\Guid64.h">
|
||||
<Filter>Speckle\Utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Database\Identity\Index.h">
|
||||
<Filter>Speckle\Database\Identity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Database\Identity\Link.h">
|
||||
<Filter>Speckle\Database\Identity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Database\AccountDatabase.h">
|
||||
<Filter>Speckle\Database</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Record\Credentials\ServerInfo.h">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Record\Credentials\ServerMigration.h">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Record\Credentials\UserInfo.h">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Environment\Platform.h">
|
||||
<Filter>Speckle\Environment</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Speckle\Database\Content\Link.cpp">
|
||||
<Filter>Speckle\Database\Content</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Environment\Addon.cpp">
|
||||
<Filter>Speckle\Environment</Filter>
|
||||
</ClCompile>
|
||||
@@ -162,12 +189,6 @@
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BrowserBridge.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\JSBridgeArgument.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\JSBridgeArgumentWrap.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\GetBindingsMethodNames.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge\Functions</Filter>
|
||||
</ClCompile>
|
||||
@@ -186,6 +207,36 @@
|
||||
<ClCompile Include="Speckle\Serialise\JSBase\JSBaseTransport.cpp">
|
||||
<Filter>Speckle\Serialise\JSBase</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\ErrorReport.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge\Functions</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BridgeArgument.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Interface\Browser\Bridge\BridgeArgumentWrap.cpp">
|
||||
<Filter>Speckle\Interface\Browser\Bridge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Utility\Guid64.cpp">
|
||||
<Filter>Speckle\Utility</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Database\Identity\Link.cpp">
|
||||
<Filter>Speckle\Database\Identity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Database\AccountDatabase.cpp">
|
||||
<Filter>Speckle\Database</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Record\Credentials\ServerInfo.cpp">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Record\Credentials\ServerMigration.cpp">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Record\Credentials\UserInfo.cpp">
|
||||
<Filter>Speckle\Record\Credentials</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Environment\Platform.cpp">
|
||||
<Filter>Speckle\Environment</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Speckle\CMakeLists.txt">
|
||||
|
||||
Reference in New Issue
Block a user