From 346992fcec500eb90afeb51f4855001403b400d2 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Mon, 12 Jan 2015 14:56:55 +0000 Subject: [PATCH] Remove IMaster::same from the API. --- src/include/firebird/FirebirdInterface.idl | 4 ---- src/include/firebird/IdlFbInterfaces.h | 22 ---------------------- src/jrd/CryptoManager.cpp | 3 ++- src/yvalve/MasterImplementation.cpp | 5 ----- src/yvalve/MasterImplementation.h | 1 - 5 files changed, 2 insertions(+), 33 deletions(-) diff --git a/src/include/firebird/FirebirdInterface.idl b/src/include/firebird/FirebirdInterface.idl index 267df36ed8..8890794da5 100644 --- a/src/include/firebird/FirebirdInterface.idl +++ b/src/include/firebird/FirebirdInterface.idl @@ -88,11 +88,7 @@ interface Master : Versioned Attachment registerAttachment(Provider provider, Attachment attachment); Transaction registerTransaction(Attachment attachment, Transaction transaction); - // This function is required to compare interfaces based on vtables of them - int same(Versioned first, Versioned second); //// FIXME: Should we really publish this API? - MetadataBuilder getMetadataBuilder(Status status, uint fieldCount); - //// FIXME: Debug getDebug(); int serverMode(int mode); Utl getUtlInterface(); ConfigManager getConfigManager(); diff --git a/src/include/firebird/IdlFbInterfaces.h b/src/include/firebird/IdlFbInterfaces.h index 31c220002a..6560a15a87 100644 --- a/src/include/firebird/IdlFbInterfaces.h +++ b/src/include/firebird/IdlFbInterfaces.h @@ -293,7 +293,6 @@ namespace Firebird IDtc* (CLOOP_CARG *getDtc)(IMaster* self) throw(); IAttachment* (CLOOP_CARG *registerAttachment)(IMaster* self, IProvider* provider, IAttachment* attachment) throw(); ITransaction* (CLOOP_CARG *registerTransaction)(IMaster* self, IAttachment* attachment, ITransaction* transaction) throw(); - int (CLOOP_CARG *same)(IMaster* self, IVersioned* first, IVersioned* second) throw(); IMetadataBuilder* (CLOOP_CARG *getMetadataBuilder)(IMaster* self, IStatus* status, unsigned fieldCount) throw(); int (CLOOP_CARG *serverMode)(IMaster* self, int mode) throw(); IUtl* (CLOOP_CARG *getUtlInterface)(IMaster* self) throw(); @@ -361,12 +360,6 @@ namespace Firebird return ret; } - int same(IVersioned* first, IVersioned* second) - { - int ret = static_cast(this->cloopVTable)->same(this, first, second); - return ret; - } - template IMetadataBuilder* getMetadataBuilder(StatusType* status, unsigned fieldCount) { IMetadataBuilder* ret = static_cast(this->cloopVTable)->getMetadataBuilder(this, status, fieldCount); @@ -4811,7 +4804,6 @@ namespace Firebird this->getDtc = &Name::cloopgetDtcDispatcher; this->registerAttachment = &Name::cloopregisterAttachmentDispatcher; this->registerTransaction = &Name::cloopregisterTransactionDispatcher; - this->same = &Name::cloopsameDispatcher; this->getMetadataBuilder = &Name::cloopgetMetadataBuilderDispatcher; this->serverMode = &Name::cloopserverModeDispatcher; this->getUtlInterface = &Name::cloopgetUtlInterfaceDispatcher; @@ -4926,19 +4918,6 @@ namespace Firebird } } - static int CLOOP_CARG cloopsameDispatcher(IMaster* self, IVersioned* first, IVersioned* second) throw() - { - try - { - return static_cast(self)->Name::same(first, second); - } - catch (...) - { - StatusType::catchException(0); - return static_cast(0); - } - } - static IMetadataBuilder* CLOOP_CARG cloopgetMetadataBuilderDispatcher(IMaster* self, IStatus* status, unsigned fieldCount) throw() { StatusType status2(status); @@ -5015,7 +4994,6 @@ namespace Firebird virtual IDtc* getDtc() = 0; virtual IAttachment* registerAttachment(IProvider* provider, IAttachment* attachment) = 0; virtual ITransaction* registerTransaction(IAttachment* attachment, ITransaction* transaction) = 0; - virtual int same(IVersioned* first, IVersioned* second) = 0; virtual IMetadataBuilder* getMetadataBuilder(StatusType* status, unsigned fieldCount) = 0; virtual int serverMode(int mode) = 0; virtual IUtl* getUtlInterface() = 0; diff --git a/src/jrd/CryptoManager.cpp b/src/jrd/CryptoManager.cpp index 2336665fe5..caa10363bc 100644 --- a/src/jrd/CryptoManager.cpp +++ b/src/jrd/CryptoManager.cpp @@ -660,7 +660,8 @@ namespace Jrd { bool CryptoManager::HolderAttachments::operator==(IKeyHolderPlugin* kh) const { - return MasterInterfacePtr()->same(keyHolder, kh) != 0; + // ASF: I think there should be a better way to do this. + return keyHolder->cloopVTable == kh->cloopVTable; } void CryptoManager::KeyHolderPlugins::attach(Attachment* att, Config* config) diff --git a/src/yvalve/MasterImplementation.cpp b/src/yvalve/MasterImplementation.cpp index c5e45dcfa2..e036d37708 100644 --- a/src/yvalve/MasterImplementation.cpp +++ b/src/yvalve/MasterImplementation.cpp @@ -102,11 +102,6 @@ IPluginManager* MasterImplementation::getPluginManager() return &manager; } -int MasterImplementation::same(IVersioned* first, IVersioned* second) -{ - return first->cloopVTable == second->cloopVTable ? 1 : 0; -} - IMetadataBuilder* MasterImplementation::getMetadataBuilder(CheckStatusWrapper* status, unsigned fieldCount) { try diff --git a/src/yvalve/MasterImplementation.h b/src/yvalve/MasterImplementation.h index 2781a2d948..bd4a5235cb 100644 --- a/src/yvalve/MasterImplementation.h +++ b/src/yvalve/MasterImplementation.h @@ -68,7 +68,6 @@ namespace Why Firebird::ITransaction* registerTransaction(Firebird::IAttachment* attachment, Firebird::ITransaction* transaction); Dtc* getDtc(); - int same(Firebird::IVersioned* first, Firebird::IVersioned* second); Firebird::IMetadataBuilder* getMetadataBuilder(Firebird::CheckStatusWrapper* status, unsigned fieldCount); //Firebird::IDebug* getDebug(); int serverMode(int mode);