diff --git a/SpeckleConnector/Connector/Database/ModelCardDatabase.cpp b/SpeckleConnector/Connector/Database/ModelCardDatabase.cpp index d53c689..761d8fc 100644 --- a/SpeckleConnector/Connector/Database/ModelCardDatabase.cpp +++ b/SpeckleConnector/Connector/Database/ModelCardDatabase.cpp @@ -49,7 +49,7 @@ namespace { Constructor --------------------------------------------------------------------*/ ModelCardDatabase::ModelCardDatabase() { - auto engine = std::make_shared(modelCardDBaseName, + m_engine = std::make_shared(modelCardDBaseName, //Schema DBaseSchema{active::utility::String{modelCardDBaseName}, //Tables diff --git a/SpeckleConnector/Connector/Record/Model/ModelCard.h b/SpeckleConnector/Connector/Record/Model/ModelCard.h index f5a03fc..6db4ec5 100644 --- a/SpeckleConnector/Connector/Record/Model/ModelCard.h +++ b/SpeckleConnector/Connector/Record/Model/ModelCard.h @@ -28,6 +28,18 @@ namespace connector::record { Default constructor */ ModelCard() {} + /*! + Constructor + @param modelID The model ID + @param projectID The project ID + @param accountID The account ID + @param serverURL The server URL + @param settings Any BIM host-related settings relevant to the appearance/rendering of the model, e.g. LoD, if properties included etc + */ + ModelCard(const speckle::database::RecordID& modelID, const speckle::database::RecordID& projectID, + const speckle::database::RecordID& accountID, const speckle::utility::String& serverURL, + const SettingList& settings) : + m_modelID(modelID), m_projectID(projectID), m_accountID(accountID), m_serverURL(serverURL), m_settings(settings) {} /*! Destructor */ diff --git a/SpeckleLib/Speckle/Database/Content/Record.h b/SpeckleLib/Speckle/Database/Content/Record.h index fdd1b3c..5d70542 100644 --- a/SpeckleLib/Speckle/Database/Content/Record.h +++ b/SpeckleLib/Speckle/Database/Content/Record.h @@ -28,12 +28,14 @@ namespace speckle::database { /*! Default constructor */ - Record() : base{} {} + Record() : base{active::utility::Guid{true}.operator active::utility::String(), + active::utility::Guid{true}.operator active::utility::String()} {} //TODO: Implement a better default for the ID /*! Constructor @param ID The record ID */ - Record(speckle::utility::String ID) : base{ID} {} + Record(speckle::utility::String ID, speckle::utility::String::Option globID = std::nullopt) : + base{ID, globID.value_or(active::utility::Guid{true}.operator active::utility::String())} {} /*! Destructor */ diff --git a/SpeckleLib/Speckle/Database/Storage/DocumentStore/DocumentStoreCore.cpp b/SpeckleLib/Speckle/Database/Storage/DocumentStore/DocumentStoreCore.cpp index b0a6b77..6438b2d 100644 --- a/SpeckleLib/Speckle/Database/Storage/DocumentStore/DocumentStoreCore.cpp +++ b/SpeckleLib/Speckle/Database/Storage/DocumentStore/DocumentStoreCore.cpp @@ -58,13 +58,11 @@ namespace { bool isExistingStore(active::utility::NameID& storeID) { if (storeID.id) return true; //We must have a store if the ID is populated - bool isStoreFound = false; API_Guid acID; if (auto statusCode = convertArchicadError(ACAPI_AddOnObject_GetObjectGuidFromName(String{storeID.name}, &acID)); statusCode != nominal) throw std::system_error(DocumentStoreCore::makeError(statusCode)); storeID.id = Guid{acID}; - isStoreFound = true; - return isStoreFound; + return storeID.id.operator bool(); //Returns true if the store ID is non-null, i.e. the object exists } //isExistingStore