Interim commit - builds with some warnings
Simplication of record identifiers Starting implementation of SenderModelCar Implementation of SendFilters in progress
This commit is contained in:
@@ -47,12 +47,14 @@
|
||||
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 */; };
|
||||
21D0BDA82C8F33AC0077E104 /* ModelCard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDA72C8F33AC0077E104 /* ModelCard.cpp */; };
|
||||
21D0BDAB2C8F363E0077E104 /* CardSetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDAA2C8F363E0077E104 /* CardSetting.cpp */; };
|
||||
21D0BDCF2C92DAC60077E104 /* AddModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDCB2C92DAC60077E104 /* AddModel.cpp */; };
|
||||
21D0BDD42C935D1A0077E104 /* UpdateModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDD22C935D1A0077E104 /* UpdateModel.cpp */; };
|
||||
21D0BDD72C935DAE0077E104 /* RemoveModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDD52C935DAE0077E104 /* RemoveModel.cpp */; };
|
||||
21D0BDDC2C93897B0077E104 /* SenderModelCard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDDA2C93897B0077E104 /* SenderModelCard.cpp */; };
|
||||
21D0BDE02C9393980077E104 /* SendFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDDD2C9393980077E104 /* SendFilter.cpp */; };
|
||||
21D0BDE32C943C630077E104 /* DirectSelectionSendFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDE12C943C630077E104 /* DirectSelectionSendFilter.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 */; };
|
||||
@@ -324,8 +326,6 @@
|
||||
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>"; };
|
||||
21D0BDA42C8F33AC0077E104 /* ModelCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCard.h; sourceTree = "<group>"; };
|
||||
21D0BDA72C8F33AC0077E104 /* ModelCard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModelCard.cpp; sourceTree = "<group>"; };
|
||||
21D0BDA92C8F363E0077E104 /* CardSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardSetting.h; sourceTree = "<group>"; };
|
||||
@@ -336,6 +336,12 @@
|
||||
21D0BDD32C935D1A0077E104 /* UpdateModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateModel.h; sourceTree = "<group>"; };
|
||||
21D0BDD52C935DAE0077E104 /* RemoveModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoveModel.cpp; sourceTree = "<group>"; };
|
||||
21D0BDD62C935DAE0077E104 /* RemoveModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveModel.h; sourceTree = "<group>"; };
|
||||
21D0BDDA2C93897B0077E104 /* SenderModelCard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SenderModelCard.cpp; sourceTree = "<group>"; };
|
||||
21D0BDDB2C93897B0077E104 /* SenderModelCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SenderModelCard.h; sourceTree = "<group>"; };
|
||||
21D0BDDD2C9393980077E104 /* SendFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SendFilter.cpp; sourceTree = "<group>"; };
|
||||
21D0BDDE2C9393980077E104 /* SendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendFilter.h; sourceTree = "<group>"; };
|
||||
21D0BDE12C943C630077E104 /* DirectSelectionSendFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectSelectionSendFilter.cpp; sourceTree = "<group>"; };
|
||||
21D0BDE22C943C630077E104 /* DirectSelectionSendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectSelectionSendFilter.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>"; };
|
||||
@@ -936,31 +942,11 @@
|
||||
path = Base;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CC92C77670400FD64FC /* Card */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BDAA2C8F363E0077E104 /* CardSetting.cpp */,
|
||||
21D0BDA92C8F363E0077E104 /* CardSetting.h */,
|
||||
21D0BDA72C8F33AC0077E104 /* ModelCard.cpp */,
|
||||
21D0BDA42C8F33AC0077E104 /* ModelCard.h */,
|
||||
21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */,
|
||||
21B67CC82C77670400FD64FC /* ModelCardDatabase.h */,
|
||||
);
|
||||
path = Card;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CCA2C77670400FD64FC /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CC92C77670400FD64FC /* Card */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21B67CCB2C77670400FD64FC /* Database */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21B67CCA2C77670400FD64FC /* Model */,
|
||||
21B67CC72C77670400FD64FC /* ModelCardDatabase.cpp */,
|
||||
21B67CC82C77670400FD64FC /* ModelCardDatabase.h */,
|
||||
);
|
||||
path = Database;
|
||||
sourceTree = "<group>";
|
||||
@@ -1013,7 +999,6 @@
|
||||
21D0BD5D2C89BFEA0077E104 /* Send */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */,
|
||||
21D0BD962C8F13F30077E104 /* GetSendFilters.cpp */,
|
||||
21D0BD952C8F13F30077E104 /* GetSendFilters.h */,
|
||||
21D0BD8D2C8EE4490077E104 /* Send.cpp */,
|
||||
@@ -1024,13 +1009,37 @@
|
||||
path = Send;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BD9A2C8F154B0077E104 /* Arg */ = {
|
||||
21D0BDD82C9387E60077E104 /* Record */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BD982C8F154B0077E104 /* SendFilter.cpp */,
|
||||
21D0BD992C8F154B0077E104 /* SendFilter.h */,
|
||||
21D0BDD92C9387F70077E104 /* Model */,
|
||||
);
|
||||
path = Arg;
|
||||
path = Record;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BDD92C9387F70077E104 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BDAA2C8F363E0077E104 /* CardSetting.cpp */,
|
||||
21D0BDA92C8F363E0077E104 /* CardSetting.h */,
|
||||
21D0BDDF2C9393980077E104 /* Filter */,
|
||||
21D0BDA72C8F33AC0077E104 /* ModelCard.cpp */,
|
||||
21D0BDA42C8F33AC0077E104 /* ModelCard.h */,
|
||||
21D0BDDA2C93897B0077E104 /* SenderModelCard.cpp */,
|
||||
21D0BDDB2C93897B0077E104 /* SenderModelCard.h */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D0BDDF2C9393980077E104 /* Filter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21D0BDE12C943C630077E104 /* DirectSelectionSendFilter.cpp */,
|
||||
21D0BDE22C943C630077E104 /* DirectSelectionSendFilter.h */,
|
||||
21D0BDDD2C9393980077E104 /* SendFilter.cpp */,
|
||||
21D0BDDE2C9393980077E104 /* SendFilter.h */,
|
||||
);
|
||||
path = Filter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21D1EA472BF14B6C00957EAA /* Archicad */ = {
|
||||
@@ -1092,6 +1101,7 @@
|
||||
21B67CCB2C77670400FD64FC /* Database */,
|
||||
21F69F092C677BC0008B6A06 /* Event */,
|
||||
21F69F0E2C677BC0008B6A06 /* Interface */,
|
||||
21D0BDD82C9387E60077E104 /* Record */,
|
||||
21B67CBA2C774C6500FD64FC /* Version.h */,
|
||||
);
|
||||
path = Connector;
|
||||
@@ -1353,10 +1363,10 @@
|
||||
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 */,
|
||||
21D0BDCF2C92DAC60077E104 /* AddModel.cpp in Sources */,
|
||||
21B67CF72C78D4DE00FD64FC /* GetComplexType.cpp in Sources */,
|
||||
21D0BDDC2C93897B0077E104 /* SenderModelCard.cpp in Sources */,
|
||||
21B67CAE2C77329800FD64FC /* GetSourceApplicationVersion.cpp in Sources */,
|
||||
21B67CC32C77649F00FD64FC /* GetDocumentState.cpp in Sources */,
|
||||
21D0BD602C89BFEA0077E104 /* SendBridge.cpp in Sources */,
|
||||
@@ -1372,6 +1382,7 @@
|
||||
21D0BDD42C935D1A0077E104 /* UpdateModel.cpp in Sources */,
|
||||
21B67CE72C78D23B00FD64FC /* ConnectorConfig.cpp in Sources */,
|
||||
21B67CAD2C77329800FD64FC /* GetSourceApplicationName.cpp in Sources */,
|
||||
21D0BDE02C9393980077E104 /* SendFilter.cpp in Sources */,
|
||||
21D0BDA82C8F33AC0077E104 /* ModelCard.cpp in Sources */,
|
||||
21D0BDD72C935DAE0077E104 /* RemoveModel.cpp in Sources */,
|
||||
21B67CDC2C78C88000FD64FC /* SayHi.cpp in Sources */,
|
||||
@@ -1380,6 +1391,7 @@
|
||||
21B67CCC2C77670400FD64FC /* ModelCardDatabase.cpp in Sources */,
|
||||
21F69F132C677BC0008B6A06 /* ConnectorPalette.cpp in Sources */,
|
||||
21F69FBC2C762EF0008B6A06 /* GetConfig.cpp in Sources */,
|
||||
21D0BDE32C943C630077E104 /* DirectSelectionSendFilter.cpp in Sources */,
|
||||
21B67CF12C78D38000FD64FC /* GoAway.cpp in Sources */,
|
||||
21F69F142C677BC0008B6A06 /* Connector.cpp in Sources */,
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Active/File/Directory.h"
|
||||
#include "ConnectorResource.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
#include "Interface/ConnectorMenu.h"
|
||||
#include "Interface/ConnectorPalette.h"
|
||||
#include "Speckle/Database/AccountDatabase.h"
|
||||
|
||||
+12
-10
@@ -1,33 +1,35 @@
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
|
||||
#include "Active/Database/Storage/Storage.h"
|
||||
#include "Active/Serialise/JSON/JSONTransport.h"
|
||||
#include "Speckle/Database/Identity/RecordID.h"
|
||||
#include "Speckle/Database/Storage/DocumentStore/DocumentStoreEngine.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::database;
|
||||
using namespace active::event;
|
||||
using namespace active::serialise;
|
||||
using namespace active::serialise::json;
|
||||
using namespace active::setting;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace connector::database {
|
||||
|
||||
///ModelCard database engine declaration
|
||||
class ModelCardDatabase::Engine : public DocumentStoreEngine<ModelCard, ModelCard, JSONTransport, active::utility::String> {
|
||||
using base = DocumentStoreEngine<ModelCard, ModelCard, JSONTransport, active::utility::String>;
|
||||
class ModelCardDatabase::Engine : public DocumentStoreEngine<ModelCard, ModelCard, JSONTransport, RecordID> {
|
||||
using base = DocumentStoreEngine<ModelCard, ModelCard, JSONTransport, RecordID>;
|
||||
using base::base;
|
||||
};
|
||||
|
||||
///ModelCard database storage declaration
|
||||
class ModelCardDatabase::Store : public active::database::Storage<connector::database::ModelCard, active::serialise::json::JSONTransport,
|
||||
active::utility::String, active::utility::String, active::utility::String, active::utility::String> {
|
||||
using base = active::database::Storage<connector::database::ModelCard, active::serialise::json::JSONTransport,
|
||||
active::utility::String, active::utility::String, active::utility::String, active::utility::String>;
|
||||
class ModelCardDatabase::Store : public Storage<ModelCard, JSONTransport,
|
||||
RecordID, RecordID, RecordID, RecordID> {
|
||||
using base = Storage<ModelCard, JSONTransport,
|
||||
RecordID, RecordID, RecordID, RecordID>;
|
||||
using base::base;
|
||||
};
|
||||
|
||||
@@ -93,7 +95,7 @@ void ModelCardDatabase::write(const ModelCard& card) const {
|
||||
|
||||
cardID: The ID of the card to erase
|
||||
--------------------------------------------------------------------*/
|
||||
void ModelCardDatabase::erase(const speckle::utility::String& cardID) const {
|
||||
void ModelCardDatabase::erase(const String& cardID) const {
|
||||
m_store->erase(cardID);
|
||||
} //ModelCardDatabase::erase
|
||||
|
||||
@@ -114,5 +116,5 @@ std::unique_ptr<Cargo> ModelCardDatabase::wrapper() const {
|
||||
return: The database subscription (add weakly to publisher)
|
||||
--------------------------------------------------------------------*/
|
||||
std::shared_ptr<active::event::Subscriber> ModelCardDatabase::getSubscription() {
|
||||
return std::dynamic_pointer_cast<active::event::Subscriber>(m_engine);
|
||||
return std::dynamic_pointer_cast<Subscriber>(m_engine);
|
||||
} //ModelCardDatabase::getSubscription
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
#ifndef CONNECTOR_DATABASE_MODEL_CARD_DATABASE
|
||||
#define CONNECTOR_DATABASE_MODEL_CARD_DATABASE
|
||||
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
|
||||
namespace active::event {
|
||||
class Subscriber;
|
||||
@@ -33,12 +33,12 @@ namespace connector::database {
|
||||
Get all model cards
|
||||
@return All the cards
|
||||
*/
|
||||
active::container::Vector<ModelCard> getCards() const;
|
||||
active::container::Vector<record::ModelCard> getCards() const;
|
||||
/*!
|
||||
Write a card to storage
|
||||
@param card The card to write
|
||||
*/
|
||||
void write(const ModelCard& card) const;
|
||||
void write(const record::ModelCard& card) const;
|
||||
/*!
|
||||
Erase a card
|
||||
@param cardID The ID of the card to erase
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/AddModel.h"
|
||||
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
///Argument parameter for a string
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::database::ModelCard>;
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::record::ModelCard>;
|
||||
///Argument type for this method
|
||||
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Add a model card to document storage
|
||||
@param card The card to add
|
||||
*/
|
||||
void run(connector::database::ModelCard& card) const;
|
||||
void run(connector::record::ModelCard& card) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/RemoveModel.h"
|
||||
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
///Argument parameter for a string
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::database::ModelCard>;
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::record::ModelCard>;
|
||||
///Argument type for this method
|
||||
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Add a model card to document storage
|
||||
@param card The card to add
|
||||
*/
|
||||
void run(connector::database::ModelCard& card) const;
|
||||
void run(connector::record::ModelCard& card) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/UpdateModel.h"
|
||||
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Database/Model/Card/ModelCardDatabase.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
#include "Active/Serialise/CargoHold.h"
|
||||
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
|
||||
///Argument parameter for a string
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::database::ModelCard>;
|
||||
using CardHold = active::serialise::CargoHold<active::serialise::PackageWrap, connector::record::ModelCard>;
|
||||
///Argument type for this method
|
||||
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace connector::interfac::browser::bridge {
|
||||
Add a model card to document storage
|
||||
@param card The card to add
|
||||
*/
|
||||
void run(connector::database::ModelCard& card) const;
|
||||
void run(connector::record::ModelCard& card) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
#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"
|
||||
#include "Connector/Record/Model/Filter/SendFilter.h"
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::record;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::utility;
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#include "Connector/Database/Model/Card/CardSetting.h"
|
||||
#include "Connector/Record/Model/CardSetting.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Item/Wrapper/AnyValueWrap.h"
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
#ifndef CONNECTOR_DATABASE_MODEL_CARD_SETTING
|
||||
#define CONNECTOR_DATABASE_MODEL_CARD_SETTING
|
||||
#ifndef CONNECTOR_RECORD_CARD_SETTING
|
||||
#define CONNECTOR_RECORD_CARD_SETTING
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::database {
|
||||
namespace connector::record {
|
||||
|
||||
/*!
|
||||
A setting attached to a model card, capturing rendering/view states of the model at the time of sending, e.g. level of detail (LoD)
|
||||
@@ -104,4 +104,4 @@ namespace connector::database {
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_DATABASE_MODEL_CARD_SETTING
|
||||
#endif //CONNECTOR_RECORD_CARD_SETTING
|
||||
@@ -0,0 +1,80 @@
|
||||
#include "Connector/Record/Model/Filter/DirectSelectionSendFilter.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::record;
|
||||
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 DirectSelectionSendFilter::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(DirectSelectionSendFilter)));
|
||||
return true;
|
||||
} //DirectSelectionSendFilter::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique DirectSelectionSendFilter::getCargo(const Inventory::Item& item) const {
|
||||
if (item.ownerType != &typeid(DirectSelectionSendFilter))
|
||||
return nullptr;
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(m_name);
|
||||
case summaryID:
|
||||
return std::make_unique<ValueWrap<String>>(m_summary);
|
||||
case defaultID:
|
||||
return std::make_unique<ValueWrap<bool>>(m_isDefault);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
} //DirectSelectionSendFilter::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void DirectSelectionSendFilter::setDefault() {
|
||||
m_name.clear();
|
||||
m_summary.clear();
|
||||
m_isDefault = false;
|
||||
} //DirectSelectionSendFilter::setDefault
|
||||
@@ -0,0 +1,88 @@
|
||||
#ifndef CONNECTOR_RECORD_DIRECT_SELECT_SEND_FILTER
|
||||
#define CONNECTOR_RECORD_DIRECT_SELECT_SEND_FILTER
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Utility/Cloner.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::record {
|
||||
|
||||
/*!
|
||||
Base class for element filters applied when a model is sent to a Speckle server
|
||||
*/
|
||||
class DirectSelectionSendFilter : 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
|
||||
*/
|
||||
DirectSelectionSendFilter(const speckle::utility::String& nm = {}, const speckle::utility::String& sum = {}, bool isDef = false) :
|
||||
m_name{nm}, m_summary{sum}, m_isDefault{isDef} {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~DirectSelectionSendFilter() {}
|
||||
/*!
|
||||
Record cloning
|
||||
@return A clone of this record
|
||||
*/
|
||||
virtual DirectSelectionSendFilter* clonePtr() const override { return new DirectSelectionSendFilter(*this); };
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the filter name
|
||||
@return The filter name
|
||||
*/
|
||||
const speckle::utility::String& getName() const { return m_name; };
|
||||
/*!
|
||||
Get a summary description of the filter function, e.g. "All selected elements"
|
||||
@return The filter summary description
|
||||
*/
|
||||
const speckle::utility::String& getSummary() const { return m_name; };
|
||||
/*!
|
||||
Determine if this is the default filter for model sends
|
||||
@return True if this is the default filter
|
||||
*/
|
||||
bool isDefault() const { return m_isDefault; };
|
||||
|
||||
// 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:
|
||||
///The filter name
|
||||
speckle::utility::String m_name;
|
||||
///A summary
|
||||
speckle::utility::String m_summary;
|
||||
///True if this is the default filter
|
||||
bool m_isDefault = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_RECORD_DIRECT_SELECT_SEND_FILTER
|
||||
+8
-8
@@ -1,11 +1,11 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendFilter.h"
|
||||
#include "Connector/Record/Model/Filter/SendFilter.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
@@ -59,11 +59,11 @@ Cargo::Unique SendFilter::getCargo(const Inventory::Item& item) const {
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case nameID:
|
||||
return std::make_unique<ValueWrap<String>>(name);
|
||||
return std::make_unique<ValueWrap<String>>(m_name);
|
||||
case summaryID:
|
||||
return std::make_unique<ValueWrap<String>>(summary);
|
||||
return std::make_unique<ValueWrap<String>>(m_summary);
|
||||
case defaultID:
|
||||
return std::make_unique<ValueWrap<bool>>(isDefault);
|
||||
return std::make_unique<ValueWrap<bool>>(m_isDefault);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}
|
||||
@@ -74,7 +74,7 @@ Cargo::Unique SendFilter::getCargo(const Inventory::Item& item) const {
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void SendFilter::setDefault() {
|
||||
name.clear();
|
||||
summary.clear();
|
||||
isDefault = false;
|
||||
m_name.clear();
|
||||
m_summary.clear();
|
||||
m_isDefault = false;
|
||||
} //SendFilter::setDefault
|
||||
+36
-15
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
#define CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
#ifndef CONNECTOR_RECORD_SEND_FILTER
|
||||
#define CONNECTOR_RECORD_SEND_FILTER
|
||||
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Utility/Cloner.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace connector::interfac::browser::bridge {
|
||||
namespace connector::record {
|
||||
|
||||
/*!
|
||||
A connector send filter
|
||||
Base class for element filters applied when a model is sent to a Speckle server
|
||||
*/
|
||||
class SendFilter : public active::serialise::Package, public active::utility::Cloner {
|
||||
public:
|
||||
@@ -26,22 +26,35 @@ namespace connector::interfac::browser::bridge {
|
||||
@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} {}
|
||||
m_name{nm}, m_summary{sum}, m_isDefault{isDef} {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~SendFilter() {}
|
||||
/*!
|
||||
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: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the filter name
|
||||
@return The filter name
|
||||
*/
|
||||
const speckle::utility::String& getName() const { return m_name; };
|
||||
/*!
|
||||
Get a summary description of the filter function, e.g. "All selected elements"
|
||||
@return The filter summary description
|
||||
*/
|
||||
const speckle::utility::String& getSummary() const { return m_name; };
|
||||
/*!
|
||||
Determine if this is the default filter for model sends
|
||||
@return True if this is the default filter
|
||||
*/
|
||||
bool isDefault() const { return m_isDefault; };
|
||||
|
||||
// MARK: - Serialisation
|
||||
|
||||
/*!
|
||||
@@ -60,8 +73,16 @@ namespace connector::interfac::browser::bridge {
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
private:
|
||||
///The filter name
|
||||
speckle::utility::String m_name;
|
||||
///A summary
|
||||
speckle::utility::String m_summary;
|
||||
///True if this is the default filter
|
||||
bool m_isDefault = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_INTERFACE_BRIDGE_SEND_FILTER
|
||||
#endif //CONNECTOR_RECORD_SEND_FILTER
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#include "Connector/Database/Model/Card/ModelCard.h"
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
|
||||
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
|
||||
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
using namespace active::container;
|
||||
using namespace active::serialise;
|
||||
using namespace connector::database;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
+10
-6
@@ -1,14 +1,14 @@
|
||||
#ifndef CONNECTOR_DATABASE_MODEL_CARD
|
||||
#define CONNECTOR_DATABASE_MODEL_CARD
|
||||
#ifndef CONNECTOR_RECORD_MODEL_CARD
|
||||
#define CONNECTOR_RECORD_MODEL_CARD
|
||||
|
||||
#include "Active/Container/Vector.h"
|
||||
#include "Active/Serialise/Package/Package.h"
|
||||
#include "Active/Utility/Cloner.h"
|
||||
#include "Connector/Database/Model/Card/CardSetting.h"
|
||||
#include "Connector/Record/Model/CardSetting.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
#include "Speckle/Database/Content/Record.h"
|
||||
|
||||
namespace connector::database {
|
||||
namespace connector::record {
|
||||
|
||||
/*!
|
||||
A connector send filter
|
||||
@@ -20,7 +20,7 @@ namespace connector::database {
|
||||
|
||||
using base = speckle::database::Record;
|
||||
//List of card settings
|
||||
using SettingList = active::container::Vector<connector::database::CardSetting>;
|
||||
using SettingList = active::container::Vector<connector::record::CardSetting>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -28,6 +28,10 @@ namespace connector::database {
|
||||
Default constructor
|
||||
*/
|
||||
ModelCard() {}
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
virtual ~ModelCard() {}
|
||||
/*!
|
||||
Record cloning
|
||||
@return A clone of this record
|
||||
@@ -96,4 +100,4 @@ namespace connector::database {
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_DATABASE_MODEL_CARD
|
||||
#endif //CONNECTOR_RECORD_MODEL_CARD
|
||||
@@ -0,0 +1,121 @@
|
||||
#include "Connector/Record/Model/SenderModelCard.h"
|
||||
|
||||
#include "Connector/Record/Model/Filter/SendFilter.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace active::serialise;
|
||||
using namespace connector::record;
|
||||
using namespace speckle::utility;
|
||||
|
||||
namespace {
|
||||
|
||||
///Serialisation fields
|
||||
enum FieldIndex {
|
||||
sendFilterID,
|
||||
};
|
||||
|
||||
///Serialisation field IDs
|
||||
static std::array fieldID = {
|
||||
Identity{"sendFilter"},
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Default constructor
|
||||
--------------------------------------------------------------------*/
|
||||
SenderModelCard::SenderModelCard() {
|
||||
|
||||
} //SenderModelCard::SenderModelCard
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Constructor
|
||||
|
||||
filter: The filter applied when the model was sent
|
||||
--------------------------------------------------------------------*/
|
||||
SenderModelCard::SenderModelCard(const SendFilter& filter) {
|
||||
|
||||
} //SenderModelCard::SenderModelCard
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Copy constructor
|
||||
|
||||
source: The object to copy
|
||||
--------------------------------------------------------------------*/
|
||||
SenderModelCard::SenderModelCard(const SenderModelCard& source) {
|
||||
|
||||
} //SenderModelCard::SenderModelCard
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Destructor
|
||||
--------------------------------------------------------------------*/
|
||||
SenderModelCard::~SenderModelCard() {
|
||||
|
||||
} //SenderModelCard::~SenderModelCard
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
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 SenderModelCard::fillInventory(Inventory& inventory) const {
|
||||
using enum Entry::Type;
|
||||
/* inventory.merge(Inventory{
|
||||
{
|
||||
{ fieldID[modelID], modelID, element },
|
||||
{ fieldID[projectID], projectID, element },
|
||||
{ fieldID[accountID], accountID, element },
|
||||
{ fieldID[serverURLID], serverURLID, element },
|
||||
{ fieldID[settingsID], settingsID, element },
|
||||
},
|
||||
}.withType(&typeid(SenderModelCard)));
|
||||
return base::fillInventory(inventory);*/
|
||||
} //SenderModelCard::fillInventory
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the specified cargo
|
||||
|
||||
item: The inventory item to retrieve
|
||||
|
||||
return: The requested cargo (nullptr on failure)
|
||||
--------------------------------------------------------------------*/
|
||||
Cargo::Unique SenderModelCard::getCargo(const Inventory::Item& item) const {
|
||||
/* if (item.ownerType != &typeid(SenderModelCard))
|
||||
return base::getCargo(item);
|
||||
using namespace active::serialise;
|
||||
switch (item.index) {
|
||||
case modelID:
|
||||
return std::make_unique<ValueWrap<String>>(m_modelID);
|
||||
case projectID:
|
||||
return std::make_unique<ValueWrap<String>>(m_projectID);
|
||||
case accountID:
|
||||
return std::make_unique<ValueWrap<String>>(m_accountID);
|
||||
case serverURLID:
|
||||
return std::make_unique<ValueWrap<String>>(m_serverURL);
|
||||
case settingsID:
|
||||
return std::make_unique<ContainerWrap<Vector, CardSetting>>(m_settings);
|
||||
default:
|
||||
return nullptr; //Requested an unknown index
|
||||
}*/
|
||||
} //SenderModelCard::getCargo
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Set to the default package content
|
||||
--------------------------------------------------------------------*/
|
||||
void SenderModelCard::setDefault() {
|
||||
/* base::setDefault();
|
||||
m_modelID.clear();
|
||||
m_projectID.clear();
|
||||
m_accountID.clear();
|
||||
m_serverURL.clear();
|
||||
m_settings.clear();*/
|
||||
} //SenderModelCard::setDefault
|
||||
@@ -0,0 +1,80 @@
|
||||
#ifndef CONNECTOR_RECORD_SENDER_MODEL_CARD
|
||||
#define CONNECTOR_RECORD_SENDER_MODEL_CARD
|
||||
|
||||
#include "Connector/Record/Model/ModelCard.h"
|
||||
|
||||
namespace connector::record {
|
||||
|
||||
class SendFilter;
|
||||
|
||||
/*!
|
||||
A connector model send card - carries information about what was sent with the model
|
||||
*/
|
||||
class SenderModelCard : public connector::record::ModelCard {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = connector::record::ModelCard;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
/*!
|
||||
Default constructor
|
||||
*/
|
||||
SenderModelCard();
|
||||
/*!
|
||||
Constructor
|
||||
@param filter The filter applied when the model was sent
|
||||
*/
|
||||
SenderModelCard(const SendFilter& filter);
|
||||
/*!
|
||||
Copy constructor
|
||||
@param source The object to copy
|
||||
*/
|
||||
SenderModelCard(const SenderModelCard& source);
|
||||
/*!
|
||||
Destructor
|
||||
*/
|
||||
~SenderModelCard();
|
||||
/*!
|
||||
Record cloning
|
||||
@return A clone of this record
|
||||
*/
|
||||
virtual SenderModelCard* clonePtr() const override { return new SenderModelCard(*this); };
|
||||
|
||||
// MARK: - Functions (const)
|
||||
|
||||
/*!
|
||||
Get the filter applied when the model was sent
|
||||
@return The model filter
|
||||
*/
|
||||
const SendFilter& getFilter() const { return *m_filter; }
|
||||
|
||||
// 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:
|
||||
///The filter applied when the model was sent
|
||||
std::unique_ptr<SendFilter> m_filter;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //CONNECTOR_RECORD_SENDER_MODEL_CARD
|
||||
@@ -3,18 +3,19 @@
|
||||
|
||||
#include "Active/Database/Content/Record.h"
|
||||
#include "Speckle/Database/Identity/Link.h"
|
||||
#include "Speckle/Database/Identity/RecordID.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
/*!
|
||||
Base class for a database record
|
||||
*/
|
||||
class Record : public active::database::Record<active::utility::String, active::utility::String, active::utility::String> {
|
||||
class Record : public active::database::Record<RecordID> {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Record<active::utility::String, active::utility::String, active::utility::String>;
|
||||
using base = active::database::Record<RecordID>;
|
||||
///Unique pointer
|
||||
using Unique = std::unique_ptr<Record>;
|
||||
///Shared pointer
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#define SPECKLE_DATABASE_INDEX
|
||||
|
||||
#include "Active/Database/Identity/Link.h"
|
||||
#include "Speckle/Database/Identity/RecordID.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
#include <any>
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
/*!
|
||||
@@ -13,12 +16,12 @@ 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 active::database::Index<RecordID> {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Index<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
using base = active::database::Index<RecordID>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@ 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::database::Link<RecordID> {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::Link<speckle::utility::String, speckle::utility::String, speckle::utility::String>;
|
||||
using base = active::database::Link<RecordID>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef SPECKLE_DATABASE_ID
|
||||
#define SPECKLE_DATABASE_ID
|
||||
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
namespace speckle::database {
|
||||
|
||||
using RecordID = speckle::utility::String;
|
||||
using TableID = speckle::utility::String;
|
||||
using DBaseID = speckle::utility::String;
|
||||
|
||||
}
|
||||
|
||||
#endif //SPECKLE_DATABASE_ID
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Active/Utility/BufferIn.h"
|
||||
#include "Active/Utility/BufferOut.h"
|
||||
#include "Speckle/Database/Storage/DocumentStore/DocumentStoreCore.h"
|
||||
#include "Speckle/Database/Identity/RecordID.h"
|
||||
#include "Speckle/Utility/Guid.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
@@ -34,17 +35,17 @@ namespace speckle::database {
|
||||
@tparam Transport The serialisation transport mechanism for objects
|
||||
@tparam ObjID The object identifier type, e.g. Guid
|
||||
*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID = active::utility::String>
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID = RecordID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
class DocumentStoreEngine : public DocumentStoreCore, public active::database::DBaseEngine<Obj, ObjID, active::utility::String, active::utility::String> {
|
||||
class DocumentStoreEngine : public DocumentStoreCore, public active::database::DBaseEngine<Obj, ObjID, RecordID, RecordID> {
|
||||
public:
|
||||
|
||||
// MARK: - Types
|
||||
|
||||
using base = active::database::DBaseEngine<Obj, ObjID, utility::String, active::utility::String>;
|
||||
using base = active::database::DBaseEngine<Obj, ObjID, RecordID, RecordID>;
|
||||
using Filter = base::Filter;
|
||||
using Outline = base::Outline;
|
||||
using Cache = active::database::RecordCache<Obj, ObjID, active::utility::String, active::utility::String>;
|
||||
using Cache = active::database::RecordCache<Obj, ObjID, RecordID, RecordID>;
|
||||
|
||||
// MARK: - Constructors
|
||||
|
||||
@@ -64,14 +65,14 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (when the object is bound to a specific document)
|
||||
@return The requested object (nullptr on failure)
|
||||
*/
|
||||
std::unique_ptr<Obj> getObject(const ObjID& objID, std::optional<active::utility::String> tableID = std::nullopt, std::optional<active::utility::String> documentID = std::nullopt) const override;
|
||||
std::unique_ptr<Obj> getObject(const ObjID& objID, std::optional<RecordID> tableID = std::nullopt, std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Get all objects
|
||||
@param tableID Optional table ID (defaults to the first table)
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return The requested objects (nullptr on failure)
|
||||
*/
|
||||
active::container::Vector<Obj> getObjects(std::optional<active::utility::String> tableID = std::nullopt, std::optional<active::utility::String> documentID = std::nullopt) const override;
|
||||
active::container::Vector<Obj> getObjects(std::optional<RecordID> tableID = std::nullopt, std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Get a filtered list of objects
|
||||
@param filter The object filter
|
||||
@@ -79,8 +80,8 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return The filtered objects (nullptr on failure)
|
||||
*/
|
||||
active::container::Vector<Obj> getObjects(const Filter& filter, std::optional<active::utility::String> tableID = std::nullopt,
|
||||
std::optional<active::utility::String> documentID = std::nullopt) const override;
|
||||
active::container::Vector<Obj> getObjects(const Filter& filter, std::optional<RecordID> tableID = std::nullopt,
|
||||
std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Write an object to the database
|
||||
@param object The object to write
|
||||
@@ -90,7 +91,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (when the object is bound to a specific document)
|
||||
*/
|
||||
void write(const Obj& object, const ObjID& objID, std::optional<ObjID> objDocID = std::nullopt,
|
||||
utility::String::Option tableID = std::nullopt, utility::String::Option documentID = std::nullopt) const override;
|
||||
std::optional<RecordID> tableID = std::nullopt, std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Erase an object by index
|
||||
@param ID The object ID
|
||||
@@ -98,15 +99,15 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (when the object is bound to a specific document)
|
||||
@throw Exception thrown on SQL error
|
||||
*/
|
||||
void erase(const ObjID& ID, std::optional<active::utility::String> tableID = std::nullopt,
|
||||
std::optional<active::utility::String> documentID = std::nullopt) const override;
|
||||
void erase(const ObjID& ID, std::optional<RecordID> tableID = std::nullopt,
|
||||
std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Erase all objects
|
||||
@param tableID Optional table ID (defaults to the first table)
|
||||
@param documentID Optional document ID (when the object is bound to a specific document)
|
||||
@throw Exception thrown on SQL error
|
||||
*/
|
||||
void erase(std::optional<active::utility::String> tableID = std::nullopt, std::optional<active::utility::String> documentID = std::nullopt) const override;
|
||||
void erase(std::optional<RecordID> tableID = std::nullopt, std::optional<RecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
Get the database outline
|
||||
@return The database outline
|
||||
@@ -175,8 +176,8 @@ namespace speckle::database {
|
||||
--------------------------------------------------------------------*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
std::unique_ptr<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObject(const ObjID& ID, std::optional<active::utility::String> tableID,
|
||||
std::optional<active::utility::String> documentID) const {
|
||||
std::unique_ptr<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObject(const ObjID& ID, std::optional<RecordID> tableID,
|
||||
std::optional<RecordID> documentID) const {
|
||||
return getCache()->read(ID);
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObject
|
||||
|
||||
@@ -191,8 +192,8 @@ namespace speckle::database {
|
||||
--------------------------------------------------------------------*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
active::container::Vector<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects(std::optional<active::utility::String> tableID,
|
||||
std::optional<active::utility::String> documentID) const {
|
||||
active::container::Vector<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects(std::optional<RecordID> tableID,
|
||||
std::optional<RecordID> documentID) const {
|
||||
return getCache()->read();
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects
|
||||
|
||||
@@ -208,8 +209,8 @@ namespace speckle::database {
|
||||
--------------------------------------------------------------------*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
active::container::Vector<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects(const Filter& filter, std::optional<active::utility::String> tableID,
|
||||
std::optional<active::utility::String> documentID) const {
|
||||
active::container::Vector<Obj> DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects(const Filter& filter, std::optional<RecordID> tableID,
|
||||
std::optional<RecordID> documentID) const {
|
||||
return getCache()->read(filter);
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::getObjects
|
||||
|
||||
@@ -226,7 +227,7 @@ namespace speckle::database {
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
void DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::write(const Obj& object, const ObjID& objID, std::optional<ObjID> objDocID,
|
||||
utility::String::Option tableID, utility::String::Option documentID) const {
|
||||
std::optional<RecordID> tableID, std::optional<RecordID> documentID) const {
|
||||
getCache()->write(object); //NB: In future we might support duplicating records if objID != obj.id
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::write
|
||||
|
||||
@@ -242,8 +243,8 @@ namespace speckle::database {
|
||||
--------------------------------------------------------------------*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
void DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase(const ObjID& ID, std::optional<active::utility::String> tableID,
|
||||
std::optional<active::utility::String> documentID) const {
|
||||
void DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase(const ObjID& ID, std::optional<RecordID> tableID,
|
||||
std::optional<RecordID> documentID) const {
|
||||
getCache()->erase(ID);
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase
|
||||
|
||||
@@ -256,7 +257,7 @@ namespace speckle::database {
|
||||
--------------------------------------------------------------------*/
|
||||
template<typename Obj, typename ObjWrapper, typename Transport, typename ObjID>
|
||||
requires DocumentStorable<Obj, Transport>
|
||||
void DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase(std::optional<active::utility::String> tableID, std::optional<active::utility::String> documentID) const {
|
||||
void DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase(std::optional<RecordID> tableID, std::optional<RecordID> documentID) const {
|
||||
getCache()->erase();
|
||||
} //DocumentStoreEngine<Obj, ObjWrapper, Transport, ObjID>::erase
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
21D0BDBD2C90F2830077E104 /* DocStoreSubscriber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDBB2C90F2830077E104 /* DocStoreSubscriber.cpp */; };
|
||||
21D0BDC42C9241940077E104 /* ProjectSubscriber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21D0BDC22C9241940077E104 /* ProjectSubscriber.cpp */; };
|
||||
21D0BDC52C9241940077E104 /* ProjectSubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BDC32C9241940077E104 /* ProjectSubscriber.h */; };
|
||||
21D0BDE72C943D3F0077E104 /* RecordID.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D0BDE42C943D3F0077E104 /* RecordID.h */; };
|
||||
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F382C6B880B008B6A06 /* JSBaseTransport.cpp */; };
|
||||
21F69F512C6CCC25008B6A06 /* BrowserBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F4A2C6CCC25008B6A06 /* BrowserBridge.cpp */; };
|
||||
21F69F612C6D0286008B6A06 /* GetBindingsMethodNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21F69F602C6D0286008B6A06 /* GetBindingsMethodNames.cpp */; };
|
||||
@@ -146,6 +147,7 @@
|
||||
21D0BDC22C9241940077E104 /* ProjectSubscriber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectSubscriber.cpp; sourceTree = "<group>"; };
|
||||
21D0BDC32C9241940077E104 /* ProjectSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectSubscriber.h; sourceTree = "<group>"; };
|
||||
21D0BDC62C9245E40077E104 /* ProjectEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectEvent.h; sourceTree = "<group>"; };
|
||||
21D0BDE42C943D3F0077E104 /* RecordID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordID.h; sourceTree = "<group>"; };
|
||||
21F69F012C66C229008B6A06 /* Doxyfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Doxyfile; path = Documentation/Doxyfile; sourceTree = "<group>"; };
|
||||
21F69F192C6A0FE2008B6A06 /* JSBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBinding.h; sourceTree = "<group>"; };
|
||||
21F69F352C6AA9B3008B6A06 /* JSFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSFunction.h; sourceTree = "<group>"; };
|
||||
@@ -335,6 +337,7 @@
|
||||
21D0BD2D2C86FE090077E104 /* Index.h */,
|
||||
21D0BD2E2C86FE090077E104 /* Link.cpp */,
|
||||
21D0BD2F2C86FE090077E104 /* Link.h */,
|
||||
21D0BDE42C943D3F0077E104 /* RecordID.h */,
|
||||
);
|
||||
path = Identity;
|
||||
sourceTree = "<group>";
|
||||
@@ -476,6 +479,7 @@
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21D0BDE72C943D3F0077E104 /* RecordID.h in Headers */,
|
||||
21D0BD212C86F0280077E104 /* AccountDatabase.h in Headers */,
|
||||
210CC86F2C7E879700610F58 /* ArgumentBase.h in Headers */,
|
||||
210CC8A02C81E34400610F58 /* Platform.h in Headers */,
|
||||
|
||||
Reference in New Issue
Block a user