Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 41c6ddf5b9 |
@@ -106,11 +106,8 @@
|
||||
<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\GetConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp"/>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Send.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\SendBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.cpp" />
|
||||
@@ -140,9 +137,6 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Send.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\SendBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\Arg\SayHiArg.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Test\GetComplexType.h" />
|
||||
|
||||
@@ -53,9 +53,6 @@
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Send">
|
||||
<UniqueIdentifier>{2b87cf11-87cd-435f-ab24-42170c2e657e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Send\Arg">
|
||||
<UniqueIdentifier>{3bc97363-0091-4f84-a5f7-085193bad850}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RFIX.win\Connector.rc2">
|
||||
@@ -152,16 +149,6 @@
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\SendBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Send.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send\Arg</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connector\ConnectorResource.h">
|
||||
@@ -245,15 +232,5 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\SendBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Send.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\GetSendFilters.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Send\Arg\SendFilter.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Send\Arg</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -44,10 +44,6 @@
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21B67CF52C78D4DD00FD64FC /* GetComplexType.cpp */; };
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */; };
|
||||
21D0BD672C89D7410077E104 /* AccountTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD642C89D7400077E104 /* AccountTests.cpp */; };
|
||||
21D0BD6A2C8A0DB40077E104 /* GetIsDevMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */; };
|
||||
21D0BD8E2C8EE4490077E104 /* Send.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD8D2C8EE4490077E104 /* Send.cpp */; };
|
||||
21D0BD972C8F13F30077E104 /* GetSendFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */; };
|
||||
21D0BD9B2C8F154B0077E104 /* SendFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BD982C8F154B0077E104 /* SendFilter.cpp */; };
|
||||
21D1E9AD2BF14AF200957EAA /* BIMData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9152BF14AEC00957EAA /* BIMData.framework */; };
|
||||
21D1E9AE2BF14AF200957EAA /* TeamworkPortalServerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9162BF14AEC00957EAA /* TeamworkPortalServerClient.framework */; };
|
||||
21D1E9AF2BF14AF200957EAA /* GDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D1E9172BF14AEC00957EAA /* GDL.framework */; };
|
||||
@@ -313,14 +309,6 @@
|
||||
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendBridge.cpp; sourceTree = "<group>"; };
|
||||
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendBridge.h; sourceTree = "<group>"; };
|
||||
21D0BD642C89D7400077E104 /* AccountTests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = AccountTests.cpp; sourceTree = "<group>"; };
|
||||
21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetIsDevMode.cpp; sourceTree = "<group>"; };
|
||||
21D0BD692C8A0DB40077E104 /* GetIsDevMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetIsDevMode.h; sourceTree = "<group>"; };
|
||||
21D0BD8A2C8EE4490077E104 /* Send.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Send.h; sourceTree = "<group>"; };
|
||||
21D0BD8D2C8EE4490077E104 /* Send.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Send.cpp; sourceTree = "<group>"; };
|
||||
21D0BD952C8F13F30077E104 /* GetSendFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetSendFilters.h; sourceTree = "<group>"; };
|
||||
21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetSendFilters.cpp; sourceTree = "<group>"; };
|
||||
21D0BD982C8F154B0077E104 /* SendFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendFilter.cpp; sourceTree = "<group>"; };
|
||||
21D0BD992C8F154B0077E104 /* SendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendFilter.h; sourceTree = "<group>"; };
|
||||
21D1E9152BF14AEC00957EAA /* BIMData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BIMData.framework; path = "../Archicad 27/Support/Frameworks/BIMData.framework"; sourceTree = "<group>"; };
|
||||
21D1E9162BF14AEC00957EAA /* TeamworkPortalServerClient.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TeamworkPortalServerClient.framework; path = "../Archicad 27/Support/Frameworks/TeamworkPortalServerClient.framework"; sourceTree = "<group>"; };
|
||||
21D1E9172BF14AEC00957EAA /* GDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GDL.framework; path = "../Archicad 27/Support/Frameworks/GDL.framework"; sourceTree = "<group>"; };
|
||||
@@ -988,26 +976,12 @@
|
||||
21D0BD5D2C89BFEA0077E104 /* Send */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */,
|
||||
21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */,
|
||||
21D0BD952C8F13F30077E104 /* GetSendFilters.h */,
|
||||
21D0BD8D2C8EE4490077E104 /* Send.cpp */,
|
||||
21D0BD8A2C8EE4490077E104 /* Send.h */,
|
||||
21D0BD5B2C89BFEA0077E104 /* SendBridge.cpp */,
|
||||
21D0BD5C2C89BFEA0077E104 /* SendBridge.h */,
|
||||
);
|
||||
path = Send;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD982C8F154B0077E104 /* SendFilter.cpp */,
|
||||
21D0BD992C8F154B0077E104 /* SendFilter.h */,
|
||||
);
|
||||
path = Arg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D1EA472BF14B6C00957EAA /* Archicad */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1111,8 +1085,6 @@
|
||||
21F69FB52C762EF0008B6A06 /* ConfigBridge.h */,
|
||||
21F69FB62C762EF0008B6A06 /* GetConfig.cpp */,
|
||||
21F69FB72C762EF0008B6A06 /* GetConfig.h */,
|
||||
21D0BD682C8A0DB40077E104 /* GetIsDevMode.cpp */,
|
||||
21D0BD692C8A0DB40077E104 /* GetIsDevMode.h */,
|
||||
21F69FBD2C7630B3008B6A06 /* UpdateConfig.cpp */,
|
||||
21F69FBE2C7630B3008B6A06 /* UpdateConfig.h */,
|
||||
);
|
||||
@@ -1327,15 +1299,11 @@
|
||||
21B67CE32C78D1FB00FD64FC /* SayHiArg.cpp in Sources */,
|
||||
21F69FBB2C762EF0008B6A06 /* ConfigBridge.cpp in Sources */,
|
||||
21F69F8A2C70D2C4008B6A06 /* AccountBridge.cpp in Sources */,
|
||||
21D0BD9B2C8F154B0077E104 /* SendFilter.cpp in Sources */,
|
||||
21D0BD8E2C8EE4490077E104 /* Send.cpp in Sources */,
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */,
|
||||
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */,
|
||||
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */,
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */,
|
||||
21D0BD972C8F13F30077E104 /* GetSendFilters.cpp in Sources */,
|
||||
21B67CAC2C77329800FD64FC /* BaseBridge.cpp in Sources */,
|
||||
21D0BD6A2C8A0DB40077E104 /* GetIsDevMode.cpp in Sources */,
|
||||
210CC8832C80E6A300610F58 /* TriggerEvent.cpp in Sources */,
|
||||
21B67CEB2C78D27200FD64FC /* DocumentInfo.cpp in Sources */,
|
||||
21B67CB92C774BFA00FD64FC /* GetConnectorVersion.cpp in Sources */,
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace {
|
||||
class ConnectorInstance : public ConnectorAddon {
|
||||
public:
|
||||
ConnectorInstance(const String& name) : ConnectorAddon{name} {
|
||||
add<ConnectorMenu>();
|
||||
add<ConnectorPalette>();
|
||||
add(std::make_shared<ConnectorMenu>());
|
||||
add(std::make_shared<ConnectorPalette>());
|
||||
}
|
||||
|
||||
// MARK: Functions (const)
|
||||
@@ -107,8 +107,8 @@ ConnectorAddon* connector::connector() {
|
||||
The following is the C interface for the plugin to Archicad as specified by the API
|
||||
*/
|
||||
|
||||
#include <ACAPinc.h>
|
||||
#include <APIdefs_Registration.h>
|
||||
#include "ACAPinc.h"
|
||||
#include "APIdefs_Registration.h"
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm that the plugin is able to run in the current environment
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
@@ -58,4 +58,4 @@ namespace connector::interfac::browser::bridge {
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_DOCUMENT_INFO
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_CONNECTOR_CONFIG
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/GetConfig.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Config/UpdateConfig.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendFilter.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
nameID,
|
||||
summaryID,
|
||||
defaultID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"name"},
|
||||
Identity{"summary"},
|
||||
Identity{"isDefault"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Fill an inventory with the package items
|
||||
|
||||
inventory: The inventory to receive the package items
|
||||
|
||||
return: True if the package has added items to the inventory
|
||||
--------------------------------------------------------------------*/
|
||||
bool SendFilter::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[nameID], nameID, element },
|
||||
{ fieldID[summaryID], summaryID, element },
|
||||
{ fieldID[defaultID], defaultID, element },
|
||||
},
|
||||
}.withType(&typeid(SendFilter)));
|
||||
return true;
|
||||
} //SendFilter::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique SendFilter::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(SendFilter))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(name);
|
||||
case summaryID:
|
||||
return std::make_unique<ValueWrap<String>>(summary);
|
||||
case defaultID:
|
||||
return std::make_unique<ValueWrap<bool>>(isDefault);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //SendFilter::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void SendFilter::setDefault() {
|
||||
name.clear();
|
||||
summary.clear();
|
||||
isDefault = false;
|
||||
} //SendFilter::setDefault
|
||||
@@ -1,67 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Utility/Cloner.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
/*!
|
||||
A connector send filter
|
||||
*/
|
||||
class SendFilter : public active::serialise::Package, public active::utility::Cloner {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
@param nm The filter name
|
||||
@param sum A summary
|
||||
@param isDef True if this is the default filter
|
||||
*/
|
||||
SendFilter(const speckle::utility::String& nm = {}, const speckle::utility::String& sum = {}, bool isDef = false) :
|
||||
name{nm}, summary{sum}, isDefault{isDef} {}
|
||||
/*!
|
||||
Record cloning
|
||||
@return A clone of this record
|
||||
*/
|
||||
virtual SendFilter* clonePtr() const override { return new SendFilter(*this); };
|
||||
|
||||
// MARK: - Public variables (NB: Assuming to class invariants or overrides for this data, so making public for simplicity)
|
||||
|
||||
///The filter name
|
||||
speckle::utility::String name;
|
||||
///A summary
|
||||
speckle::utility::String summary;
|
||||
///True if this is the default filter
|
||||
bool isDefault = false;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
bool fillInventory(active::serialise::Inventory& inventory) const override;
|
||||
/*!
|
||||
Get the specified cargo
|
||||
@param item The inventory item to retrieve
|
||||
@return The requested cargo (nullptr on failure)
|
||||
*/
|
||||
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
|
||||
/*!
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/GetSendFilters.h"
|
||||
|
||||
#include "Active/Container/Vector.h"
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendFilter.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
using WrappedValue = active::serialise::CargoHold<ContainerWrap<Vector, SendFilter>, Vector<SendFilter>>;
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
GetSendFilters::GetSendFilters() : BridgeMethod{"GetSendFilters", [&]() {
|
||||
return run();
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the send filters
|
||||
|
||||
return: The send filters
|
||||
--------------------------------------------------------------------*/
|
||||
std::unique_ptr<Cargo> GetSendFilters::run() const {
|
||||
Vector<SendFilter> filters;
|
||||
///TODO: Get real filters
|
||||
return std::make_unique<WrappedValue>(filters);
|
||||
} //GetSendFilters::run
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
class ConnectorConfig;
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the send filters
|
||||
*/
|
||||
class GetSendFilters : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
GetSendFilters();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the send filters
|
||||
@return The send filters
|
||||
*/
|
||||
std::unique_ptr<active::serialise::Cargo> run() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_SEND_FILTERS
|
||||
@@ -1,25 +0,0 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Send.h"
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
Send::Send() : BridgeMethod{"Send", [&](UpdateArgs args) {
|
||||
run(args);
|
||||
}} {}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Send a specified model
|
||||
|
||||
modelCardID: The ID of the madel to send
|
||||
--------------------------------------------------------------------*/
|
||||
void Send::run(const String& modelCardID) const {
|
||||
///TODO: Send the requested model
|
||||
} //Send::run
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Config/Arg/ConnectorConfig.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
class ConnectorConfig;
|
||||
|
||||
///Argument for a JS call to update the configuration
|
||||
using UpdateArgs = speckle::interfac::browser::bridge::JSArgType<speckle::utility::String>;
|
||||
|
||||
/*!
|
||||
JS Function class to retrieve the names of the methods supported by the bridge
|
||||
*/
|
||||
class Send : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
|
||||
public:
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Constructor
|
||||
@param bridge The parent bridge object (provides access to bridge methods)
|
||||
*/
|
||||
Send();
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Send a specified model
|
||||
@param modelCardID The ID of the madel to send
|
||||
*/
|
||||
void run(const speckle::utility::String& modelCardID) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND
|
||||
@@ -1,8 +1,5 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
|
||||
|
||||
#include "Connector/Interface/Browser/Bridge/Send/GetSendFilters.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Send.h"
|
||||
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -10,6 +7,4 @@ using namespace connector::interfac::browser::bridge;
|
||||
--------------------------------------------------------------------*/
|
||||
SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
|
||||
//Add bridge methods
|
||||
addMethod<GetSendFilters>();
|
||||
addMethod<Send>();
|
||||
} //SendBridge::SendBridge
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
|
||||
@@ -163,11 +163,11 @@ BrowserPalette::BrowserPalette() :
|
||||
Attach(*this);
|
||||
BeginEventProcessing();
|
||||
//Install required connector bridges
|
||||
install<AccountBridge>();
|
||||
install<BaseBridge>();
|
||||
install<ConfigBridge>();
|
||||
install<SendBridge>();
|
||||
install<TestBridge>();
|
||||
install(std::make_shared<AccountBridge>());
|
||||
install(std::make_shared<BaseBridge>());
|
||||
install(std::make_shared<ConfigBridge>());
|
||||
//install(std::make_shared<SendBridge>());
|
||||
install(std::make_shared<TestBridge>());
|
||||
InitBrowserControl();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace connector {
|
||||
|
||||
static const unsigned int versionMinor = 2;
|
||||
|
||||
static const unsigned int versionPatch = 2;
|
||||
static const unsigned int versionPatch = 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#include "ActiveLibDoctest/TestingPlatforms.h"
|
||||
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Active/Utility/BufferIn.h"
|
||||
#include "Active/Utility/BufferOut.h"
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
@@ -14,7 +13,8 @@ using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
const char* accountJSON = "{\"id\":\"d4468f8d6f1e4c48a899518795326ea8\",\"token\":\"42986a57b3304baa8773f937aa0b7bcd42986a57b3\",\"refreshToken\":\"00b01c421de4404889f30947de1506d3440c476432\",\"isDefault\":true,\"isOnline\":false,\"serverInfo\":{\"name\":\"My new Speckle Server\",\"company\":\"Unknown Company\",\"version\":\"2.20.2-branch.testing.138676-e8c8291\",\"adminContact\":\"n/a\",\"description\":\"This a community deployment of a Speckle Server.\",\"frontend2\":true,\"url\":\"https://testing.speckle.dev\",\"migration\":null},\"userInfo\":{\"id\":\"00b01c421d\",\"name\":\"someone@speckle.systems\",\"email\":\"someone@speckle.systems\",\"company\":null,\"avatar\":null,\"streams\":{\"totalCount\":2},\"commits\":{\"totalCount\":5}}}";
|
||||
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}}}";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,19 +23,11 @@ TEST_SUITE(TESTQ(AccountTests)) TEST_SUITE_OPEN
|
||||
//Test to receive account serialised as JSON from SQLite dbase
|
||||
TEST_CASE(TESTQ(testAccountReceive)) {
|
||||
Account account;
|
||||
JSONTransport transport;
|
||||
try {
|
||||
transport.receive(PackageWrap{account}, Identity{}, String{accountJSON});
|
||||
JSONTransport().receive(PackageWrap{account}, Identity{}, String{accountJSON});
|
||||
} catch(...) {
|
||||
FAIL_CHECK(TEST_MESSAGE(Account deserialisation failed));
|
||||
}
|
||||
String accountOut;
|
||||
try {
|
||||
transport.send(PackageWrap{account}, Identity{}, accountOut);
|
||||
} catch(...) {
|
||||
FAIL_CHECK(TEST_MESSAGE(Account serialisation failed));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST_SUITE_CLOSE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Active/Database/Storage/SQLite/SQLiteEngine.h"
|
||||
#include "Active/Database/Storage/SQLiteEngine.h"
|
||||
#include "Active/Database/Storage/Storage.h"
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Null.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.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"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Active/Serialise/Inventory/Identity.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ItemWrap.h"
|
||||
#include "Active/Serialise/Package/NullPackage.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Speckle/Interface/Browser/JSBinding.h"
|
||||
#include "Speckle/Interface/Browser/NamedFunction.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
@@ -49,13 +49,6 @@ namespace speckle::interfac::browser {
|
||||
@return True if the object was successfully installed
|
||||
*/
|
||||
bool install(std::shared_ptr<JSObject<FunctionBinding>> object);
|
||||
/*!
|
||||
Install a JS function object
|
||||
@return True if the object was successfully installed
|
||||
@tparam T The type of object to install
|
||||
*/
|
||||
template<typename T> requires std::is_base_of_v<JSObject<FunctionBinding>, T>
|
||||
bool install() { return install(std::make_shared<T>()); }
|
||||
|
||||
protected:
|
||||
#ifdef ARCHICAD
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Speckle/Record/Credentials/Account.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Speckle/Record/Credentials/ServerInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageUnoWrap.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
#include <array>
|
||||
@@ -76,21 +76,21 @@ Cargo::Unique ServerInfo::getCargo(const Inventory::Item& item) const {
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<StringWrap>(m_name);
|
||||
return std::make_unique<ValueWrap<String>>(m_name);
|
||||
case companyID:
|
||||
return std::make_unique<StringOptWrap>(m_company);
|
||||
return std::make_unique<ValueWrap<String>>(m_company);
|
||||
case versionID:
|
||||
return std::make_unique<StringOptWrap>(m_version);
|
||||
return std::make_unique<ValueWrap<String>>(m_version);
|
||||
case contactID:
|
||||
return std::make_unique<StringOptWrap>(m_adminContact);
|
||||
return std::make_unique<ValueWrap<String>>(m_adminContact);
|
||||
case descriptionID:
|
||||
return std::make_unique<StringOptWrap>(m_description);
|
||||
return std::make_unique<ValueWrap<String>>(m_description);
|
||||
case frontEndID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_frontend2);
|
||||
case urlID:
|
||||
return std::make_unique<StringOptWrap>(m_url);
|
||||
return std::make_unique<ValueWrap<String>>(m_url);
|
||||
case migrationID:
|
||||
return std::make_unique<PackageUnoWrap<ServerMigration>>(m_migration);
|
||||
return std::make_unique<PackageWrap>(m_migration);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
@@ -102,23 +102,10 @@ Cargo::Unique ServerInfo::getCargo(const Inventory::Item& item) const {
|
||||
--------------------------------------------------------------------*/
|
||||
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
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Copy from another object
|
||||
|
||||
source: The object to copy
|
||||
--------------------------------------------------------------------*/
|
||||
void ServerInfo::copy(const ServerInfo& source) {
|
||||
if (this == &source)
|
||||
return;
|
||||
m_name = source.m_name;
|
||||
m_version = source.m_version;
|
||||
m_adminContact = source.m_adminContact;
|
||||
m_description = source.m_description;
|
||||
m_frontend2 = source.m_frontend2;
|
||||
m_url = source.m_url;
|
||||
m_migration = (source.m_migration) ? std::make_unique<ServerMigration>(*source.m_migration) : nullptr;
|
||||
} //ServerInfo::copy
|
||||
|
||||
@@ -30,29 +30,11 @@ namespace speckle::record::cred {
|
||||
@param isFrontEnd ?
|
||||
@param migration Server migration record
|
||||
*/
|
||||
ServerInfo(const utility::String& name, const utility::String::Option company = std::nullopt,
|
||||
const utility::String::Option version = std::nullopt, const utility::String::Option contact = std::nullopt,
|
||||
const utility::String::Option description = std::nullopt, const utility::String::Option url = std::nullopt,
|
||||
bool isFrontEnd = false, std::unique_ptr<ServerMigration> migration = nullptr) :
|
||||
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{std::move(migration)} {}
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
ServerInfo(const ServerInfo& source) { copy(source); }
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~ServerInfo() {}
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
/*!
|
||||
Assignment operator
|
||||
@param source The object to copy
|
||||
*/
|
||||
ServerInfo& operator=(const ServerInfo& source) { copy(source); return *this; }
|
||||
m_url{url}, m_frontend2{isFrontEnd}, m_migration{migration} {}
|
||||
ServerInfo(const ServerInfo&) = default;
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
@@ -61,78 +43,37 @@ namespace speckle::record::cred {
|
||||
@return The server name
|
||||
*/
|
||||
const utility::String& getName() const { return m_name; }
|
||||
/*!
|
||||
Get the company name
|
||||
@return The company name
|
||||
*/
|
||||
const utility::String::Option& getCompany() const { return m_company; }
|
||||
/*!
|
||||
Get the version
|
||||
@return The version
|
||||
*/
|
||||
const utility::String::Option& getVersion() const { return m_version; }
|
||||
/*!
|
||||
Get the admin contact email
|
||||
@return The admin contact email
|
||||
*/
|
||||
const utility::String::Option& getAdminContact() const { return m_adminContact; }
|
||||
/*!
|
||||
Get the description
|
||||
@return The description
|
||||
*/
|
||||
const utility::String::Option& getDescription() const { return m_description; }
|
||||
/*!
|
||||
Determine if ?
|
||||
@return ?
|
||||
*/
|
||||
bool isFrontEnd() const { return m_frontend2; }
|
||||
/*!
|
||||
Get the URL
|
||||
@return The URL
|
||||
*/
|
||||
const utility::String::Option& getURL() const { return m_url; }
|
||||
/*!
|
||||
Get the migration history
|
||||
@return The migration history (nullptr = no history)
|
||||
*/
|
||||
const ServerMigration* getMigration() const { return m_migration.get(); }
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
Fill an inventory with the package items
|
||||
@param inventory The inventory to receive the package items
|
||||
@return True if the package has added items to the inventory
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
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
|
||||
*/
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Copy from another object
|
||||
@param source The object to copy
|
||||
*/
|
||||
void copy(const ServerInfo& source);
|
||||
|
||||
///Server name
|
||||
utility::String m_name;
|
||||
///Company name
|
||||
utility::String::Option m_company;
|
||||
utility::String m_company;
|
||||
///Server version
|
||||
utility::String::Option m_version;
|
||||
utility::String m_version;
|
||||
///Admin contact email
|
||||
utility::String::Option m_adminContact;
|
||||
utility::String m_adminContact;
|
||||
///Server description
|
||||
utility::String::Option m_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"
|
||||
@@ -143,9 +84,9 @@ namespace speckle::record::cred {
|
||||
This field is not returned from the GQL API, it should be populated after construction.
|
||||
See "Speckle.Core.Credentials.AccountManager"
|
||||
*/
|
||||
utility::String::Option m_url;
|
||||
utility::String m_url;
|
||||
///Server migration record
|
||||
std::unique_ptr<ServerMigration> m_migration;
|
||||
ServerMigration m_migration;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Speckle/Record/Credentials/ServerMigration.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
using namespace active::serialise;
|
||||
@@ -57,10 +57,19 @@ Cargo::Unique ServerMigration::getCargo(const Inventory::Item& item) const {
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case movedToID:
|
||||
return std::make_unique<StringOptWrap>(movedTo);
|
||||
return std::make_unique<ValueWrap<String>>(movedTo);
|
||||
case movedFromID:
|
||||
return std::make_unique<StringOptWrap>(movedFrom);
|
||||
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
|
||||
|
||||
@@ -12,16 +12,6 @@ namespace speckle::record::cred {
|
||||
class ServerMigration : public active::serialise::Package {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::serialise::Package;
|
||||
///Unique pointer
|
||||
using Unique = std::unique_ptr<ServerMigration>;
|
||||
///Shared pointer
|
||||
using Shared = std::shared_ptr<ServerMigration>;
|
||||
///Optional
|
||||
using Option = std::optional<ServerMigration>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
@@ -35,9 +25,9 @@ namespace speckle::record::cred {
|
||||
// MARK: - Public variables
|
||||
|
||||
///New URI where this server is now deployed
|
||||
speckle::utility::String::Option movedTo;
|
||||
speckle::utility::String movedTo;
|
||||
///Previous URI where this server used to be deployed
|
||||
speckle::utility::String::Option movedFrom;
|
||||
speckle::utility::String movedFrom;
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
@@ -53,6 +43,10 @@ namespace speckle::record::cred {
|
||||
@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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Speckle/Record/Credentials/UserInfo.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueOptionWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
|
||||
#include <array>
|
||||
@@ -73,9 +73,9 @@ Cargo::Unique UserInfo::getCargo(const Inventory::Item& item) const {
|
||||
case emailID:
|
||||
return std::make_unique<ValueWrap<String>>(m_email);
|
||||
case companyID:
|
||||
return std::make_unique<StringOptWrap>(m_company);
|
||||
return std::make_unique<ValueWrap<String>>(m_company);
|
||||
case avatarID:
|
||||
return std::make_unique<StringOptWrap>(m_avatar);
|
||||
return std::make_unique<ValueWrap<String>>(m_avatar);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
@@ -88,5 +88,7 @@ Cargo::Unique UserInfo::getCargo(const Inventory::Item& item) const {
|
||||
void UserInfo::setDefault() {
|
||||
m_id.clear();
|
||||
m_name.clear();
|
||||
m_company.clear();
|
||||
m_email.clear();
|
||||
m_avatar.clear();
|
||||
} //UserInfo::setDefault
|
||||
|
||||
@@ -71,9 +71,9 @@ namespace speckle::record::cred {
|
||||
///User email
|
||||
utility::String m_email;
|
||||
///Compsny name
|
||||
utility::String::Option m_company;
|
||||
utility::String m_company;
|
||||
///Avatar?
|
||||
utility::String::Option m_avatar;
|
||||
utility::String m_avatar;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Active/Setting/Values/StringValue.h"
|
||||
#include "Active/Setting/Values/UInt32Value.h"
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Active/Serialise/Package/PackageWrap.h"
|
||||
#include "Active/Serialise/XML/Item/XMLDateTime.h"
|
||||
#include "Speckle/Environment/Platform.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user