Compare commits

..

1 Commits

Author SHA1 Message Date
Jedd Morgan b17d3d6d64 escape buildresAC.bat 2024-08-22 20:06:20 +01:00
102 changed files with 787 additions and 3336 deletions
-1
View File
@@ -21,4 +21,3 @@ CMakeFiles/
XCBuildData/
**/*.xcsettings
*.log
.idea
+8 -24
View File
@@ -96,25 +96,17 @@
<ClCompile Include="Connector\Database\Model\Card\ModelCardDatabase.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Account\AccountBridge.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Account\GetAccounts.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetDocumentInfo.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetDocumentState.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationName.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationVersion.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetConfig.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp"/>
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.cpp" />
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\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>
@@ -125,25 +117,17 @@
<ClInclude Include="Connector\Event\ConnectorEventID.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Account\AccountBridge.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Account\GetAccounts.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetDocumentInfo.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetDocumentState.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationName.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetSourceApplicationVersion.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.h" />
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\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" />
@@ -580,7 +564,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>TESTING_MODE;DEBUG;ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_STLP_DONT_FORCE_MSVC_LIB_NAME;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_STLP_DONT_FORCE_MSVC_LIB_NAME;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
@@ -609,7 +593,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STATD.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STATD.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>msvcrt.lib</IgnoreSpecificDefaultLibraries>
@@ -767,7 +751,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>NDEBUG;ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ARCHICAD;WIN32;_WINDOWS;WINDOWS;AddOn_EXPORTS;ACExtension;_USRDLL;_WIN_EXTERNAL_;_WINDLL;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
@@ -797,7 +781,7 @@ CALL "$(ProjectDir)..\SpeckleLib\Make.win\install.bat"</Command>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STAT.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;$(HEADER_PATH_5)\Modules\JSON\Win\JSONImp.LIB;msvcrt.lib;msvcprt.lib;IPHLPAPI.lib;Wininet.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(HEADER_PATH_5)\Lib\ACAP_STAT.lib;$(HEADER_PATH_5)\Modules\DGGraphix\Win\DGGraphixImp.LIB;$(HEADER_PATH_5)\Modules\DGLib\Win\DGImp.lib;$(HEADER_PATH_5)\Modules\Geometry\Win\GeometryImp.LIB;$(HEADER_PATH_5)\Modules\Graphix\Win\GraphixImp.LIB;$(HEADER_PATH_5)\Modules\GSModeler\Win\GSModelerImp.LIB;$(HEADER_PATH_5)\Modules\GSRoot\Win\GSRootImp.lib;$(HEADER_PATH_5)\Modules\GXImage\Win\GXImageImp.lib;$(HEADER_PATH_5)\Modules\GXImageBase\Win\GXImageBaseImp.lib;$(HEADER_PATH_5)\Modules\GX\Win\GXImp.LIB;$(HEADER_PATH_5)\Modules\InputOutput\Win\InputOutputImp.lib;$(HEADER_PATH_5)\Modules\RS\Win\RSImp.LIB;$(HEADER_PATH_5)\Modules\TextEngine\Win\TextEngineImp.LIB;$(HEADER_PATH_5)\Modules\UCLib\Win\UCImp.lib;$(HEADER_PATH_5)\Modules\UDLib\Win\UDImp.lib;$(HEADER_PATH_5)\Modules\VBElemDialogs\Win\VBElemDialogsImp.LIB;$(HEADER_PATH_5)\Modules\VectorImage\Win\VectorImageImp.LIB;$(HEADER_PATH_5)\Modules\JavascriptEngine\Win\JavascriptEngineImp.LIB;msvcrt.lib;msvcprt.lib;IPHLPAPI.lib;Wininet.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(HEADER_PATH_5)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
+12 -69
View File
@@ -38,21 +38,6 @@
<Filter Include="Connector\Database\Model\Card">
<UniqueIdentifier>{85935d00-16ac-466a-a614-ad9ea802bffa}</UniqueIdentifier>
</Filter>
<Filter Include="Connector\Interface\Browser\Bridge\Config\Arg">
<UniqueIdentifier>{6a2f1f18-a554-4546-bba3-314d5f2ec9f9}</UniqueIdentifier>
</Filter>
<Filter Include="Connector\Interface\Browser\Bridge\Base\Arg">
<UniqueIdentifier>{d74446ad-e141-48ac-9fa0-8b82279bbdbf}</UniqueIdentifier>
</Filter>
<Filter Include="Connector\Interface\Browser\Bridge\Test">
<UniqueIdentifier>{9976ca16-8f99-44a2-b596-b81df82d847a}</UniqueIdentifier>
</Filter>
<Filter Include="Connector\Interface\Browser\Bridge\Test\Arg">
<UniqueIdentifier>{1656a0df-aa39-4f41-860f-7b278b31784a}</UniqueIdentifier>
</Filter>
<Filter Include="Connector\Interface\Browser\Bridge\Send">
<UniqueIdentifier>{2b87cf11-87cd-435f-ab24-42170c2e657e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="RFIX.win\Connector.rc2">
@@ -95,6 +80,9 @@
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.cpp">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.cpp">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetConfig.cpp">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClCompile>
@@ -104,6 +92,9 @@
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.cpp">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.cpp">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.cpp">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClCompile>
@@ -122,33 +113,6 @@
<ClCompile Include="Connector\Database\Model\Card\ModelCardDatabase.cpp">
<Filter>Connector\Database\Model\Card</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.cpp">
<Filter>Connector\Interface\Browser\Bridge\Config\Arg</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.cpp">
<Filter>Connector\Interface\Browser\Bridge\Base\Arg</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GoAway.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\SayHi.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TestBridge.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test\Arg</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.cpp">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClCompile>
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\SendBridge.cpp">
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Connector\ConnectorResource.h">
@@ -172,6 +136,9 @@
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConfigBridge.h">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\ConnectorConfig.h">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h">
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
</ClInclude>
@@ -181,6 +148,9 @@
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\BaseBridge.h">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\DocumentInfo.h">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\GetConnectorVersion.h">
<Filter>Connector\Interface\Browser\Bridge\Base</Filter>
</ClInclude>
@@ -205,32 +175,5 @@
<ClInclude Include="Connector\Database\Model\Card\ModelCardDatabase.h">
<Filter>Connector\Database\Model\Card</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\Arg\ConnectorConfig.h">
<Filter>Connector\Interface\Browser\Bridge\Config\Arg</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Base\Arg\DocumentInfo.h">
<Filter>Connector\Interface\Browser\Bridge\Base\Arg</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.h">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GoAway.h">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\SayHi.h">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TestBridge.h">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.h">
<Filter>Connector\Interface\Browser\Bridge\Test\Arg</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\TriggerEvent.h">
<Filter>Connector\Interface\Browser\Bridge\Test</Filter>
</ClInclude>
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\SendBridge.h">
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -22,7 +22,6 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
210CC8832C80E6A300610F58 /* TriggerEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC8812C80E6A300610F58 /* TriggerEvent.cpp */; };
213CC39C2B1101F500088049 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2151077C2AEDB9070022CD24 /* Cocoa.framework */; };
214B7A372C764BCD00D586C1 /* UpdateConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */; };
219F30422C769283009834E9 /* ConfigTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219F30402C769282009834E9 /* ConfigTests.cpp */; };
@@ -32,18 +31,10 @@
21B67CAD2C77329800FD64FC /* GetSourceApplicationName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CA72C77329800FD64FC /* GetSourceApplicationName.cpp */; };
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CA92C77329800FD64FC /* GetSourceApplicationVersion.cpp */; };
21B67CB92C774BFA00FD64FC /* GetConnectorVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */; };
21B67CBD2C77537C00FD64FC /* DocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */; };
21B67CC02C775A0D00FD64FC /* GetDocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */; };
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CC22C77649F00FD64FC /* GetDocumentState.cpp */; };
21B67CCC2C77670400FD64FC /* ModelCardDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */; };
21B67CD92C78C83800FD64FC /* TestBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CD62C78C83800FD64FC /* TestBridge.cpp */; };
21B67CDC2C78C88000FD64FC /* SayHi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CDA2C78C87F00FD64FC /* SayHi.cpp */; };
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */; };
21B67CE72C78D23B00FD64FC /* ConnectorConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */; };
21B67CEB2C78D27200FD64FC /* DocumentInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */; };
21B67CF12C78D38000FD64FC /* GoAway.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CF02C78D38000FD64FC /* GoAway.cpp */; };
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */; };
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */; };
21D0BD672C89D7410077E104 /* AccountTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD642C89D7400077E104 /* AccountTests.cpp */; };
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 */; };
@@ -205,6 +196,7 @@
21F69F8D2C70D7EE008B6A06 /* GetAccounts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F8B2C70D7EE008B6A06 /* GetAccounts.cpp */; };
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FB42C762EF0008B6A06 /* ConfigBridge.cpp */; };
21F69FBC2C762EF0008B6A06 /* GetConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FB62C762EF0008B6A06 /* GetConfig.cpp */; };
21F69FC22C7632B7008B6A06 /* ConnectorConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FC02C7632B7008B6A06 /* ConnectorConfig.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -267,13 +259,11 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
210CC8812C80E6A300610F58 /* TriggerEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerEvent.cpp; sourceTree = "<group>"; };
210CC8822C80E6A300610F58 /* TriggerEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerEvent.h; sourceTree = "<group>"; };
213CC3A52B1101F500088049 /* Speckle Connector.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Speckle Connector.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
2151077C2AEDB9070022CD24 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
2161FD902BF2600C006D9527 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
219388682C4E5DE2002A0180 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Connector-AC27-Test.vwlibrary"; sourceTree = BUILT_PRODUCTS_DIR; };
219F30402C769282009834E9 /* ConfigTests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = ConfigTests.cpp; sourceTree = "<group>"; };
219F30432C7693B6009834E9 /* Connector-AC27-Debug.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Connector-AC27-Debug.xctestplan"; sourceTree = SOURCE_ROOT; };
21B67CA52C77329800FD64FC /* BaseBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseBridge.cpp; sourceTree = "<group>"; };
@@ -285,6 +275,8 @@
21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetConnectorVersion.cpp; sourceTree = "<group>"; };
21B67CB82C774BFA00FD64FC /* GetConnectorVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetConnectorVersion.h; sourceTree = "<group>"; };
21B67CBA2C774C6500FD64FC /* Version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Version.h; sourceTree = "<group>"; };
21B67CBB2C77537C00FD64FC /* DocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentInfo.h; sourceTree = "<group>"; };
21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentInfo.cpp; sourceTree = "<group>"; };
21B67CBE2C775A0D00FD64FC /* GetDocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetDocumentInfo.h; sourceTree = "<group>"; };
21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetDocumentInfo.cpp; sourceTree = "<group>"; };
21B67CC12C77649E00FD64FC /* GetDocumentState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetDocumentState.h; sourceTree = "<group>"; };
@@ -292,23 +284,6 @@
21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModelCardDatabase.cpp; sourceTree = "<group>"; };
21B67CC82C77670400FD64FC /* ModelCardDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCardDatabase.h; sourceTree = "<group>"; };
21B67CCD2C77694500FD64FC /* Connector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
21B67CD62C78C83800FD64FC /* TestBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestBridge.cpp; sourceTree = "<group>"; };
21B67CD72C78C83800FD64FC /* TestBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestBridge.h; sourceTree = "<group>"; };
21B67CDA2C78C87F00FD64FC /* SayHi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SayHi.cpp; sourceTree = "<group>"; };
21B67CDB2C78C87F00FD64FC /* SayHi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SayHi.h; sourceTree = "<group>"; };
21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SayHiArg.cpp; sourceTree = "<group>"; };
21B67CE12C78D1FB00FD64FC /* SayHiArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SayHiArg.h; sourceTree = "<group>"; };
21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectorConfig.cpp; sourceTree = "<group>"; };
21B67CE52C78D23B00FD64FC /* ConnectorConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectorConfig.h; sourceTree = "<group>"; };
21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentInfo.cpp; sourceTree = "<group>"; };
21B67CE92C78D27200FD64FC /* DocumentInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentInfo.h; sourceTree = "<group>"; };
21B67CEF2C78D38000FD64FC /* GoAway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoAway.h; sourceTree = "<group>"; };
21B67CF02C78D38000FD64FC /* GoAway.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoAway.cpp; sourceTree = "<group>"; };
21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetComplexType.cpp; sourceTree = "<group>"; };
21B67CF62C78D4DE00FD64FC /* GetComplexType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetComplexType.h; sourceTree = "<group>"; };
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendBridge.cpp; sourceTree = "<group>"; };
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendBridge.h; sourceTree = "<group>"; };
21D0BD642C89D7400077E104 /* AccountTests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = AccountTests.cpp; sourceTree = "<group>"; };
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>"; };
@@ -486,6 +461,8 @@
21F69FB72C762EF0008B6A06 /* GetConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetConfig.h; sourceTree = "<group>"; };
21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UpdateConfig.cpp; sourceTree = "<group>"; };
21F69FBE2C7630B3008B6A06 /* UpdateConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateConfig.h; sourceTree = "<group>"; };
21F69FC02C7632B7008B6A06 /* ConnectorConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectorConfig.cpp; sourceTree = "<group>"; };
21F69FC12C7632B7008B6A06 /* ConnectorConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectorConfig.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -667,7 +644,7 @@
isa = PBXGroup;
children = (
213CC3A52B1101F500088049 /* Speckle Connector.bundle */,
219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */,
219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */,
);
name = Products;
sourceTree = "<group>";
@@ -876,7 +853,6 @@
219F30412C769282009834E9 /* ConnectorTests */ = {
isa = PBXGroup;
children = (
21D0BD642C89D7400077E104 /* AccountTests.cpp */,
219F30402C769282009834E9 /* ConfigTests.cpp */,
219F30432C7693B6009834E9 /* Connector-AC27-Debug.xctestplan */,
);
@@ -886,9 +862,10 @@
21B67CAB2C77329800FD64FC /* Base */ = {
isa = PBXGroup;
children = (
21B67CEA2C78D27200FD64FC /* Arg */,
21B67CA52C77329800FD64FC /* BaseBridge.cpp */,
21B67CA62C77329800FD64FC /* BaseBridge.h */,
21B67CBC2C77537C00FD64FC /* DocumentInfo.cpp */,
21B67CBB2C77537C00FD64FC /* DocumentInfo.h */,
21B67CB72C774BFA00FD64FC /* GetConnectorVersion.cpp */,
21B67CB82C774BFA00FD64FC /* GetConnectorVersion.h */,
21B67CBF2C775A0D00FD64FC /* GetDocumentInfo.cpp */,
@@ -928,60 +905,6 @@
path = Database;
sourceTree = "<group>";
};
21B67CD82C78C83800FD64FC /* Test */ = {
isa = PBXGroup;
children = (
21B67CE22C78D1FB00FD64FC /* Arg */,
21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */,
21B67CF62C78D4DE00FD64FC /* GetComplexType.h */,
21B67CF02C78D38000FD64FC /* GoAway.cpp */,
21B67CEF2C78D38000FD64FC /* GoAway.h */,
21B67CDA2C78C87F00FD64FC /* SayHi.cpp */,
21B67CDB2C78C87F00FD64FC /* SayHi.h */,
21B67CD62C78C83800FD64FC /* TestBridge.cpp */,
21B67CD72C78C83800FD64FC /* TestBridge.h */,
210CC8812C80E6A300610F58 /* TriggerEvent.cpp */,
210CC8822C80E6A300610F58 /* TriggerEvent.h */,
);
path = Test;
sourceTree = "<group>";
};
21B67CE22C78D1FB00FD64FC /* Arg */ = {
isa = PBXGroup;
children = (
21B67CE02C78D1FB00FD64FC /* SayHiArg.cpp */,
21B67CE12C78D1FB00FD64FC /* SayHiArg.h */,
);
path = Arg;
sourceTree = "<group>";
};
21B67CE62C78D23B00FD64FC /* Arg */ = {
isa = PBXGroup;
children = (
21B67CE42C78D23B00FD64FC /* ConnectorConfig.cpp */,
21B67CE52C78D23B00FD64FC /* ConnectorConfig.h */,
);
path = Arg;
sourceTree = "<group>";
};
21B67CEA2C78D27200FD64FC /* Arg */ = {
isa = PBXGroup;
children = (
21B67CE82C78D27200FD64FC /* DocumentInfo.cpp */,
21B67CE92C78D27200FD64FC /* DocumentInfo.h */,
);
path = Arg;
sourceTree = "<group>";
};
21D0BD5D2C89BFEA0077E104 /* Send */ = {
isa = PBXGroup;
children = (
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */,
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */,
);
path = Send;
sourceTree = "<group>";
};
21D1EA472BF14B6C00957EAA /* Archicad */ = {
isa = PBXGroup;
children = (
@@ -1063,8 +986,6 @@
21F69F852C70D2C4008B6A06 /* Account */,
21B67CAB2C77329800FD64FC /* Base */,
21F69FB82C762EF0008B6A06 /* Config */,
21D0BD5D2C89BFEA0077E104 /* Send */,
21B67CD82C78C83800FD64FC /* Test */,
);
path = Bridge;
sourceTree = "<group>";
@@ -1080,9 +1001,10 @@
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 */,
@@ -1145,7 +1067,7 @@
);
name = "Connector-AC27-Test";
productName = "Connector-AC27-Test";
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.bundle */;
productReference = 219F30352C768F0A009834E9 /* Connector-AC27-Test.vwlibrary */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
@@ -1296,29 +1218,22 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */,
21B67CBD2C77537C00FD64FC /* DocumentInfo.cpp in Sources */,
21F69FC22C7632B7008B6A06 /* ConnectorConfig.cpp in Sources */,
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */,
21F69F8A2C70D2C4008B6A06 /* AccountBridge.cpp in Sources */,
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;
@@ -1328,7 +1243,6 @@
buildActionMask = 2147483647;
files = (
219F30422C769283009834E9 /* ConfigTests.cpp in Sources */,
21D0BD672C89D7410077E104 /* AccountTests.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1419,6 +1333,7 @@
"\"$(HEADER_PATH_6)\"",
"\"$(HEADER_PATH_8)\"",
);
WRAPPER_EXTENSION = bundle;
};
name = Debug;
};
@@ -1483,6 +1398,7 @@
"\"$(HEADER_PATH_6)\"",
"\"$(HEADER_PATH_8)\"",
);
WRAPPER_EXTENSION = bundle;
};
name = Release;
};
@@ -1522,7 +1438,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = (
TESTING_MODE,
ARCHICAD,
AddOn_EXPORTS,
"'macintosh=1'",
@@ -1593,6 +1508,7 @@
"-multiply_defined",
suppress,
);
WRAPPER_EXTENSION = bundle;
};
name = Debug;
};
@@ -1633,7 +1549,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = (
TESTING_MODE,
ARCHICAD,
AddOn_EXPORTS,
"'macintosh=1'",
@@ -1701,6 +1616,7 @@
"-multiply_defined",
suppress,
);
WRAPPER_EXTENSION = bundle;
};
name = Release;
};
@@ -1860,7 +1776,7 @@
OBJROOT = "";
ONLY_ACTIVE_ARCH = YES;
PLUGIN_FOLDER = "";
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
PRODUCT_NAME = "$(BASE_NAME)";
RESOURCE_EXTENSION = "";
REZ_SEARCH_PATHS = (
@@ -1887,7 +1803,7 @@
suppress,
);
WORD_SIZE = 64;
WRAPPER_EXTENSION = bundle;
WRAPPER_EXTENSION = vwlibrary;
};
name = Debug;
};
@@ -1966,7 +1882,7 @@
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
OBJROOT = "";
PLUGIN_FOLDER = "";
PRODUCT_BUNDLE_IDENTIFIER = systems.speckle.connector;
PRODUCT_BUNDLE_IDENTIFIER = net.activethread.connector;
PRODUCT_NAME = "$(BASE_NAME)";
RESOURCE_EXTENSION = "";
REZ_SEARCH_PATHS = (
@@ -1989,7 +1905,7 @@
);
USE_HEADERMAP = YES;
WORD_SIZE = 64;
WRAPPER_EXTENSION = bundle;
WRAPPER_EXTENSION = vwlibrary;
};
name = Release;
};
@@ -29,7 +29,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "219F30342C768F0A009834E9"
BuildableName = "Connector-AC27-Test.bundle"
BuildableName = "Connector-AC27-Test.vwlibrary"
BlueprintName = "Connector-AC27-Test"
ReferencedContainer = "container:Connector.xcodeproj">
</BuildableReference>
@@ -20,7 +20,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "219F30342C768F0A009834E9"
BuildableName = "Connector-AC27-Test.bundle"
BuildableName = "Connector-AC27-Test.vwlibrary"
BlueprintName = "Connector-AC27-Test"
ReferencedContainer = "container:Connector.xcodeproj">
</BuildableReference>
+1 -55
View File
@@ -1,28 +1,19 @@
#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:
@@ -37,34 +28,15 @@ namespace {
Get the model card database
@return The model card database
*/
const ModelCardDatabase* getModelCardDatabase() const override { return &m_modelCards; }
/*!
Get the account database
@return The account database
*/
const AccountDatabase* getAccountDatabase() const override;
const ModelCardDatabase* getModelCards() const override { return &m_modelCards; }
private:
mutable std::unique_ptr<AccountDatabase> m_account;
ModelCardDatabase m_modelCards;
};
///The active addon instance
std::unique_ptr<ConnectorAddon> m_addonInstance;
/*--------------------------------------------------------------------
Get the speckle application data directory (creating if missing)
return: The application data directory (nullopt = missing and unable to create)
--------------------------------------------------------------------*/
Directory::Option getAppDataDirectory() {
auto appData = Directory::appData();
if (!appData)
return std::nullopt;
return Directory{*appData, speckleDataDirName, true};
} //getAppDataDirectory
}
/*--------------------------------------------------------------------
@@ -76,32 +48,6 @@ 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
+3 -9
View File
@@ -1,11 +1,10 @@
#include "Speckle/Environment/Addon.h"
#include "Speckle/Utility/String.h"
namespace speckle::database {
class AccountDatabase;
}
namespace connector::database {
class ModelCardDatabase;
}
namespace connector {
@@ -20,12 +19,7 @@ namespace connector {
Get the model card database
@return The model card database
*/
const virtual database::ModelCardDatabase* getModelCardDatabase() const = 0;
/*!
Get the account database
@return The account database
*/
const virtual speckle::database::AccountDatabase* getAccountDatabase() const = 0;
const virtual database::ModelCardDatabase* getModelCards() const = 0;
protected:
/*!
@@ -21,7 +21,7 @@ namespace {
///Serialisation field IDs
static std::array fieldID = {
Identity{"models"},
Identity{"model"},
};
}
@@ -2,8 +2,6 @@
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Connector/Connector.h"
#include "Speckle/Database/AccountDatabase.h"
#include "Speckle/Record/Credentials/Account.h"
using namespace active::container;
@@ -21,7 +19,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetAccounts::GetAccounts() : BridgeMethod{"GetAccounts", [&]() {
GetAccounts::GetAccounts() : JSBridgeMethod{"GetAccounts", [&]() {
return run();
}} {}
@@ -31,9 +29,8 @@ GetAccounts::GetAccounts() : BridgeMethod{"GetAccounts", [&]() {
return: The accounts (empty array when none defined)
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetAccounts::run() const {
std::unique_ptr<Cargo> GetAccounts::run(void) const {
Vector<Account> accounts;
if (auto accountDBase = connector()->getAccountDatabase(); accountDBase != nullptr)
accounts = accountDBase->getAccounts();
///TODO: Get the accounts here - returning an empty array for testing only
return std::make_unique<WrappedValue>(accounts);
} //GetAccounts::run
@@ -1,14 +1,14 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_ACCOUNTS
#define CONNECTOR_INTERFACE_BRIDGE_GET_ACCOUNTS
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
*/
class GetAccounts : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetAccounts : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
Get the accounts
@return The accounts (empty array when none defined)
*/
std::unique_ptr<active::serialise::Cargo> run() const;
std::unique_ptr<active::serialise::Cargo> run(void) const;
};
}
@@ -1,4 +1,4 @@
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
@@ -19,9 +19,9 @@ namespace {
///Serialisation field IDs
static std::array fieldID = {
Identity{"location"},
Identity{"name"},
Identity{"id"},
Identity{"Location"},
Identity{"Name"},
Identity{"Id"},
};
}
@@ -19,7 +19,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetConnectorVersion::GetConnectorVersion() : BridgeMethod{"GetConnectorVersion", [&]() {
GetConnectorVersion::GetConnectorVersion() : JSBridgeMethod{"GetConnectorVersion", [&]() {
return run();
}} {}
@@ -1,7 +1,7 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_VERSION
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
@@ -10,7 +10,7 @@ namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
*/
class GetConnectorVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetConnectorVersion : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -1,7 +1,8 @@
#include "Connector/Interface/Browser/Bridge/Base/GetDocumentInfo.h"
#include "Active/Serialise/CargoHold.h"
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
using namespace active::container;
using namespace active::serialise;
@@ -17,7 +18,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetDocumentInfo::GetDocumentInfo() : BridgeMethod{"GetDocumentInfo", [&]() {
GetDocumentInfo::GetDocumentInfo() : JSBridgeMethod{"GetDocumentInfo", [&]() {
return run();
}} {}
@@ -27,7 +28,7 @@ GetDocumentInfo::GetDocumentInfo() : BridgeMethod{"GetDocumentInfo", [&]() {
return: The document info
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetDocumentInfo::run() const {
std::unique_ptr<Cargo> GetDocumentInfo::run(void) const {
///TODO: Get the document info here - returning mocked values for now
DocumentInfo docInfo{"Somewhere", "Something", String{active::utility::Guid{true}.operator active::utility::String()}};
return std::make_unique<WrappedValue>(docInfo);
@@ -1,14 +1,14 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_INFO
#define CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_INFO
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the information about the active document
*/
class GetDocumentInfo : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetDocumentInfo : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
Get the document info
@return The document info
*/
std::unique_ptr<active::serialise::Cargo> run() const;
std::unique_ptr<active::serialise::Cargo> run(void) const;
};
}
@@ -1,6 +1,8 @@
#include "Connector/Interface/Browser/Bridge/Base/GetDocumentState.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Connector/Interface/Browser/Bridge/Base/DocumentInfo.h"
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
using namespace active::container;
@@ -18,7 +20,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
GetDocumentState::GetDocumentState() : JSBridgeMethod{"GetDocumentState", [&]() {
return run();
}} {}
@@ -28,7 +30,7 @@ GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
return: The document info
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetDocumentState::run() const {
std::unique_ptr<Cargo> GetDocumentState::run(void) const {
///TODO: Retrieve the model card database from connector()->getModelCards() in future (when implemented)
ModelCardDatabase modelCards; //This is just a temp so something can be sent back to the JS for the interim
return std::make_unique<WrappedValue>(modelCards);
@@ -1,14 +1,14 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_STATE
#define CONNECTOR_INTERFACE_BRIDGE_GET_DOCUMENT_STATE
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the information about the active document
*/
class GetDocumentState : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetDocumentState : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -24,7 +24,7 @@ namespace connector::interfac::browser::bridge {
Get the document info
@return The document info
*/
std::unique_ptr<active::serialise::Cargo> run() const;
std::unique_ptr<active::serialise::Cargo> run(void) const;
};
}
@@ -18,7 +18,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetSourceApplicationName::GetSourceApplicationName() : BridgeMethod{"GetSourceApplicationName", [&]() {
GetSourceApplicationName::GetSourceApplicationName() : JSBridgeMethod{"GetSourceApplicationName", [&]() {
return run();
}} {}
@@ -28,7 +28,7 @@ GetSourceApplicationName::GetSourceApplicationName() : BridgeMethod{"GetSourceAp
return: The application name
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetSourceApplicationName::run() const {
std::unique_ptr<Cargo> GetSourceApplicationName::run(void) const {
//Implement other platforms as required
#ifdef ARCHICAD
String result{"Archicad"};
@@ -1,14 +1,14 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_APP_NAME
#define CONNECTOR_INTERFACE_BRIDGE_GET_APP_NAME
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the host application name
*/
class GetSourceApplicationName : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetSourceApplicationName : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -18,7 +18,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetSourceApplicationVersion::GetSourceApplicationVersion() : BridgeMethod{"GetSourceApplicationVersion", [&]() {
GetSourceApplicationVersion::GetSourceApplicationVersion() : JSBridgeMethod{"GetSourceApplicationVersion", [&]() {
return run();
}} {}
@@ -1,7 +1,7 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_APP_VERSION
#define CONNECTOR_INTERFACE_BRIDGE_GET_APP_VERSION
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
@@ -10,7 +10,7 @@ namespace connector::interfac::browser::bridge {
/*!
JS Function class to get the host application version
*/
class GetSourceApplicationVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetSourceApplicationVersion : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
@@ -2,7 +2,6 @@
#include "Connector/Interface/Browser/Bridge/Config/GetConfig.h"
#include "Connector/Interface/Browser/Bridge/Config/UpdateConfig.h"
#include "Connector/Interface/Browser/Bridge/Config/GetIsDevMode.h"
using namespace connector::interfac::browser::bridge;
@@ -13,5 +12,4 @@ ConfigBridge::ConfigBridge() : BrowserBridge{"configBinding"} {
//Add bridge methods
addMethod<GetConfig>();
addMethod<UpdateConfig>();
addMethod<GetIsDevMode>();
} //ConfigBridge::ConfigBridge
@@ -1,7 +1,6 @@
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include <array>
@@ -17,7 +16,7 @@ namespace {
///Serialisation field IDs
static std::array fieldID = {
Identity{"darkTheme"},
Identity{"DarkTheme"},
};
}
@@ -2,7 +2,6 @@
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Interface/Browser/Bridge/ArgumentBase.h"
namespace connector::interfac::browser::bridge {
@@ -25,7 +24,7 @@ namespace connector::interfac::browser::bridge {
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
///True if the UI renders in dark mode
///?
bool isDarkTheme = true;
// MARK: - Serialisation
@@ -2,7 +2,7 @@
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
using namespace active::serialise;
using namespace connector::interfac::browser::bridge;
@@ -18,7 +18,7 @@ namespace {
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetConfig::GetConfig() : BridgeMethod{"GetConfig", [&]() {
GetConfig::GetConfig() : JSBridgeMethod{"GetConfig", [&]() {
return run();
}} {}
@@ -28,8 +28,8 @@ GetConfig::GetConfig() : BridgeMethod{"GetConfig", [&]() {
return: The settings
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetConfig::run() const {
std::unique_ptr<Cargo> GetConfig::run(void) const {
ConnectorConfig config;
///TODO: Get the accounts here - returning an empty array for testing only
///TODO: Get the accounts here - returning an empty array for testing only
return std::make_unique<WrappedValue>(config);
} //GetConfig::run
@@ -1,20 +1,22 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
*/
class GetConfig : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
class GetConfig : public speckle::interfac::browser::bridge::JSBridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetConfig();
@@ -24,7 +26,7 @@ namespace connector::interfac::browser::bridge {
Get the configuration settings
@return The settings
*/
std::unique_ptr<active::serialise::Cargo> run() const;
std::unique_ptr<active::serialise::Cargo> run(void) const;
};
}
@@ -1,39 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Config/GetIsDevMode.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
using namespace active::serialise;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Return type for retrieving the current configuration
using WrappedValue = CargoHold<ValueWrap<bool>, bool>;
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetIsDevMode::GetIsDevMode() : BridgeMethod{"GetIsDevMode", [&]() {
return run();
}} {}
/*--------------------------------------------------------------------
Get the DEBUG mode
return: true for DEBUG, false otherwise
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetIsDevMode::run() const {
#if DEBUG
bool value = true;
#else
bool value = false;
#endif
return std::make_unique<WrappedValue>(value);
} //GetIsDevMode::run
@@ -1,32 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
#define CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve IsDebugMode
*/
class GetIsDevMode : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
/*!
Constructor
*/
GetIsDevMode();
// MARK: - Functions (const)
/*!
Get the DEBUG mode
@return true for DEBUG, false otherwise
*/
std::unique_ptr<active::serialise::Cargo> run() const;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_IS_DEV_MODE
@@ -2,6 +2,7 @@
#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;
@@ -10,8 +11,8 @@ using namespace speckle::utility;
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
UpdateConfig::UpdateConfig() : BridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
run(args);
UpdateConfig::UpdateConfig() : JSBridgeMethod{"UpdateConfig", [&](UpdateArgs args) {
run(args.value);
}} {}
@@ -2,8 +2,8 @@
#define CONNECTOR_INTERFACE_BRIDGE_UPDATE_CONFIG
#include "Active/Serialise/CargoHold.h"
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
#include "Connector/Interface/Browser/Bridge/Config/ConnectorConfig.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace connector::interfac::browser::bridge {
@@ -15,7 +15,7 @@ namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
*/
class UpdateConfig : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
class UpdateConfig : public speckle::interfac::browser::bridge::JSBridgeMethod<UpdateArgs, void> {
public:
// MARK: - Constructors
@@ -1,10 +0,0 @@
#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
@@ -1,29 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
#define CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
namespace connector::interfac::browser::bridge {
/*!
A browser bridge to support sending model data to a Speckle server
*/
class SendBridge : public speckle::interfac::browser::bridge::BrowserBridge {
public:
// MARK: - Types
using base = speckle::interfac::browser::bridge::BrowserBridge;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
SendBridge();
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
@@ -1,80 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/Arg/SayHiArg.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include <array>
using namespace active::serialise;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Serialisation fields
enum FieldIndex {
nameID,
countID,
isHelloID,
};
///Serialisation field IDs. NB: This structure is never exported, so we only define the incoming argument indices
static std::array fieldID = {
Identity{"0"},
Identity{"1"},
Identity{"2"},
};
}
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool SayHiArg::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[nameID], nameID, element },
{ fieldID[countID], countID, element },
{ fieldID[isHelloID], isHelloID, element },
},
}.withType(&typeid(SayHiArg)));
return true;
} //SayHiArg::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique SayHiArg::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(SayHiArg))
return nullptr;
using namespace active::serialise;
switch (item.index) {
case nameID:
return std::make_unique<ValueWrap<String>>(name);
case countID:
return std::make_unique<ValueWrap<int32_t>>(count);
case isHelloID:
return std::make_unique<ValueWrap<bool>>(isHello);
default:
return nullptr; //Requested an unknown index
}
} //SayHiArg::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void SayHiArg::setDefault() {
name.clear();
count = 0;
isHello = false;
} //SayHiArg::setDefault
@@ -1,55 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
#define CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Utility/String.h"
namespace connector::interfac::browser::bridge {
/*!
Object for testing JS comms (with TestBridge binding)
*/
class SayHiArg : public active::serialise::Package {
public:
// MARK: - Types
using base = active::serialise::Package;
// MARK: - Constructors
/*!
Default constructor
*/
SayHiArg() = default;
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
///Sample parameters for testing only
speckle::utility::String name;
int32_t count = 0;
bool isHello = false;
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_SAYHI_ARG
@@ -1,133 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/GetComplexType.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include <array>
using namespace active::serialise;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Serialisation fields
enum FieldIndex {
unID,
countID,
isTestID,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"id"},
Identity{"count"},
Identity{"thisIsABoolean"},
};
/*!
Object for testing Javascript communication (with TestBridge binding)
*/
class ComplexType final : public active::serialise::Package {
public:
// MARK: - Types
using base = active::serialise::Package;
// MARK: - Constructors
/*!
Default constructor
*/
ComplexType();
// MARK: - Public variables
///Sample parameters for testing only
speckle::utility::String ID;
int32_t count = 0;
bool testBool = false;
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[unID], unID, element, !ID.empty() },
{ fieldID[countID], countID, element, count != 0 },
{ fieldID[isTestID], isTestID, element, testBool },
},
}.withType(&typeid(ComplexType)));
return true;
}
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override {
if (item.ownerType != &typeid(ComplexType))
return nullptr;
using namespace active::serialise;
switch (item.index) {
case unID:
return std::make_unique<ValueWrap<String>>(ID);
case countID:
return std::make_unique<ValueWrap<int32_t>>(count);
case isTestID:
return std::make_unique<ValueWrap<bool>>(testBool);
default:
return nullptr; //Requested an unknown index
}
}
};
///Return type for retrieving the current configuration
using WrappedValue = CargoHold<PackageWrap, ComplexType>;
}
//Hashing specialisation
template<>
struct std::hash<ComplexType> {
auto operator()(const ComplexType& obj) const {
return hash<std::string>()(obj.ID) ^ rotl(hash<int32_t>()(obj.count), 1) ^ rotl(hash<bool>()(obj.testBool), 2);
}
};
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
ComplexType::ComplexType() {
//This is the required test values
count = static_cast<int32_t>(std::hash<ComplexType>()(*this));
ID = String{count} + " - I am a string";
} //ComplexType::ComplexType
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GetComplexType::GetComplexType() : BridgeMethod{"GetComplexType", [&]() {
return run();
}} {}
/*--------------------------------------------------------------------
Get the required object type
return: The required object
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetComplexType::run() const {
ComplexType object;
return std::make_unique<WrappedValue>(object);
} //GetComplexType::run
@@ -1,33 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to return a specific object type
*/
class GetComplexType : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
// MARK: - Constructors
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetComplexType();
// MARK: - Functions (const)
/*!
Get the required object type
@return The required object
*/
std::unique_ptr<active::serialise::Cargo> run() const;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
@@ -1,20 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/GoAway.h"
using namespace connector::interfac::browser::bridge;
#include <iostream>
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
GoAway::GoAway() : BridgeMethod{"GoAway", [&]() {
return run();
}} {}
/*--------------------------------------------------------------------
Write a message to the console
--------------------------------------------------------------------*/
void GoAway::run() const {
std::cout << "Okay, going away.";
} //GoAway::run
@@ -1,31 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
#define CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
namespace connector::interfac::browser::bridge {
/*!
JS Function class to print a fixed message to the console
*/
class GoAway : public speckle::interfac::browser::bridge::BridgeMethod<void, void> {
public:
// MARK: - Constructors
/*!
Default constructor
*/
GoAway();
// MARK: - Functions (const)
/*!
Write a message to the console
*/
void run() const;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_GO_AWAY
@@ -1,38 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/SayHi.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
using namespace active::serialise;
using namespace active::setting;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Return type for the test message
using WrappedValue = CargoHold<ValueWrap<String>, String>;
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
SayHi::SayHi() : BridgeMethod{"SayHi", [&](SayHiWrapper arg) {
return run(arg);
}} {}
/*--------------------------------------------------------------------
Return a message based on sample data
arg: The sample data
return: The message based on sample data
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> SayHi::run(SayHiArg arg) const {
String result, baseGreeting{(arg.isHello ? "Hello" : "Hi") + arg.name + "!\n"};
for (auto i = arg.count; i--; )
result += baseGreeting;
return std::make_unique<WrappedValue>(result);
} //SayHi::run
@@ -1,37 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_SAYHI
#define CONNECTOR_INTERFACE_BRIDGE_SAYHI
#include "Connector/Interface/Browser/Bridge/Test/Arg/SayHiArg.h"
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
namespace connector::interfac::browser::bridge {
///Argument for the parameters of a test message
using SayHiWrapper = speckle::interfac::browser::bridge::JSArgType<SayHiArg, 3>;
/*!
JS Function class to return a test message based on sample data
*/
class SayHi : public speckle::interfac::browser::bridge::BridgeMethod<SayHiWrapper, active::serialise::Cargo> {
public:
// MARK: - Constructors
/*!
Default constructor
*/
SayHi();
// MARK: - Functions (const)
/*!
Return a message based on sample data
@param arg The sample data
@return The message based on sample data
*/
std::unique_ptr<active::serialise::Cargo> run(SayHiArg arg) const;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_SAYHI
@@ -1,19 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/TestBridge.h"
#include "Connector/Interface/Browser/Bridge/Test/GetComplexType.h"
#include "Connector/Interface/Browser/Bridge/Test/GoAway.h"
#include "Connector/Interface/Browser/Bridge/Test/SayHi.h"
#include "Connector/Interface/Browser/Bridge/Test/TriggerEvent.h"
using namespace connector::interfac::browser::bridge;
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
TestBridge::TestBridge() : BrowserBridge{"testBinding"} {
//Add bridge methods
addMethod<GetComplexType>();
addMethod<GoAway>();
addMethod<SayHi>();
addMethod<TriggerEvent>();
} //TestBridge::TestBridge
@@ -1,29 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
#define CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
namespace connector::interfac::browser::bridge {
/*!
A browser bridge to provide configuration settings
*/
class TestBridge : public speckle::interfac::browser::bridge::BrowserBridge {
public:
// MARK: - Types
using base = speckle::interfac::browser::bridge::BrowserBridge;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
TestBridge();
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_TEST_BRIDGE
@@ -1,105 +0,0 @@
#include "Connector/Interface/Browser/Bridge/Test/TriggerEvent.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
#include <array>
using namespace active::serialise;
using namespace active::setting;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Serialisation fields
enum FieldIndex {
okID,
nameID,
countID,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"isOk"},
Identity{"name"},
Identity{"count"},
};
/*!
Object for testing sending events to JS
*/
class TestObject final : public active::serialise::Package {
public:
// MARK: - Public variables
///Sample parameters for testing only
bool isOK = true;
speckle::utility::String name = "foo";
int32_t count = 42;
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[okID], okID, element },
{ fieldID[nameID], nameID, element },
{ fieldID[countID], countID, element },
},
}.withType(&typeid(TestObject)));
return true;
}
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override {
if (item.ownerType != &typeid(TestObject))
return nullptr;
using namespace active::serialise;
switch (item.index) {
case okID:
return std::make_unique<ValueWrap<bool>>(isOK);
case nameID:
return std::make_unique<ValueWrap<String>>(name);
case countID:
return std::make_unique<ValueWrap<int32_t>>(count);
default:
return nullptr; //Requested an unknown index
}
}
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
TriggerEvent::TriggerEvent() : BridgeMethod{"TriggerEvent", [&](TriggerEventWrapper arg) {
return run(arg);
}} {}
/*--------------------------------------------------------------------
Trigger an event based on a specified name
eventName: The event name
--------------------------------------------------------------------*/
void TriggerEvent::run(speckle::utility::String eventName) const {
if (!hasBridge())
return;
if (eventName == "emptyTestEvent")
getBridge()->sendEvent(eventName);
else if (eventName == "testEvent")
getBridge()->sendEvent(eventName, std::make_unique<TestObject>());
} //TriggerEvent::run
@@ -1,39 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
#define CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/CargoHold.h"
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
namespace connector::interfac::browser::bridge {
///Argument parameter for a string
using StringHold = active::serialise::CargoHold<active::serialise::ValueWrap<speckle::utility::String>, speckle::utility::String>;
///Argument type for this method
using TriggerEventWrapper = speckle::interfac::browser::bridge::JSArgType<StringHold>;
/*!
JS Function class to emit specified events as directed by JS
*/
class TriggerEvent : public speckle::interfac::browser::bridge::BridgeMethod<TriggerEventWrapper, void> {
public:
// MARK: - Constructors
/*!
Default constructor
*/
TriggerEvent();
// MARK: - Functions (const)
/*!
Trigger an event based on a specified name
@param eventName The event name
*/
void run(speckle::utility::String eventName) const;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_TRIGGER_EVENT
@@ -6,8 +6,6 @@
#include "Connector/Interface/Browser/Bridge/Account/AccountBridge.h"
#include "Connector/Interface/Browser/Bridge/Base/BaseBridge.h"
#include "Connector/Interface/Browser/Bridge/Config/ConfigBridge.h"
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
#include "Connector/Interface/Browser/Bridge/Test/TestBridge.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Event/Type/MenuEvent.h"
#include "Speckle/Interface/Browser/JSPortal.h"
@@ -19,9 +17,9 @@
using namespace active::environment;
using namespace active::event;
using namespace connector;
using namespace speckle::interfac::browser;
using namespace connector::interfac::browser::bridge;
using namespace speckle::event;
//using namespace speckle::interfac::browser;
//NB: Following is placeholder from GS example code - will be refactored to better suit our purposes
@@ -37,7 +35,7 @@ namespace {
// --- Class declaration: BrowserPalette ------------------------------------------
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public JSPortal<> {
class BrowserPalette final : public DG::Palette, public DG::PanelObserver, public speckle::interfac::browser::JSPortal<> {
public:
enum SelectionModification { RemoveFromSelection, AddToSelection };
@@ -129,7 +127,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();
@@ -166,8 +164,6 @@ 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();
}
@@ -205,11 +201,7 @@ void BrowserPalette::Hide() {
}
void BrowserPalette::InitBrowserControl() {
#ifdef TESTING_MODE
browser->LoadURL("https://boisterous-douhua-e3cefb.netlify.app/test");
#else
browser->LoadURL("https://boisterous-douhua-e3cefb.netlify.app/");
#endif
}
+2 -2
View File
@@ -5,9 +5,9 @@ namespace connector {
static const unsigned int versionMajor = 0;
static const unsigned int versionMinor = 2;
static const unsigned int versionMinor = 1;
static const unsigned int versionPatch = 1;
static const unsigned int versionPatch = 0;
}
@@ -1,33 +0,0 @@
#include "ActiveLibDoctest/TestingPlatforms.h"
#include "Active/Serialise/JSON/JSONTransport.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include "Active/Utility/BufferIn.h"
#include "Speckle/Record/Credentials/Account.h"
using namespace active::serialise;
using namespace active::serialise::json;
using namespace active::serialise::json;
using namespace speckle::record::cred;
using namespace speckle::utility;
namespace {
const char* accountJSON = "{\"id\":\"194B6E32061EB588B31D8CBC167DAAD8\",\"token\":\"547e30bcd0f0e377fe422019f388295e37c583a99f\",\"refreshToken\":\"7d23031b44856e768b5951161c9bc8378f663eefce\",\"isDefault\":false,\"isOnline\":false,\"serverInfo\":{\"name\":\"My new Speckle Server\",\"company\":\"Unknown Company\",\"version\":\"2.20.2-branch.testing.138676-e8c8291\",\"adminContact\":\"n/a\",\"description\":\"This a community deployment of a Speckle Server.\",\"frontend2\":true,\"url\":\"https://testing.speckle.dev\",\"migration\":null},\"userInfo\":{\"id\":\"e66694013f\",\"name\":\"oguzhan@speckle.systems\",\"email\":\"oguzhan@speckle.systems\",\"company\":null,\"avatar\":null,\"streams\":{\"totalCount\":2},\"commits\":{\"totalCount\":5}}}";
}
TEST_SUITE(TESTQ(AccountTests)) TEST_SUITE_OPEN
//Test to receive account serialised as JSON from SQLite dbase
TEST_CASE(TESTQ(testAccountReceive)) {
Account account;
try {
JSONTransport().receive(PackageWrap{account}, Identity{}, String{accountJSON});
} catch(...) {
FAIL_CHECK(TEST_MESSAGE(Account deserialisation failed));
}
}
TEST_SUITE_CLOSE
@@ -1,91 +0,0 @@
#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
@@ -1,46 +0,0 @@
#ifndef SPECKLE_DATABASE_ACCOUNT_DBASE
#define SPECKLE_DATABASE_ACCOUNT_DBASE
#include "Active/File/Path.h"
#include "Speckle/Record/Credentials/Account.h"
namespace speckle::database {
/*!
A base class for an addon
*/
class AccountDatabase {
public:
// MARK: - Constructors
/*!
Constructor
@param path Path to the database file
*/
AccountDatabase(const active::file::Path& path);
AccountDatabase(const AccountDatabase&) = delete;
/*!
Destructor
*/
~AccountDatabase();
// MARK: - Functions (const)
/*!
Get all accounts
@return All the accounts
*/
active::container::Vector<record::cred::Account> getAccounts() const;
// MARK: - Functions (mutating)
private:
class Store;
///Accounts database storage
std::unique_ptr<Store> m_store;
};
}
#endif //SPECKLE_DATABASE_ACCOUNT_DBASE
@@ -1,8 +1,7 @@
#ifndef SPECKLE_DATABASE_INDEX
#define SPECKLE_DATABASE_INDEX
#include "Active/Database/Identity/Link.h"
#include "Speckle/Utility/String.h"
#include "Speckle/Utility/Guid.h"
namespace speckle::database {
@@ -13,16 +12,23 @@ namespace speckle::database {
this is typically a guid, for Revit a string and for Vectorworks a handle. Note that this index is not necessarily persistent between
sessions.
*/
class Index : public active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
class Index : public speckle::utility::Guid {
public:
// MARK: - Types
using base = active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
using base = speckle::utility::Guid;
// MARK: - Constructors
using base::base;
Index(speckle::utility::Guid ID, speckle::utility::Guid dbaseID) : base{ID}, databaseID{dbaseID} {}
// MARK: - Public variables
///ID of the source database (not defined in every case, undefined = null guid)
speckle::utility::Guid databaseID;
};
}
@@ -1,8 +1,6 @@
#include "Speckle/Database/Identity/Link.h"
#include "Speckle/Utility/Guid.h"
#include "Speckle/Database/Content/Link.h"
using namespace speckle::database;
using namespace speckle::utility;
#ifdef ARCHICAD
/*--------------------------------------------------------------------
@@ -10,9 +8,9 @@ using namespace speckle::utility;
selected: Information about a selected Archicad element
--------------------------------------------------------------------*/
//Link::Link(const API_Neig& selected) : base{Guid{selected.guid}} {
Link::Link(const API_Neig& selected) : recordID{selected.guid} {
//More info should be extracted from API_Neig in future (as required)
//} //Link::Link
} //Link::Link
#endif
@@ -2,7 +2,7 @@
#define SPECKLE_DATABASE_LINK
#include "Active/Setting/SettingList.h"
#include "Speckle/Database/Identity/Index.h"
#include "Speckle/Database/Content/Index.h"
namespace speckle::database {
@@ -17,18 +17,30 @@ namespace speckle::database {
A link may optionally carry any number of settings. In the context of a user selection (for example) there might be settings describing where
the user made the selection (e.g. the hole in a floor slab), allowing a tool working on that selection to be more precise.
*/
class Link : public active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
class Link : public active::setting::SettingList {
public:
// MARK: - Types
using base = active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
using base = active::setting::SettingList;
///Unique pointer
using Unique = std::unique_ptr<Link>;
///Shared pointer
using Shared = std::shared_ptr<Link>;
///Optional
using Option = std::optional<Link>;
// MARK: - Constructors
using base::base;
Link() = default;
/*!
Constructor
@param index An element index
@param origIndex The index of the original element (when the preceding index is to a proxy element)
*/
Link(const Index& index, const Index& origIndex = Index{}) : recordID{index}, originalID{origIndex} {}
#ifdef ARCHICAD
/*!
Constructor
@@ -36,6 +48,13 @@ namespace speckle::database {
*/
Link(const API_Neig& selected);
#endif
// MARK: - Public variables
///ID of the linked record (defaults to null guid = undefined)
Index recordID;
///ID of the original record (in the case where the record is proxy for another - null guid = undefined)
Index originalID;
};
}
+34 -11
View File
@@ -8,17 +8,40 @@ using namespace speckle::utility;
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Record::fillInventory(active::serialise::Inventory& inventory) const {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ Identity{"id"}, active::database::record::FieldIndex::idIndex, element },
},
}.withType(&typeid(base)));
bool Record::fillInventory(Inventory& inventory) const {
//TODO: Complete
return true;
} //Record::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Record::getCargo(const Inventory::Item& item) const {
//TODO: Complete
return nullptr;
} //Record::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Record::setDefault() {
//TODO: Complete
} //Record::setDefault
/*--------------------------------------------------------------------
Validate the cargo data
return: True if the data has been validated
--------------------------------------------------------------------*/
bool Record::validate() {
//TODO: Complete
return true;
} //Record::validate
+61 -8
View File
@@ -1,21 +1,19 @@
#ifndef SPECKLE_DATABASE_RECORD
#define SPECKLE_DATABASE_RECORD
#include "Active/Database/Content/Record.h"
#include "Speckle/Database/Identity/Link.h"
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Database/Content/Link.h"
namespace speckle::database {
/*!
Base class for a database record
*/
class Record : public active::database::Record<speckle::utility::String, speckle::utility::String, speckle::utility::String> {
class Record : public active::serialise::Package, public active::utility::Cloner {
public:
// MARK: - Types
using base = active::database::Record<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
///Unique pointer
using Unique = std::unique_ptr<Record>;
///Shared pointer
using Shared = std::shared_ptr<Record>;
@@ -28,17 +26,47 @@ namespace speckle::database {
Constructor
@param ID The record ID
*/
Record(speckle::utility::String ID) : base{ID} {}
Record(speckle::utility::Guid ID) : m_ID{ID} {}
/*!
Destructor
*/
virtual ~Record() {}
// MARK: - Functions (const)
/*!
Get the record ID
@return The record ID
*/
speckle::utility::Guid getID() const { return m_ID; }
/*!
Get the record unique ID
@return The record unique ID
*/
speckle::utility::Guid getUniqueID() const { return m_uniqueID; }
/*!
Get the record index
@return The record index
*/
virtual Index getIndex() const { return Index{m_ID, m_ownerID}; }
/*!
Get the record link
@return The record link
*/
virtual Link getLink() const { return Link{getIndex()}; }
// MARK: - Functions (mutating)
/*!
Set the record ID
@param ID The record ID
*/
void setID(speckle::utility::Guid ID) { m_ID = ID; }
/*!
Set the record unique ID
@param ID The record unique ID
*/
void setUniqueID(speckle::utility::Guid ID) { m_uniqueID = ID; }
// MARK: - Serialisation
@@ -48,6 +76,31 @@ namespace speckle::database {
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
/*!
Validate the cargo data
@return True if the data has been validated
*/
bool validate() override;
private:
///The record ID (may not be unique across models)
speckle::utility::Guid m_ID = speckle::utility::Guid{true};
///The record unique ID
speckle::utility::Guid m_uniqueID = speckle::utility::Guid{true};
///The record owner ID (null guid if unspecified)
speckle::utility::Guid m_ownerID;
///The last edit time
active::utility::Time editTime = active::utility::Time{};
};
}
@@ -1,37 +0,0 @@
#include "Speckle/Environment/Platform.h"
#include <iostream>
using namespace speckle::environment;
using namespace speckle::utility;
namespace {
//An object representing the active addon
Platform m_platformInstance;
}
/*--------------------------------------------------------------------
Write a message to the console
message: The message to write
--------------------------------------------------------------------*/
void Platform::writeToConsole(const active::utility::String& message) {
#ifdef WINDOWS
//NB: std::cout doesn't write to the console in Windows by default
OutputDebugString((LPCTSTR)message.operator std::u16string().data());
#else
std::cout << message.data();
#endif
} //Platform::writeToConsole
/*--------------------------------------------------------------------
Get an object representing the parent process/application
return: The active application instance
--------------------------------------------------------------------*/
speckle::environment::Platform* speckle::environment::platform() {
return &m_platformInstance;
} //speckle::environment::platform
-32
View File
@@ -1,32 +0,0 @@
#ifndef SPECKLE_ENVIRONMENT_PLATFORM
#define SPECKLE_ENVIRONMENT_PLATFORM
#include "Speckle/Utility/String.h"
namespace speckle::environment {
/*!
A class representing the host platform/opterating system
*/
class Platform {
public:
// MARK: - Functions (const)
/*!
Write a message to the console
@param message The message to write
*/
void writeToConsole(const active::utility::String& message);
};
/*!
Get an object representing the host platform
@return The host platform
*/
speckle::environment::Platform* platform();
}
#endif //SPECKLE_ENVIRONMENT_PLATFORM
@@ -1,7 +1,7 @@
#include "Speckle/Event/Subscriber/SelectionSubscriber.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Database/Identity/Link.h"
#include "Speckle/Database/Content/Link.h"
#include "Speckle/Event/Type/SelectionEvent.h"
using namespace active::environment;
@@ -5,7 +5,7 @@
#include "Active/Utility/Guid.h"
#include "Active/Utility/String.h"
#include "Speckle/Database/Identity/Link.h"
#include "Speckle/Database/Content/Link.h"
namespace speckle::event {
@@ -1,44 +0,0 @@
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Utility/String.h"
namespace speckle::interfac::browser::bridge {
/*!
Interface for objects used as arguments for JS bridge arguments
Enables deserialisation to recognise individual parameters in the serialised JS method aergument, e.g. "0", "1", etc
*/
class ArgumentBase {
public:
/*!
Destructor
*/
virtual ~ArgumentBase() {}
// MARK: - Functions (const)
/*!
Determine if the object is used as an argument template
@return True if the object is used as an argument template
*/
bool isArgumentTemplate() const { return m_isArgumentTemplate; }
// MARK: - Functions (mutating)
/*!
Set whether the object is used as an argument template
@param state True if the object is used as an argument template
*/
void setArgumentTemplate(bool state) { m_isArgumentTemplate = state; }
private:
///True if the object is used as an argument template
bool m_isArgumentTemplate = false;
};
}
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_BASE
@@ -1,133 +0,0 @@
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Interface/Browser/Bridge/ArgumentBase.h"
#include "Speckle/Utility/String.h"
namespace speckle::interfac::browser::bridge {
/*!
Base class for the argments passed from JavaScript to a named C++ method in a Speckle bridging object
NB: The BridgeArgumentWrap class will:
- Deserialise the essential attributes for determining the target method and arguments;
- Create the correct BridgeArgument subclass for the emthod/argument and populate it with the collected attributes
Therefore, there is no need for this class to handle any deserialisation, and subclasses should only handle the core arguments data
*/
class BridgeArgument : public active::serialise::Cargo {
public:
// MARK: - Constructors
/*!
Default constructor
*/
BridgeArgument() {}
/*!
Constructor
@param methodName The name of the method to receive the argument
@param requestID An ID to be paired with the method return value
@param errorMessage Optional error message - populate on failure (method will not be called in this case)
*/
BridgeArgument(const speckle::utility::String& methodName,
const speckle::utility::String& requestID,
const speckle::utility::String::Option& errorMessage = std::nullopt) :
m_methodName{methodName}, m_requestID{requestID}, m_errorMessage{errorMessage} {}
/*!
Destructor
*/
virtual ~BridgeArgument() {}
// MARK: - Functions (const)
/*!
Get the name of the method to receive the arguments
@return The method name
*/
const speckle::utility::String& getMethodName() const { return m_methodName; }
/*!
Get the request ID from the JS caller (to be paired with the method result)
@return The request ID
*/
const speckle::utility::String& getRequestID() const { return m_requestID; }
/*!
Determine if the argument contains an error
@return True if the argument contains an error
*/
bool hasError() const { return m_errorMessage.operator bool(); }
/*!
Get the number of parameters in the argument
@return The number of parameters
*/
virtual uint32_t parameterCount() const { return 1; }
/*!
Get any error message relating to the arguments
@return The error message (nullopt if no errors occurred)
*/
speckle::utility::String::Option errorMessage() const { return m_errorMessage; }
/*!
Fill an inventory with the cargo items
@param inventory The inventory to receive the cargo items
@return True if items have been added to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
// MARK: - Functions (mutating)
/*!
Set to the default package content
*/
void setDefault() override;
private:
///The name of the method to receive the argument
speckle::utility::String m_methodName;
///An ID to be paired with the method return value
speckle::utility::String m_requestID;
///Optional error message - only populated on failure to obtain a valid argument (method will not be called in this case)
speckle::utility::String::Option m_errorMessage;
};
///Definition of the argument for a JS callable method (enclosing the local function argument)
template<typename T, uint32_t Params = 1>
class JSArgType : public BridgeArgument, public T {
public:
/*!
Constructor
@param methodName The name of the method to receive the argument
@param requestID An ID to be paired with the method return value
@param errorMessage Optional error message - populate on failure (method will not be called in this case)
*/
JSArgType(const speckle::utility::String& methodName,
const speckle::utility::String& requestID,
const speckle::utility::String::Option& errorMessage = std::nullopt) : BridgeArgument{methodName, requestID, errorMessage} {
//Tag the argument object as a template where possible
if (auto arg = dynamic_cast<ArgumentBase*>(this); arg != nullptr)
arg->setArgumentTemplate(true);
}
/*!
Copy constructor
@param source The object to copy
*/
JSArgType(const JSArgType& source) : BridgeArgument{source}, T{source} {}
/*!
Get the number of parameters in the argument
@return The number of parameters
*/
uint32_t parameterCount() const override { return Params; }
};
}
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
@@ -1,188 +0,0 @@
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
#include "Active/Serialise/Inventory/Inventory.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/ValueSettingWrap.h"
#include "Active/Serialise/JSON/JSONTransport.h"
#include "Active/Utility/BufferIn.h"
#include "Speckle/Utility/Exception.h"
using namespace active::serialise;
using namespace active::serialise::json;
using namespace active::setting;
using namespace speckle::interfac::browser::bridge;
using namespace speckle::utility;
namespace speckle::interfac::browser::bridge {
///Factory functions to construct arguments from linked bridge/method names
std::unordered_map<String, BridgeArgumentWrap::Production> BridgeArgumentWrap::m_argumentFactory;
}
namespace {
using enum active::serialise::Entry::Type;
///The indices of the package items
enum FieldIndex {
args,
};
///The indices of the arguments array rows
enum RowIndex {
methodName,
requestID,
argsJSON,
};
///The package inventory
auto myInventory = Inventory {
{
{ {"arg"}, args, 0, std::nullopt, true }, //The JS arguments are expressed as a flat array - use the array indices to map to expected vars
},
}.withType(&typeid(BridgeArgumentWrap));;
}
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
BridgeArgumentWrap::~BridgeArgumentWrap() {
} //BridgeArgumentWrap::~BridgeArgumentWrap
/*--------------------------------------------------------------------
Fill an inventory with the cargo items
inventory: The inventory to receive the cargo items
return: True if items have been added to the inventory
--------------------------------------------------------------------*/
bool BridgeArgumentWrap::fillInventory(Inventory& inventory) const {
inventory.merge(myInventory);
return true;
} //BridgeArgumentWrap::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique BridgeArgumentWrap::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(BridgeArgumentWrap))
return nullptr;
switch (item.index) {
case FieldIndex::args: {
switch (item.available - 1) { //NB: Args are not labelled - in this instance we use the array row index to couple to an argument var
case RowIndex::methodName:
return std::make_unique<ValueWrap<String>>(m_methodName);
case RowIndex::requestID:
return std::make_unique<ValueWrap<String>>(m_requestID);
case RowIndex::argsJSON:
return std::make_unique<ValueWrap<String>>(m_argsJSON);
default:
return nullptr;
}
}
default:
return nullptr; //Requested an unknown index
}
} //BridgeArgumentWrap::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void BridgeArgumentWrap::setDefault() {
m_methodName.clear();
m_requestID.clear();
m_argsJSON.clear();
m_argument.reset(); //This will be populated once the target bridge and method are known (and hence the required argument type)
} //BridgeArgumentWrap::setDefault
/*--------------------------------------------------------------------
Validate the cargo data
return: True if the data has been validated
--------------------------------------------------------------------*/
bool BridgeArgumentWrap::validate() {
//Build an argument with the attributes obtained of none exists
if (!m_argument)
finaliseArgument();
//Then ensure the argument object is valid
return m_argument->validate();
} //BridgeArgumentWrap::validate
/*--------------------------------------------------------------------
Make an argument object for a specified bridge method
methodID: The name of the target method
requestID: The ID of the request
argument: The method argument data (serialised)
return: An argument object (nullptr on failure)
--------------------------------------------------------------------*/
std::unique_ptr<BridgeArgument> BridgeArgumentWrap::makeArgument(const String& methodID, const String& requestID, const String& argument) {
if (auto maker = m_argumentFactory.find(methodID); (maker != m_argumentFactory.end())) {
if (auto result = reinterpret_cast<BridgeArgument*>(maker->second(methodID, requestID)); result != nullptr) {
try {
//The argument is passed as an array of stringified JSON - first unpack the array
JSONTransport transport;
ValueSetting args;
transport.receive(ValueSettingWrap{args}, Identity{}, argument);
if (args.size() != result->parameterCount())
throw Exception{"Function called with wrong number of parameters"};
String unifiedArgument;
if ((args.size() > 1) && dynamic_cast<Package*>(result) != nullptr) {
//Unify the argument strings into a single JSON argument
unifiedArgument = "{";
int32_t argIndex = 0;
bool isFirst = true;
for (auto& arg : args.operator std::vector<active::utility::String>()) {
if (isFirst)
isFirst = false;
else
unifiedArgument += ",";
unifiedArgument += "\"" + String{argIndex++} + "\":" + JSONTransport::convertFromJSONString(arg);
}
unifiedArgument += "}";
} else {
//An item can only receive a single parameter
if (args.size() > 1)
throw Exception{"Function called with wrong number of parameters"};
unifiedArgument = args;
}
//And receive the unified argument into the method argument
transport.receive(std::forward<Cargo&&>(*result), Identity{}, unifiedArgument);
return std::unique_ptr<BridgeArgument>{result};
} catch(std::runtime_error e) {
//Populating the error cancels the method
return std::make_unique<BridgeArgument>(methodID, requestID, String{e.what()});
} catch(...) {
//Populating the error cancels the method
return std::make_unique<BridgeArgument>(methodID, requestID, String{"An unexpected error occurred parsing the method argument"});
}
}
}
return nullptr;
} //BridgeArgumentWrap::makeArgument
/*--------------------------------------------------------------------
Finalise the output argument object based on the current object, method etc
--------------------------------------------------------------------*/
void BridgeArgumentWrap::finaliseArgument() const {
//Use the deserialised target bridge and method to establish the required arguments (if any)
m_argument = BridgeArgumentWrap::makeArgument(m_methodName, m_requestID, m_argsJSON);
//If the function doesn't take an argument, we still need to pass along the base class with object name, method etc
if (!m_argument)
m_argument = std::make_unique<BridgeArgument>(m_methodName, m_requestID);
} //BridgeArgumentWrap::finaliseArgument
@@ -1,44 +0,0 @@
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
#define SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
namespace speckle::interfac::browser::bridge {
class BrowserBridge;
/*!
Interface for any function operating within a browser bridge
As a child of a bridge, it may need to facilitate operations through the browser portal - this interface allows the the parent
browser bridge to provide access.
*/
class BridgeChild {
public:
// MARK: - Functions (mutating)
/*!
Set the parent bridge
@param bridge The parent bridge
*/
void setBridge(BrowserBridge* bridge) { m_bridge = bridge; }
protected:
/*!
Set the parent bridge
@return The parent bridge
*/
bool hasBridge() const { return m_bridge != nullptr; }
/*!
Set the parent bridge
@return The parent bridge
*/
BrowserBridge* getBridge() const { return m_bridge; }
private:
///The parent browser bridge
BrowserBridge* m_bridge = nullptr;
};
}
#endif //SPECKLE_INTERFACE_JS_BRIDGE_FUNCTION
@@ -2,12 +2,10 @@
#include "Active/Setting/ValueSetting.h"
#include "Active/Setting/Values/StringValue.h"
#include "Active/Utility/BufferOut.h"
#include "Speckle/Interface/Browser/JSPortal.h"
#include "Speckle/Interface/Browser/Bridge/Functions/GetBindingsMethodNames.h"
#include "Speckle/Interface/Browser/Bridge/Functions/RunMethod.h"
#include "Speckle/Interface/Browser/Bridge/Functions/GetCallResult.h"
#include "Speckle/Utility/Guid64.h"
#include <algorithm>
#include <map>
@@ -38,9 +36,9 @@ namespace speckle::interfac::browser::bridge {
BrowserBridge::BrowserBridge(const String& name) : JSObject{name} {
m_result = std::make_unique<ResultCache>();
//Populate the required browser bridge functions callable from JS
addFunction<GetBindingsMethodNames>();
addFunction<RunMethod>();
addFunction<GetCallResult>();
emplace_back(std::make_shared<GetBindingsMethodNames>(*this));
emplace_back(std::make_shared<RunMethod>(*this));
emplace_back(std::make_shared<GetCallResult>(*this));
} //BrowserBridge::BrowserBridge
@@ -77,43 +75,18 @@ Functional<>* BrowserBridge::getMethod(const String& name) const {
} //BrowserBridge::getMethod
/*--------------------------------------------------------------------
Send a named event through the JS portal
eventName: The result cargo to send back to the JS
data: Optional data to send with the event (nullptr = send event without data)
--------------------------------------------------------------------*/
void BrowserBridge::sendEvent(speckle::utility::String eventName, std::unique_ptr<active::serialise::Cargo> data) {
if (m_portal == nullptr)
throw; //TODO: Add exception detail
if (!data) {
//Just send an event with no data
m_portal->execute(getName() + ".emit('" + eventName + "')");
return;
}
//Generate a custom requestID for the data
String requestID{Guid64{true} + String{"_"} + eventName};
cacheResult(std::move(data), requestID, false);
//Send a notification using the event name and request ID to signal that the data is available
m_portal->execute(getName() + ".emitResponseReady('" + eventName + "','" + requestID + "')");
} //BrowserBridge::sendEvent
/*--------------------------------------------------------------------
Cache the result from a method function for the JS caller to retrieve
result: The result cargo to send back to the JS
requestID: The resquest ID from the JS caller (to correctly pair up the caller and result)
isNotified: True if notification of the result availability should be sent to the JS portal
--------------------------------------------------------------------*/
void BrowserBridge::cacheResult(std::unique_ptr<Cargo> result, String requestID, bool isNotified) {
void BrowserBridge::cacheResult(std::unique_ptr<Cargo> result, String requestID) {
if (m_portal == nullptr)
throw; //TODO: Add exception detail
const std::lock_guard<std::mutex> lock(m_result->mutex);
(*m_result)[requestID] = std::move(result);
//Notify that the result is available when required
if (isNotified)
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
m_portal->execute(getName() + ".responseReady('" + requestID + "')"); //TODO: Need to confirm target object name
} //BrowserBridge::cacheResult
@@ -3,7 +3,8 @@
#include "Speckle/Interface/Browser/JSObject.h"
#include "Speckle/Interface/Browser/Functional.h"
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethod.h"
namespace active::setting {
class ValueSetting;
@@ -45,12 +46,6 @@ namespace speckle::interfac::browser::bridge {
@return A pointer to the requested method (owner does not take ownership, nullptr = failure)
*/
Functional<>* getMethod(const speckle::utility::String& name) const;
/*!
Send a named event through the JS portal
@param eventName The result cargo to send back to the JS
@param data Optional data to send with the event (nullptr = send event without data)
*/
void sendEvent(speckle::utility::String eventName, std::unique_ptr<active::serialise::Cargo> data = nullptr);
// MARK: - Functions (mutating)
@@ -58,9 +53,8 @@ namespace speckle::interfac::browser::bridge {
Cache the result from a method function for the JS caller to retrieve
@param result The result cargo to send back to the JS
@param requestID The resquest ID from the JS caller (to correctly pair up the caller and result)
@param isNotified True if notification of the result availability should be sent to the JS portal
*/
void cacheResult(std::unique_ptr<active::serialise::Cargo> result, speckle::utility::String requestID, bool isNotified = true);
void cacheResult(std::unique_ptr<active::serialise::Cargo> result, speckle::utility::String requestID);
/*!
Release the results linked to a specified request ID
@param requestID The required result ID
@@ -69,28 +63,15 @@ namespace speckle::interfac::browser::bridge {
std::unique_ptr<active::serialise::Cargo> releaseResult(speckle::utility::String requestID);
protected:
/*!
Add a bridge function
@tparam T The function type
*/
template<typename T> requires (std::is_base_of_v<Functional<>, T>)
void addFunction() {
//The argument type is registered against the bridge to enable an appropriate object to be deserialised from the JS args
auto function = std::make_shared<T>();
if (auto child = dynamic_cast<BridgeChild*>(function.get()); child != nullptr)
child->setBridge(this);
emplace_back(function);
}
/*!
Add a browser method
@tparam T The method type (which also defines the argument type)
*/
template<typename T> requires (std::is_base_of_v<BridgeMethodBase, T>)
void addMethod() {
template<typename T> requires (std::is_base_of_v<JSBridgeMethodBase, T>)
void addMethod() const {
//The argument type is registered against the bridge to enable an appropriate object to be deserialised from the JS args
auto method = std::make_shared<T>();
method->registerArgument(getName());
method->setBridge(this);
m_methods->insert(m_methods->end(), method);
}
@@ -1,80 +0,0 @@
#include "Speckle/Interface/Browser/Bridge/Functions/ErrorReport.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include <array>
using namespace active::serialise;
using namespace speckle::interfac::browser::bridge;
using namespace speckle::utility;
namespace {
///Serialisation fields
enum FieldIndex {
errMessage,
errInfo,
errTrace,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"message"},
Identity{"error"},
Identity{"stackTrace"},
};
}
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool ErrorReport::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[errMessage], errMessage, element },
{ fieldID[errInfo], errInfo, element },
{ fieldID[errTrace], errTrace, element },
},
}.withType(&typeid(ErrorReport)));
return true;
} //ErrorReport::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique ErrorReport::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(ErrorReport))
return nullptr;
using namespace active::serialise;
switch (item.index) {
case errMessage:
return std::make_unique<ValueWrap<String>>(message);
case errInfo:
return std::make_unique<ValueWrap<String>>(error);
case errTrace:
return std::make_unique<ValueWrap<String>>(stackTrace);
default:
return nullptr; //Requested an unknown index
}
} //ErrorReport::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void ErrorReport::setDefault() {
message.clear();
error.clear();
stackTrace.clear();
} //ErrorReport::setDefault
@@ -1,61 +0,0 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
#define CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Utility/String.h"
namespace speckle::interfac::browser::bridge {
/*!
Information about a runtime error, typically extracted from an exception
*/
class ErrorReport : public active::serialise::Package {
public:
// MARK: - Types
using base = active::serialise::Package;
// MARK: - Constructors
/*!
Default constructor
@param mess The project location
@param err The project name
@param trace A unique, persistent ID for the project document
*/
ErrorReport(const speckle::utility::String& mess = {}, const speckle::utility::String& err = {}, const speckle::utility::String& trace = {}) :
base{}, message{mess}, error{err}, stackTrace{trace} {}
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
///The exception message, i.e. what happened
speckle::utility::String message;
///The exception details (name? - use is not clear)
speckle::utility::String error;
///Stack trace to where the exception was thrown
speckle::utility::String stackTrace; //TODO: Not currently implemented - can add when required
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
};
}
#endif //CONNECTOR_INTERFACE_BRIDGE_ERROR_REPORT
@@ -0,0 +1,28 @@
#ifndef SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
#define SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
#include "Speckle/Interface/Browser/JSBinding.h"
#ifdef ARCHICAD
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
#include <Ref.hpp>
#include <JSValues.hpp>
#else
#include "Active/Serialise/JSON/JSONTransport.h"
#endif
namespace speckle::interfac::browser::bridge {
///Define the bridge binding protocols according to platform
#ifdef ARCHICAD
//Archicad uses a proprietary JS::Base type for JS values
using PlatformBinding = JSBinding<GS::Ref<JS::Base>, speckle::serialise::jsbase::JSBaseTransport>;
#else
//All others will use JSON (in a String)
using PlatformBinding = JSBinding<String, JSONTransport>;
#endif
}
#endif //SPECKLE_INTERFACE_BRIDGE_FUNCTION_BINDING
@@ -12,9 +12,10 @@ using namespace speckle::interfac::browser::bridge;
bridge: The parent bridge object (provides access to bridge methods)
--------------------------------------------------------------------*/
GetBindingsMethodNames::GetBindingsMethodNames() : JSFunction{"GetBindingsMethodNames", [&]() {
return getMethodNames();
}} {
GetBindingsMethodNames::GetBindingsMethodNames(BrowserBridge& bridge) : m_bridge{bridge},
JSFunction{"GetBindingsMethodNames", [&]() {
return getMethodNames();
}} {
} //GetBindingsMethodNames::GetBindingsMethodNames
@@ -24,5 +25,5 @@ GetBindingsMethodNames::GetBindingsMethodNames() : JSFunction{"GetBindingsMethod
return: The supported method names
--------------------------------------------------------------------*/
std::unique_ptr<WrappedValue> GetBindingsMethodNames::getMethodNames() const {
return (hasBridge()) ? std::make_unique<WrappedValue>(getBridge()->getMethodNames()) : nullptr;
return std::make_unique<WrappedValue>(m_bridge.getMethodNames());
} //GetBindingsMethodNames::getMethodNames
@@ -5,7 +5,6 @@
#include "Active/Serialise/Package/Wrapper/ValueSettingWrap.h"
#include "Speckle/Interface/Browser/PlatformBinding.h"
#include "Speckle/Interface/Browser/JSFunction.h"
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
namespace speckle::interfac::browser::bridge {
@@ -16,15 +15,16 @@ namespace speckle::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
*/
class GetBindingsMethodNames : public JSFunction<void, WrappedValue, PlatformBinding>, public BridgeChild {
class GetBindingsMethodNames : public JSFunction<void, WrappedValue, PlatformBinding> {
public:
// MARK: - Constructors
/*!
Default constructor
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetBindingsMethodNames();
GetBindingsMethodNames(BrowserBridge& bridge);
private:
/*!
@@ -32,6 +32,9 @@ namespace speckle::interfac::browser::bridge {
@return The supported method names
*/
std::unique_ptr<WrappedValue> getMethodNames() const;
///Methods supported by the bridge
BrowserBridge& m_bridge;
};
}
@@ -20,10 +20,13 @@ using namespace speckle::utility;
/*--------------------------------------------------------------------
Constructor
bridge: The parent bridge object (provides access to bridge methods)
--------------------------------------------------------------------*/
GetCallResult::GetCallResult() : JSFunction{"GetCallResult", [&](auto args) {
return getResult(args);
}} {
GetCallResult::GetCallResult(BrowserBridge& bridge) : m_bridge{bridge},
JSFunction{"GetCallResult", [&](auto args) {
return getResult(args);
}} {
} //GetCallResult::GetCallResult
@@ -35,15 +38,12 @@ GetCallResult::GetCallResult() : JSFunction{"GetCallResult", [&](auto args) {
return: The requested result (nullptr on failure)
--------------------------------------------------------------------*/
std::unique_ptr<WrappedResultArg> GetCallResult::getResult(WrappedResultArg& argument) const {
if (!hasBridge())
return nullptr;
//Retrieve the requested result
using namespace json;
auto result = getBridge()->releaseResult(argument);
//Confirm argument type
auto result = m_bridge.releaseResult(argument);
auto item = dynamic_cast<Cargo*>(result.get());
if (!item)
return nullptr;
String jsonOutput;
JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
json::JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
return std::make_unique<WrappedResultArg>(jsonOutput);
} //GetCallResult::getResult
@@ -5,8 +5,7 @@
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Speckle/Interface/Browser/PlatformBinding.h"
#include "Speckle/Interface/Browser/JSFunction.h"
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
namespace speckle::interfac::browser::bridge {
@@ -18,15 +17,21 @@ namespace speckle::interfac::browser::bridge {
/*!
Function to retrieve the names of the methods supported by the bridge
*/
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding>, public BridgeChild {
class GetCallResult : public JSFunction<WrappedResultArg, WrappedResultArg, PlatformBinding> {
public:
// MARK: - Constructors
/*!
Default constructor
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetCallResult();
GetCallResult(BrowserBridge& bridge);
/*!
Copy constructor
@param source The object to copy
*/
GetCallResult(const GetCallResult& source) = default;
private:
/*!
@@ -35,6 +40,9 @@ namespace speckle::interfac::browser::bridge {
@return The requested result (nullptr on failure)
*/
std::unique_ptr<WrappedResultArg> getResult(WrappedResultArg& argument) const;
///The parent browser bridge
BrowserBridge& m_bridge;
};
}
@@ -1,11 +1,6 @@
#include "Speckle/Interface/Browser/Bridge/Functions/RunMethod.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Null.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
#include "Speckle/Interface/Browser/Bridge/Functions/ErrorReport.h"
#include "Speckle/Utility/Exception.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
@@ -13,65 +8,12 @@
#endif
using namespace active::serialise;
using namespace speckle::serialise::jsbase;
using namespace speckle::interfac::browser;
using namespace speckle::interfac::browser::bridge;
using namespace speckle::serialise::jsbase;
using namespace speckle::utility;
namespace {
///Default error message used when no description is available from the exception
const char* defaultError = "An unidentified exception was thrown";
/*!
Format the error message from an exception thrown during bridge method execution
@param message The exception error message (what happened)
@param argument The method argument (also carries the method name etc)
@return The formatted message
*/
String formattedErrorMessage(const String& message, const BridgeArgument& argument) {
return "Exception thrown by the Speckle connector executing method '" + argument.getMethodName() + "': \"" + message + "\"";
} //formattedErrorMessage
/*!
Execute a bridge method using a specified argument
@param bridge The bridge
@param method The bridge method to execute
@param argument The method argument
*/
void executeMethod(BrowserBridge& bridge, Functional<>& method, BridgeArgument& argument) {
std::optional<ErrorReport> errorReport;
//If the argument validation failed (during deserialisation) then we simply fill in the exception report without running the method
if (argument.hasError())
errorReport = ErrorReport{argument.errorMessage().value_or(String{})};
else {
try {
//Execute the method with the supplied argument
auto result = method.execute(argument);
//Cache the result in the bridge as required (when we have a request ID and a non-void result)
if (!argument.getRequestID().empty()) {
if (!result)
result = std::make_unique<Null>(); //Callers need a null response even if the function has no return value
bridge.cacheResult(std::move(result), argument.getRequestID());
}
return;
} catch(std::runtime_error e) {
//NB: This will capture the response from both Speckle and low-level system/runtime error exceptions
errorReport = ErrorReport{e.what(), typeid(e).name()};
} catch(...) {}
}
//This point is only reached in error conditions - ensure a response is provided if it hasn't been establishd already
if (!errorReport)
errorReport = ErrorReport{defaultError};
errorReport->message = formattedErrorMessage(errorReport->message, argument);
//Cache the error report to be sent back to the JS caller against the request ID
bridge.cacheResult(std::make_unique<CargoHold<PackageWrap, ErrorReport>>(*errorReport), argument.getRequestID());
} //executeMethod
///NB: The following is an Archicad-specific method for executing a function asynchronously within the app event queue
///Implement for other platforms as required
#ifdef ARCHICAD
/*!
Scheduled task to execute a browser bridge method in the Archicad event queue
@@ -84,15 +26,17 @@ namespace {
@param method The bridge method to execute
@param argument The method argument
*/
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<BridgeArgument> argument) :
RunBrowserMethod(BrowserBridge& bridge, Functional<>& method, std::shared_ptr<JSBridgeArgument> argument) :
m_bridge{bridge}, m_method{method}, m_argument{argument} {}
/*!
Execute the function and (when required) cache the result or an error report
Execute the function and (when required) cache the result
*/
void Run() override {
if (m_argument)
executeMethod(m_bridge, m_method, *m_argument);
auto result = m_method.execute(*m_argument);
//Cache the result in the bridge as required
if (result && !m_argument->getRequestID().empty())
m_bridge.cacheResult(std::move(result), m_argument->getRequestID());
}
private:
@@ -101,7 +45,7 @@ namespace {
///The bridge method to execute
Functional<>& m_method;
///The method argument
std::shared_ptr<BridgeArgument> m_argument;
std::shared_ptr<JSBridgeArgument> m_argument;
};
#endif
@@ -109,10 +53,11 @@ namespace {
/*--------------------------------------------------------------------
Constructor
bridge: The parent bridge object (provides access to bridge methods)
--------------------------------------------------------------------*/
RunMethod::RunMethod() : JSFunction{"RunMethod", [&](auto args) {
runMethod(args);
}} {
RunMethod::RunMethod(BrowserBridge& bridge) : m_bridge{bridge},
JSFunction{"RunMethod", [&](auto args) { runMethod(args); }} {
} //RunMethod::RunMethod
@@ -121,18 +66,18 @@ RunMethod::RunMethod() : JSFunction{"RunMethod", [&](auto args) {
arguments: The method arguments
--------------------------------------------------------------------*/
void RunMethod::runMethod(BridgeArgumentWrap& argument) const {
void RunMethod::runMethod(JSBridgeArgumentWrap& argument) const {
//Confirm argument and function validity
if (!argument || !hasBridge())
if (!argument)
return;
auto method = getBridge()->getMethod(argument.getMethodName());
auto method = m_bridge.getMethod(argument.getMethodName());
if (method == nullptr)
return;
//NB: Implement the equivalent run scheduling for other platforms as required
#ifdef ARCHICAD
GS::MessageLoopExecutor executor;
try {
executor.Execute(new RunBrowserMethod(*getBridge(), *method, argument.get()));
executor.Execute(new RunBrowserMethod(m_bridge, *method, argument.get()));
}
catch (...) {}
#endif
@@ -3,8 +3,7 @@
#include "Speckle/Interface/Browser/PlatformBinding.h"
#include "Speckle/Interface/Browser/JSFunction.h"
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
namespace speckle::interfac::browser::bridge {
@@ -13,22 +12,31 @@ namespace speckle::interfac::browser::bridge {
/*!
Function to retrieve the names of the methods supported by the bridge
*/
class RunMethod : public JSFunction<BridgeArgumentWrap, void, PlatformBinding>, public BridgeChild {
class RunMethod : public JSFunction<JSBridgeArgumentWrap, void, PlatformBinding> {
public:
// MARK: - Constructors
/*!
Default constructor
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
RunMethod();
RunMethod(BrowserBridge& bridge);
/*!
Copy constructor
@param source The object to copy
*/
RunMethod(const RunMethod& source) = default;
private:
/*!
Run a specified bridge method
@param argument The method arguments
*/
void runMethod(BridgeArgumentWrap& argument) const;
void runMethod(JSBridgeArgumentWrap& argument) const;
///The parent browser bridge
BrowserBridge& m_bridge;
};
}
@@ -1,4 +1,4 @@
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
using namespace active::serialise;
using namespace speckle::interfac::browser::bridge;
@@ -11,9 +11,9 @@ using namespace speckle::interfac::browser::bridge;
return: True if items have been added to the inventory
--------------------------------------------------------------------*/
bool BridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
bool JSBridgeArgument::fillInventory(active::serialise::Inventory& inventory) const {
return true;
} //BridgeArgument::fillInventory
} //JSBridgeArgument::fillInventory
/*--------------------------------------------------------------------
@@ -23,13 +23,13 @@ bool BridgeArgument::fillInventory(active::serialise::Inventory& inventory) cons
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique BridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
Cargo::Unique JSBridgeArgument::getCargo(const active::serialise::Inventory::Item& item) const {
return nullptr;
} //BridgeArgument::getCargo
} //JSBridgeArgument::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void BridgeArgument::setDefault() {
} //BridgeArgument::setDefault
void JSBridgeArgument::setDefault() {
} //JSBridgeArgument::setDefault
@@ -0,0 +1,87 @@
#ifndef SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Utility/String.h"
namespace speckle::interfac::browser::bridge {
/*!
Base class for the argments passed from JavaScript to a named C++ method in a Speckle bridging object
NB: The JSBridgeArgumentWrap class will:
- Deserialise the essential attributes for determining the target method and arguments;
- Create the correct JSBridgeArgument subclass for the emthod/argument and populate it with the collected attributes
Therefore, there is no need for this class to handle any deserialisation, and subclasses should only handle the core arguments data
*/
class JSBridgeArgument : public active::serialise::Package {
public:
// MARK: - Constructors
/*!
Default constructor
*/
JSBridgeArgument() {}
/*!
Constructor
@param methodName The name of the method to receive the argument
@param requestID An ID to be paired with the method return value
*/
JSBridgeArgument(const speckle::utility::String& methodName,
const speckle::utility::String& requestID) : m_methodName{methodName}, m_requestID{requestID} {}
/*!
Destructor
*/
virtual ~JSBridgeArgument() {}
// MARK: - Functions (const)
/*!
Get the name of the method to receive the arguments
@return The method name
*/
const speckle::utility::String& getMethodName() const { return m_methodName; }
/*!
Get the request ID from the JS caller (to be paired with the method result)
@return The request ID
*/
const speckle::utility::String& getRequestID() const { return m_requestID; }
/*!
Fill an inventory with the cargo items
@param inventory The inventory to receive the cargo items
@return True if items have been added to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
// MARK: - Functions (mutating)
/*!
Set to the default package content
*/
void setDefault() override;
private:
///The name of the method to receive the argument
speckle::utility::String m_methodName;
///An ID to be paired with the method return value
speckle::utility::String m_requestID;
};
///Definition of the argument for a JS callable method (enclosing the local function argument)
template<typename T>
class JSArgType : public JSBridgeArgument {
public:
using JSBridgeArgument::JSBridgeArgument;
T value;
};
}
#endif //SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT
@@ -0,0 +1,127 @@
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
#include "Active/Serialise/Inventory/Inventory.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
using namespace active::serialise;
using namespace speckle::interfac::browser::bridge;
using namespace speckle::utility;
namespace speckle::interfac::browser::bridge {
///Factory functions to construct arguments from linked bridge/method names
std::unordered_map<speckle::utility::String, JSBridgeArgumentWrap::Production> JSBridgeArgumentWrap::m_argumentFactory;
}
namespace {
using enum active::serialise::Entry::Type;
///The indices of the package items
enum FieldIndex {
args,
};
///The indices of the arguments array rows
enum RowIndex {
methodName,
requestID,
argsJSON,
};
///The package inventory
auto myInventory = Inventory {
{
{ {"arg"}, args, 0, std::nullopt, true }, //The JS arguments are expressed as a flat array - use the array indices to map to expected vars
},
}.withType(&typeid(JSBridgeArgumentWrap));;
}
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
JSBridgeArgumentWrap::~JSBridgeArgumentWrap() {
} //JSBridgeArgumentWrap::~JSBridgeArgumentWrap
/*--------------------------------------------------------------------
Fill an inventory with the cargo items
inventory: The inventory to receive the cargo items
return: True if items have been added to the inventory
--------------------------------------------------------------------*/
bool JSBridgeArgumentWrap::fillInventory(Inventory& inventory) const {
inventory.merge(myInventory);
return true;
} //JSBridgeArgumentWrap::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique JSBridgeArgumentWrap::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(JSBridgeArgumentWrap))
return nullptr;
switch (item.index) {
case FieldIndex::args: {
switch (item.available - 1) { //NB: Args are not labelled - in this instance we use the array row index to couple to an argument var
case RowIndex::methodName:
return std::make_unique<ValueWrap<String>>(m_methodName);
case RowIndex::requestID:
return std::make_unique<ValueWrap<String>>(m_requestID);
case RowIndex::argsJSON:
return std::make_unique<ValueWrap<String>>(m_argsJSON);
default:
return nullptr;
}
}
default:
return nullptr; //Requested an unknown index
}
} //JSBridgeArgumentWrap::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void JSBridgeArgumentWrap::setDefault() {
m_methodName.clear();
m_requestID.clear();
m_argsJSON.clear();
m_argument.reset(); //This will be populated once the target bridge and method are known (and hence the required argument type)
} //JSBridgeArgumentWrap::setDefault
/*--------------------------------------------------------------------
Validate the cargo data
return: True if the data has been validated
--------------------------------------------------------------------*/
bool JSBridgeArgumentWrap::validate() {
//Build an argument with the attributes obtained of none exists
if (!m_argument)
finaliseArgument();
//Then ensure the argument object is valid
return m_argument->validate();
} //JSBridgeArgumentWrap::validate
/*--------------------------------------------------------------------
Finalise the output argument object based on the current object, method etc
--------------------------------------------------------------------*/
void JSBridgeArgumentWrap::finaliseArgument() const {
//Use the deserialised target bridge and method to establish the required arguments (if any)
m_argument.reset(JSBridgeArgumentWrap::makeArgument(m_requestID, m_argsJSON));
//If the function doesn't take an argument, we still need to pass along the base class with object name, method etc
if (!m_argument)
m_argument = std::make_unique<JSBridgeArgument>(m_methodName, m_requestID);
} //JSBridgeArgumentWrap::finaliseArgument
@@ -2,13 +2,13 @@
#define SPECKLE_INTERFACE_JS_BRIDGE_ARGUMENT_WRAP
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Interface/Browser/Bridge/BridgeArgument.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgument.h"
#include <unordered_map>
namespace speckle::interfac::browser::bridge {
class BridgeArgument;
class JSBridgeArgument;
/*!
Factory function to make an argument object
@@ -19,11 +19,7 @@ namespace speckle::interfac::browser::bridge {
template<typename T>
void* constructArgument(const speckle::utility::String& method, const speckle::utility::String& request) {
try {
auto result = new T(method, request);
//Tag the argument object as a template where possible
if (auto arg = dynamic_cast<ArgumentBase*>(result); arg != nullptr)
arg->setArgumentTemplate(true);
return result;
return new T(method, request);
} catch(...) {
return nullptr; //Object constructors should throw an exception if incoming data isn't viable (NB: only use for unrecoverable problems)
}
@@ -32,7 +28,7 @@ namespace speckle::interfac::browser::bridge {
/*!
Wrapper for bridge function arguments, determing the target requirement on demand
*/
class BridgeArgumentWrap : public active::serialise::Package {
class JSBridgeArgumentWrap : public active::serialise::Package {
public:
// MARK: - Constructors
@@ -40,31 +36,31 @@ namespace speckle::interfac::browser::bridge {
/*!
Default constructor
*/
BridgeArgumentWrap() {}
JSBridgeArgumentWrap() {}
/*!
Copy constructor
*/
BridgeArgumentWrap(const BridgeArgumentWrap&) = default;
JSBridgeArgumentWrap(const JSBridgeArgumentWrap&) = default;
/*!
Destructor
*/
~BridgeArgumentWrap();
~JSBridgeArgumentWrap();
// MARK: - Operators
/*!
Conversion operator
@return True if the argument is populated
@return True if the arguments are populated
*/
operator bool() { return m_argument.operator bool(); }
// MARK: - Functions (const)
/*!
Get the bridge function argument
@return The bridge argument (nullptr on failure)
Get the bridge function arguments
@return The bridge arguments (nullptr on failure)
*/
std::shared_ptr<BridgeArgument> get() const { return m_argument; }
std::shared_ptr<JSBridgeArgument> get() const { return m_argument; }
/*!
Get the associated method name for the argument
@return The method name (empty on failure)
@@ -75,6 +71,11 @@ namespace speckle::interfac::browser::bridge {
@return The request ID (empty on failure)
*/
speckle::utility::String getRequestID() const { return m_argument ? m_argument->getRequestID() : speckle::utility::String{}; }
/*!
Get the function argument (as a JSON string, expected to contain the argument values in an array)
@return The function argument (expressed as "[]" for functions that take no arguments)
*/
speckle::utility::String getArgJSON() const { return m_argsJSON; }
// MARK: - Functions (serialisation)
@@ -102,20 +103,20 @@ namespace speckle::interfac::browser::bridge {
/*!
Make an argument object for a specified bridge method
@param methodID The name of the target method
@param requestID The ID of the request
@param argument The method argument data (serialised)
@param method The name of the target method
@return An argument object (nullptr on failure)
*/
static std::unique_ptr<BridgeArgument> makeArgument(const speckle::utility::String& methodID,
const speckle::utility::String& requestID,
const speckle::utility::String& argument);
static JSBridgeArgument* makeArgument(const speckle::utility::String& method, const speckle::utility::String& request) {
if (auto maker = m_argumentFactory.find(method); (maker != m_argumentFactory.end()))
return reinterpret_cast<JSBridgeArgument*>(maker->second(method, request));
return nullptr;
}
/*!
Add a factory method for constructing the arguments of a specified bridge method
@param method The name of the target method
*/
template<typename T> requires std::is_base_of_v<BridgeArgument, T>
template<typename T> requires std::is_base_of_v<JSBridgeArgument, T>
static void defineArgument(const speckle::utility::String& method) {
m_argumentFactory[method] = constructArgument<T>;
}
@@ -135,10 +136,10 @@ namespace speckle::interfac::browser::bridge {
speckle::utility::String m_methodName;
///An ID to be paired with the method return value
speckle::utility::String m_requestID;
///The function arguments as JSON
///the function arguments as JSON
speckle::utility::String m_argsJSON;
///The wrapped function arguments
mutable std::shared_ptr<BridgeArgument> m_argument;
mutable std::shared_ptr<JSBridgeArgument> m_argument;
};
}
@@ -3,9 +3,8 @@
#include "Speckle/Interface/Browser/JSObject.h"
#include "Speckle/Interface/Browser/NamedFunction.h"
#include "Speckle/Interface/Browser/Bridge/BridgeArgumentWrap.h"
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
#include "Speckle/Interface/Browser/Bridge/BridgeMethodBase.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeArgumentWrap.h"
#include "Speckle/Interface/Browser/Bridge/JSBridgeMethodBase.h"
#ifdef ARCHICAD
#include "Speckle/Serialise/JSBase/JSBaseTransport.h"
@@ -19,12 +18,12 @@
namespace speckle::interfac::browser::bridge {
/*!
Base class for any method provided by a Speckle JS bridge object
A class to provide JS bridging for Speckle connectors using a table of defined methods
@tparam Argument The function parameter type
@tparam Return The function return type
*/
template<typename Argument, typename Return>
class BridgeMethod : public NamedFunction<Argument, Return>, public virtual BridgeMethodBase {
class JSBridgeMethod : public NamedFunction<Argument, Return>, public virtual JSBridgeMethodBase {
public:
// MARK: - Types
@@ -40,12 +39,12 @@ namespace speckle::interfac::browser::bridge {
@param name The function name
@param function The C++ function bound to the name
*/
BridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
JSBridgeMethod(const speckle::utility::String& name, Function function) : base{name, function} {}
/*!
Copy constructor
@param source The object to copy
*/
BridgeMethod(const BridgeMethod& source) = default;
JSBridgeMethod(const JSBridgeMethod& source) = default;
// MARK: - Functions (const)
@@ -54,9 +53,9 @@ namespace speckle::interfac::browser::bridge {
@param bridge The target bridge name
@return A reference to this
*/
BridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
JSBridgeMethod& registerArgument(const speckle::utility::String& bridge) override {
if constexpr(!std::same_as<Argument, void>)
BridgeArgumentWrap::defineArgument<Argument>(base::getName());
JSBridgeArgumentWrap::defineArgument<Argument>(base::getName());
return *this;
}
};
@@ -2,21 +2,20 @@
#define SPECKLE_INTERFACE_JS_BRIDGE_METHOD_BASE
#include "Speckle/Utility/String.h"
#include "Speckle/Interface/Browser/Bridge/BridgeChild.h"
namespace speckle::interfac::browser::bridge {
/*!
Interface for methods supporting a JS bridge
*/
class BridgeMethodBase : public BridgeChild {
class JSBridgeMethodBase {
public:
/*!
Register the method argument type for a specified bridge
@param bridge The target bridge name
@return A reference to this
*/
virtual BridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
virtual JSBridgeMethodBase& registerArgument(const speckle::utility::String& bridge) = 0;
};
}
@@ -19,7 +19,7 @@ namespace speckle::interfac::browser {
Interface for a C++ function binding to a JavaScript function
@tparam Argument The function parameter type
@tparam Return The function return type
@tparam Binding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
@tparam Binding The platform JS binding
*/
template<typename Argument, typename Return, typename Binding>
class JSFunction : public NamedFunction<Argument, Return>, public Binding {
@@ -12,7 +12,7 @@ namespace speckle::interfac::browser {
/*!
Interface for a JavaScript object binding to C++ functions
@tparam FunctionBinding The platform JS binding (defines argument/result serialisation and transport mechanism to (de)serialise)
@tparam FunctionBinding The platform JS binding
*/
template<typename FunctionBinding = PlatformBinding>
class JSObject : public std::vector<std::shared_ptr<FunctionBinding>> {
@@ -56,7 +56,7 @@ namespace speckle::interfac::browser {
void setPortal(const JSPortal<FunctionBinding>& portal) { m_portal = &portal; }
protected:
///The parent JS portal for this object
///The
const JSPortal<FunctionBinding>* m_portal = nullptr;
private:
@@ -1,7 +1,6 @@
#ifndef SPECKLE_INTERFACE_JS_PORTAL
#define SPECKLE_INTERFACE_JS_PORTAL
#include "Speckle/Environment/Platform.h"
#include "Speckle/Interface/Browser/JSObject.h"
#include "Speckle/Interface/Browser/PlatformBinding.h"
#include "Speckle/Utility/String.h"
@@ -10,8 +9,6 @@
#include <JavascriptEngine.hpp>
#endif
#include <iostream>
namespace speckle::interfac::browser {
/*!
@@ -73,9 +70,6 @@ namespace speckle::interfac::browser {
#ifdef ARCHICAD
try {
auto engine = getJSEngine();
#ifdef DEBUG
speckle::environment::platform()->writeToConsole("\nExecuted:\n" + code + "\n");
#endif
auto result = engine ? engine->ExecuteJS(code) : false;
return result;
} catch(...) {
@@ -100,13 +94,10 @@ namespace speckle::interfac::browser {
auto engine = getJSEngine();
if (!engine)
return false;
//Define the JS object
JS::Object* acObject = new JS::Object(object->getName());
//Add all the functions supported by this object
for (auto& function : *object) {
acObject->AddItem(new JS::Function(function->getName(), [&](GS::Ref<JS::Base> args) {
acObject->AddItem(new JS::Function(function->getName(), [&] (GS::Ref<JS::Base> args) {
try {
//NB: All JS functions enter at this point
return function->execute(args);
} catch(...) {
///TODO: Need to discuss the best course of action to notify of a failure
@@ -114,7 +105,6 @@ namespace speckle::interfac::browser {
return GS::Ref<JS::Base>{};
}));
}
//And finally register the object
if (engine->RegisterAsynchJSObject(acObject)) {
base::push_back(object);
object->setPortal(*this);
@@ -14,7 +14,7 @@
namespace speckle::interfac::browser {
///Define the bridge binding protocols according to platform (argument/result serialisation and transport for (de)serialisation)
///Define the bridge binding protocols according to platform
#ifdef ARCHICAD
//Archicad uses a proprietary JS::Base type for JS values
using PlatformBinding = JSBinding<GS::Ref<JS::Base>, speckle::serialise::jsbase::JSBaseTransport>;
@@ -1,97 +1,38 @@
#include "Speckle/Record/Credentials/Account.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/PackageWrap.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::record::cred;
using namespace speckle::utility;
#include <array>
namespace {
///Serialisation fields
enum FieldIndex {
tokenID,
refreshTokenID,
isDefaultID,
isOnlineID,
serverInfoID,
userInfoID,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"token"},
Identity{"refreshToken"},
Identity{"isDefault"},
Identity{"isOnline"},
Identity{"serverInfo"},
Identity{"userInfo"},
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Account::Account(const String& ID) : base{ID} {
Account::Account(Guid ID) : Record{ID} {
//TODO: Complete
} //Account::Account
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Account::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[tokenID], tokenID, element },
{ fieldID[refreshTokenID], refreshTokenID, element },
{ fieldID[isDefaultID], isDefaultID, element },
{ fieldID[isOnlineID], isOnlineID, element },
{ fieldID[serverInfoID], serverInfoID, element },
{ fieldID[userInfoID], userInfoID, element },
},
}.withType(&typeid(Account)));
return base::fillInventory(inventory);
//TODO: Complete
return true;
} //Account::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(Account))
return base::getCargo(item);
using namespace active::serialise;
switch (item.index) {
case tokenID:
return std::make_unique<ValueWrap<String>>(m_token);
case refreshTokenID:
return std::make_unique<ValueWrap<String>>(m_refreshToken);
case isDefaultID:
return std::make_unique<ValueWrap<bool>>(m_isDefault);
case isOnlineID:
return std::make_unique<ValueWrap<bool>>(m_isOnline);
case serverInfoID:
return std::make_unique<PackageWrap>(m_serverInfo);
case userInfoID:
return std::make_unique<PackageWrap>(m_userInfo);
default:
return nullptr; //Requested an unknown index
}
//TODO: Complete
return nullptr;
} //Account::getCargo
@@ -99,8 +40,16 @@ Cargo::Unique Account::getCargo(const Inventory::Item& item) const {
Set to the default package content
--------------------------------------------------------------------*/
void Account::setDefault() {
m_token.clear();
m_refreshToken.clear();
m_isDefault = false;
m_isOnline = true;
//TODO: Complete
} //Account::setDefault
/*--------------------------------------------------------------------
Validate the cargo data
return: True if the data has been validated
--------------------------------------------------------------------*/
bool Account::validate() {
//TODO: Complete
return true;
} //Account::validate
+10 -13
View File
@@ -3,8 +3,6 @@
#include "Active/Setting/SettingList.h"
#include "Speckle/Database/Content/Record.h"
#include "Speckle/Record/Credentials/ServerInfo.h"
#include "Speckle/Record/Credentials/UserInfo.h"
#include "Speckle/Utility/String.h"
namespace speckle::record::cred {
@@ -33,19 +31,13 @@ namespace speckle::record::cred {
Default constructor
@param ID The account record ID
*/
Account(const speckle::utility::String& ID = speckle::utility::String{});
/*!
Copy constructor
@param source The object to copy
*/
Account(const Account&) = default;
Account(speckle::utility::Guid ID = speckle::utility::Guid{});
/*!
Object cloning
@return A clone of this object
*/
Account* clonePtr() const override { return new Account{*this}; }
// MARK: - Functions (const)
// MARK: - Functions (mutating)
@@ -68,20 +60,25 @@ 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
ServerInfo m_serverInfo;
///Account user info
UserInfo m_userInfo;
//std::unique_ptr<ServerInfo> m_serverInfo;
///Account server info
//std::unique_ptr<UserInfo> m_userInfo;
};
}
@@ -1,111 +0,0 @@
#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
@@ -1,94 +0,0 @@
#ifndef SPECKLE_RECORD_CRED_SERVER_INFO
#define SPECKLE_RECORD_CRED_SERVER_INFO
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Record/Credentials/ServerMigration.h"
#include "Speckle/Utility/String.h"
namespace speckle::record::cred {
/*!
Account server info
*/
class ServerInfo : public active::serialise::Package {
public:
// MARK: - Constructors
/*!
Default constructor
*/
ServerInfo() {}
/*!
Constructor
@param name The server name
@param company The company name
@param version The server version
@param contact Admin contact email
@param description The server description
@param url The server URL
@param isFrontEnd ?
@param migration Server migration record
*/
ServerInfo(const utility::String& name, const utility::String& 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
@@ -1,75 +0,0 @@
#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
@@ -1,54 +0,0 @@
#ifndef SPECKLE_RECORD_CRED_SERVER_MIGRATION
#define SPECKLE_RECORD_CRED_SERVER_MIGRATION
#include "Active/Serialise/Package/Package.h"
#include "Speckle/Utility/String.h"
namespace speckle::record::cred {
/*!
User account record class
*/
class ServerMigration : public active::serialise::Package {
public:
// MARK: - 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
@@ -1,94 +0,0 @@
#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
@@ -1,81 +0,0 @@
#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,8 +1,6 @@
#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"
@@ -11,13 +9,9 @@
#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;
@@ -27,11 +21,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";
}
@@ -68,22 +62,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
@@ -94,16 +88,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
@@ -113,8 +107,7 @@ namespace {
if (const auto* jsonIdentity = dynamic_cast<const JSBaseIdentity*>(&identity); jsonIdentity != nullptr) {
type = jsonIdentity->type;
stage = jsonIdentity->stage;
}
else
} else
type = tagType;
}
/*!
@@ -122,16 +115,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
@@ -140,7 +133,7 @@ namespace {
stage = newStage;
return *this;
}
/*!
Set the identity tag type
@param tagType The tag type
@@ -151,42 +144,41 @@ 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))
@@ -205,8 +197,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)
@@ -215,25 +207,10 @@ 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
@@ -243,19 +220,17 @@ 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
@@ -289,18 +264,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;
}
@@ -313,7 +288,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)
@@ -325,7 +300,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));
@@ -337,18 +312,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
@@ -358,12 +333,8 @@ namespace {
Inventory inventory;
//Single-value items won't specify an inventory (no point)
if (!cargo.fillInventory(inventory) || (inventory.empty())) {
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;
}
if (item == nullptr)
throw std::system_error(makeJSBaseError(badValue)); //Non-items must be named
writeValue(*item, identity.name, destination);
return;
}
@@ -379,7 +350,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
@@ -398,84 +369,29 @@ 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
@@ -483,30 +399,5 @@ 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,12 +23,6 @@ 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
-37
View File
@@ -1,37 +0,0 @@
#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
-80
View File
@@ -1,80 +0,0 @@
#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
-94
View File
@@ -1,94 +0,0 @@
#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
+50 -132
View File
@@ -7,13 +7,6 @@
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 */; };
@@ -21,30 +14,17 @@
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 */; };
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 */; };
21F69EBE2C63C954008B6A06 /* Link.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69EBD2C63C954008B6A06 /* Link.cpp */; };
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 /* BridgeArgumentWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F802C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp */; };
21F69F812C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F802C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp */; };
21F69F962C71087A008B6A06 /* Account.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F922C71087A008B6A06 /* Account.cpp */; };
21F69FA62C733EDA008B6A06 /* BridgeArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */; };
21F69FA42C729400008B6A06 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA32C729400008B6A06 /* Record.cpp */; };
21F69FA62C733EDA008B6A06 /* JSBridgeArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69FA52C733EDA008B6A06 /* JSBridgeArgument.cpp */; };
21F93AEC2B2F406E009A2C5B /* Addon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F93AEA2B2F406D009A2C5B /* Addon.cpp */; };
/* End PBXBuildFile section */
@@ -86,13 +66,6 @@
/* 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>"; };
@@ -111,27 +84,14 @@
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>"; };
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>"; };
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>"; };
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>"; };
@@ -142,22 +102,25 @@
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 /* 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>"; };
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>"; };
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 /* BridgeArgumentWrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgeArgumentWrap.h; sourceTree = "<group>"; };
21F69F692C6E0D59008B6A06 /* JSBridgeArgumentWrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSBridgeArgumentWrap.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 /* 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>"; };
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>"; };
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>"; };
21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BridgeArgument.cpp; 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>"; };
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 */
@@ -185,7 +148,7 @@
isa = PBXGroup;
children = (
214EA4C52BA374FD008E5358 /* CMakeLists.txt */,
21D0BD1F2C86F0280077E104 /* Database */,
219351A92C62CA5300E5A69C /* Database */,
21F93AE82B2F406D009A2C5B /* Environment */,
21F93ACC2B2B67FC009A2C5B /* Event */,
21F69F1B2C6A0FE2008B6A06 /* Interface */,
@@ -265,14 +228,31 @@
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 */,
);
@@ -282,42 +262,11 @@
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 = (
@@ -356,14 +305,12 @@
21F69F4A2C6CCC25008B6A06 /* BrowserBridge.cpp */,
21F69F4B2C6CCC25008B6A06 /* BrowserBridge.h */,
21F69F582C6CDAEE008B6A06 /* Functions */,
210CC86D2C7E879700610F58 /* ArgumentBase.h */,
21F69FA52C733EDA008B6A06 /* BridgeArgument.cpp */,
21F69F4D2C6CCC25008B6A06 /* BridgeArgument.h */,
21F69F802C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp */,
21F69F692C6E0D59008B6A06 /* BridgeArgumentWrap.h */,
210CC87D2C80CD2A00610F58 /* BridgeChild.h */,
21F69F4F2C6CCC25008B6A06 /* BridgeMethod.h */,
21F69F822C701A8E008B6A06 /* BridgeMethodBase.h */,
21F69FA52C733EDA008B6A06 /* JSBridgeArgument.cpp */,
21F69F4D2C6CCC25008B6A06 /* JSBridgeArgument.h */,
21F69F802C6FF3B0008B6A06 /* JSBridgeArgumentWrap.cpp */,
21F69F692C6E0D59008B6A06 /* JSBridgeArgumentWrap.h */,
21F69F4F2C6CCC25008B6A06 /* JSBridgeMethod.h */,
21F69F822C701A8E008B6A06 /* JSBridgeMethodBase.h */,
);
path = Bridge;
sourceTree = "<group>";
@@ -371,8 +318,7 @@
21F69F582C6CDAEE008B6A06 /* Functions */ = {
isa = PBXGroup;
children = (
21B67D0C2C7E0E8D00FD64FC /* ErrorReport.cpp */,
21B67D092C7E0E8D00FD64FC /* ErrorReport.h */,
21F69F592C6CDB67008B6A06 /* FunctionBinding.h */,
21F69F602C6D0286008B6A06 /* GetBindingsMethodNames.cpp */,
21F69F572C6CDAEE008B6A06 /* GetBindingsMethodNames.h */,
21F69F7A2C6FD9FC008B6A06 /* GetCallResult.cpp */,
@@ -388,12 +334,6 @@
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>";
@@ -423,8 +363,6 @@
2167E2782C4911E2000827D3 /* CMakeLists.txt */,
21F93AEA2B2F406D009A2C5B /* Addon.cpp */,
21F93AE92B2F406D009A2C5B /* Addon.h */,
210CC89D2C81E34400610F58 /* Platform.cpp */,
210CC89E2C81E34400610F58 /* Platform.h */,
21329F632BFD452C00B5C7AF /* Environment.md */,
);
path = Environment;
@@ -437,20 +375,8 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
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 */,
21F69F5A2C6CDB67008B6A06 /* FunctionBinding.h in Headers */,
2193518C2C62655700E5A69C /* MenuEvent.h in Headers */,
21D0BD312C86FE090077E104 /* Index.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -567,7 +493,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
210CC8922C81AEBB00610F58 /* Guid32Tests.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -575,27 +500,20 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21D0BD552C890B1C0077E104 /* ServerMigration.cpp in Sources */,
21F69FA62C733EDA008B6A06 /* BridgeArgument.cpp in Sources */,
21F69FA62C733EDA008B6A06 /* JSBridgeArgument.cpp in Sources */,
21F69F682C6DFB01008B6A06 /* RunMethod.cpp in Sources */,
21F69F812C6FF3B0008B6A06 /* BridgeArgumentWrap.cpp in Sources */,
21F69F812C6FF3B0008B6A06 /* JSBridgeArgumentWrap.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 */,
21D0BD2B2C86FC350077E104 /* Record.cpp in Sources */,
21D0BD592C8910400077E104 /* UserInfo.cpp in Sources */,
210CC8902C81A98500610F58 /* Guid64.cpp in Sources */,
21D0BD322C86FE090077E104 /* Link.cpp in Sources */,
21F69EBE2C63C954008B6A06 /* 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;
+11 -27
View File
@@ -19,27 +19,23 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Speckle\Database\AccountDatabase.h" />
<ClInclude Include="Speckle\Database\Content\Index.h" />
<ClInclude Include="Speckle\Database\Content\Link.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\ErrorReport.h" />
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\PlatformBinding.h" />
<ClInclude Include="Speckle\Interface\Browser\Bridge\Functions\FunctionBinding.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" />
@@ -48,37 +44,25 @@
<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\AccountDatabase.cpp" />
<ClCompile Include="Speckle\Database\Content\Link.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>
@@ -209,7 +193,7 @@
<WarningLevel>Level3</WarningLevel>
<SDLCheck>
</SDLCheck>
<PreprocessorDefinitions>DEBUG;WINDOWS;ARCHICAD;ACExtension;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINDOWS;ARCHICAD;ACExtension;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>

Some files were not shown because too many files have changed in this diff Show More