mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
Generated files
This commit is contained in:
parent
4c73f35ddf
commit
93a8c44416
115
extern/cloop/src/tests/test1/CalcCppApi.h
vendored
115
extern/cloop/src/tests/test1/CalcCppApi.h
vendored
@ -7,6 +7,23 @@
|
|||||||
#define CLOOP_CARG
|
#define CLOOP_CARG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CLOOP_NOEXCEPT
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
#define CLOOP_NOEXCEPT noexcept
|
||||||
|
#else
|
||||||
|
#define CLOOP_NOEXCEPT throw()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef CLOOP_CONSTEXPR
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
#define CLOOP_CONSTEXPR constexpr
|
||||||
|
#else
|
||||||
|
#define CLOOP_CONSTEXPR const
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace calc
|
namespace calc
|
||||||
{
|
{
|
||||||
@ -34,6 +51,8 @@ namespace calc
|
|||||||
|
|
||||||
// Interfaces declarations
|
// Interfaces declarations
|
||||||
|
|
||||||
|
#define CALC_IDISPOSABLE_VERSION 1u
|
||||||
|
|
||||||
class IDisposable
|
class IDisposable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -41,7 +60,7 @@ namespace calc
|
|||||||
{
|
{
|
||||||
void* cloopDummy[1];
|
void* cloopDummy[1];
|
||||||
uintptr_t version;
|
uintptr_t version;
|
||||||
void (CLOOP_CARG *dispose)(IDisposable* self) throw();
|
void (CLOOP_CARG *dispose)(IDisposable* self) CLOOP_NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
void* cloopDummy[1];
|
void* cloopDummy[1];
|
||||||
@ -57,7 +76,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned VERSION = 1;
|
static CLOOP_CONSTEXPR unsigned VERSION = CALC_IDISPOSABLE_VERSION;
|
||||||
|
|
||||||
void dispose()
|
void dispose()
|
||||||
{
|
{
|
||||||
@ -65,13 +84,15 @@ namespace calc
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CALC_ISTATUS_VERSION 2u
|
||||||
|
|
||||||
class IStatus : public IDisposable
|
class IStatus : public IDisposable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct VTable : public IDisposable::VTable
|
struct VTable : public IDisposable::VTable
|
||||||
{
|
{
|
||||||
int (CLOOP_CARG *getCode)(const IStatus* self) throw();
|
int (CLOOP_CARG *getCode)(const IStatus* self) CLOOP_NOEXCEPT;
|
||||||
void (CLOOP_CARG *setCode)(IStatus* self, int code) throw();
|
void (CLOOP_CARG *setCode)(IStatus* self, int code) CLOOP_NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -85,11 +106,11 @@ namespace calc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned VERSION = 2;
|
static CLOOP_CONSTEXPR unsigned VERSION = CALC_ISTATUS_VERSION;
|
||||||
|
|
||||||
static const int ERROR_1 = 1;
|
static CLOOP_CONSTEXPR int ERROR_1 = 1;
|
||||||
static const int ERROR_2 = 0x2;
|
static CLOOP_CONSTEXPR int ERROR_2 = 0x2;
|
||||||
static const int ERROR_12 = IStatus::ERROR_1 | IStatus::ERROR_2;
|
static CLOOP_CONSTEXPR int ERROR_12 = IStatus::ERROR_1 | IStatus::ERROR_2;
|
||||||
|
|
||||||
int getCode() const
|
int getCode() const
|
||||||
{
|
{
|
||||||
@ -103,15 +124,17 @@ namespace calc
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CALC_IFACTORY_VERSION 2u
|
||||||
|
|
||||||
class IFactory : public IDisposable
|
class IFactory : public IDisposable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct VTable : public IDisposable::VTable
|
struct VTable : public IDisposable::VTable
|
||||||
{
|
{
|
||||||
IStatus* (CLOOP_CARG *createStatus)(IFactory* self) throw();
|
IStatus* (CLOOP_CARG *createStatus)(IFactory* self) CLOOP_NOEXCEPT;
|
||||||
ICalculator* (CLOOP_CARG *createCalculator)(IFactory* self, IStatus* status) throw();
|
ICalculator* (CLOOP_CARG *createCalculator)(IFactory* self, IStatus* status) CLOOP_NOEXCEPT;
|
||||||
ICalculator2* (CLOOP_CARG *createCalculator2)(IFactory* self, IStatus* status) throw();
|
ICalculator2* (CLOOP_CARG *createCalculator2)(IFactory* self, IStatus* status) CLOOP_NOEXCEPT;
|
||||||
ICalculator* (CLOOP_CARG *createBrokenCalculator)(IFactory* self, IStatus* status) throw();
|
ICalculator* (CLOOP_CARG *createBrokenCalculator)(IFactory* self, IStatus* status) CLOOP_NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -125,7 +148,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned VERSION = 2;
|
static CLOOP_CONSTEXPR unsigned VERSION = CALC_IFACTORY_VERSION;
|
||||||
|
|
||||||
IStatus* createStatus()
|
IStatus* createStatus()
|
||||||
{
|
{
|
||||||
@ -158,15 +181,17 @@ namespace calc
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CALC_ICALCULATOR_VERSION 4u
|
||||||
|
|
||||||
class ICalculator : public IDisposable
|
class ICalculator : public IDisposable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct VTable : public IDisposable::VTable
|
struct VTable : public IDisposable::VTable
|
||||||
{
|
{
|
||||||
int (CLOOP_CARG *sum)(const ICalculator* self, IStatus* status, int n1, int n2) throw();
|
int (CLOOP_CARG *sum)(const ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT;
|
||||||
int (CLOOP_CARG *getMemory)(const ICalculator* self) throw();
|
int (CLOOP_CARG *getMemory)(const ICalculator* self) CLOOP_NOEXCEPT;
|
||||||
void (CLOOP_CARG *setMemory)(ICalculator* self, int n) throw();
|
void (CLOOP_CARG *setMemory)(ICalculator* self, int n) CLOOP_NOEXCEPT;
|
||||||
void (CLOOP_CARG *sumAndStore)(ICalculator* self, IStatus* status, int n1, int n2) throw();
|
void (CLOOP_CARG *sumAndStore)(ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -180,7 +205,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned VERSION = 4;
|
static CLOOP_CONSTEXPR unsigned VERSION = CALC_ICALCULATOR_VERSION;
|
||||||
|
|
||||||
template <typename StatusType> int sum(StatusType* status, int n1, int n2) const
|
template <typename StatusType> int sum(StatusType* status, int n1, int n2) const
|
||||||
{
|
{
|
||||||
@ -223,14 +248,16 @@ namespace calc
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CALC_ICALCULATOR2_VERSION 6u
|
||||||
|
|
||||||
class ICalculator2 : public ICalculator
|
class ICalculator2 : public ICalculator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct VTable : public ICalculator::VTable
|
struct VTable : public ICalculator::VTable
|
||||||
{
|
{
|
||||||
int (CLOOP_CARG *multiply)(const ICalculator2* self, IStatus* status, int n1, int n2) throw();
|
int (CLOOP_CARG *multiply)(const ICalculator2* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT;
|
||||||
void (CLOOP_CARG *copyMemory)(ICalculator2* self, const ICalculator* calculator) throw();
|
void (CLOOP_CARG *copyMemory)(ICalculator2* self, const ICalculator* calculator) CLOOP_NOEXCEPT;
|
||||||
void (CLOOP_CARG *copyMemory2)(ICalculator2* self, const int* address) throw();
|
void (CLOOP_CARG *copyMemory2)(ICalculator2* self, const int* address) CLOOP_NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -244,7 +271,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const unsigned VERSION = 6;
|
static CLOOP_CONSTEXPR unsigned VERSION = CALC_ICALCULATOR2_VERSION;
|
||||||
|
|
||||||
template <typename StatusType> int multiply(StatusType* status, int n1, int n2) const
|
template <typename StatusType> int multiply(StatusType* status, int n1, int n2) const
|
||||||
{
|
{
|
||||||
@ -291,7 +318,7 @@ namespace calc
|
|||||||
this->cloopVTable = &vTable;
|
this->cloopVTable = &vTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw()
|
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -342,7 +369,7 @@ namespace calc
|
|||||||
this->cloopVTable = &vTable;
|
this->cloopVTable = &vTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopgetCodeDispatcher(const IStatus* self) throw()
|
static int CLOOP_CARG cloopgetCodeDispatcher(const IStatus* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -355,7 +382,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopsetCodeDispatcher(IStatus* self, int code) throw()
|
static void CLOOP_CARG cloopsetCodeDispatcher(IStatus* self, int code) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -367,7 +394,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw()
|
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -421,7 +448,7 @@ namespace calc
|
|||||||
this->cloopVTable = &vTable;
|
this->cloopVTable = &vTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IStatus* CLOOP_CARG cloopcreateStatusDispatcher(IFactory* self) throw()
|
static IStatus* CLOOP_CARG cloopcreateStatusDispatcher(IFactory* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -434,7 +461,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ICalculator* CLOOP_CARG cloopcreateCalculatorDispatcher(IFactory* self, IStatus* status) throw()
|
static ICalculator* CLOOP_CARG cloopcreateCalculatorDispatcher(IFactory* self, IStatus* status) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -449,7 +476,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ICalculator2* CLOOP_CARG cloopcreateCalculator2Dispatcher(IFactory* self, IStatus* status) throw()
|
static ICalculator2* CLOOP_CARG cloopcreateCalculator2Dispatcher(IFactory* self, IStatus* status) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -464,7 +491,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ICalculator* CLOOP_CARG cloopcreateBrokenCalculatorDispatcher(IFactory* self, IStatus* status) throw()
|
static ICalculator* CLOOP_CARG cloopcreateBrokenCalculatorDispatcher(IFactory* self, IStatus* status) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -479,7 +506,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw()
|
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -535,7 +562,7 @@ namespace calc
|
|||||||
this->cloopVTable = &vTable;
|
this->cloopVTable = &vTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopsumDispatcher(const ICalculator* self, IStatus* status, int n1, int n2) throw()
|
static int CLOOP_CARG cloopsumDispatcher(const ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -550,7 +577,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopgetMemoryDispatcher(const ICalculator* self) throw()
|
static int CLOOP_CARG cloopgetMemoryDispatcher(const ICalculator* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -563,7 +590,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopsetMemoryDispatcher(ICalculator* self, int n) throw()
|
static void CLOOP_CARG cloopsetMemoryDispatcher(ICalculator* self, int n) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -575,7 +602,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopsumAndStoreDispatcher(ICalculator* self, IStatus* status, int n1, int n2) throw()
|
static void CLOOP_CARG cloopsumAndStoreDispatcher(ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -589,7 +616,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw()
|
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -648,7 +675,7 @@ namespace calc
|
|||||||
this->cloopVTable = &vTable;
|
this->cloopVTable = &vTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopmultiplyDispatcher(const ICalculator2* self, IStatus* status, int n1, int n2) throw()
|
static int CLOOP_CARG cloopmultiplyDispatcher(const ICalculator2* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -663,7 +690,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopcopyMemoryDispatcher(ICalculator2* self, const ICalculator* calculator) throw()
|
static void CLOOP_CARG cloopcopyMemoryDispatcher(ICalculator2* self, const ICalculator* calculator) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -675,7 +702,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopcopyMemory2Dispatcher(ICalculator2* self, const int* address) throw()
|
static void CLOOP_CARG cloopcopyMemory2Dispatcher(ICalculator2* self, const int* address) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -687,7 +714,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopsumDispatcher(const ICalculator* self, IStatus* status, int n1, int n2) throw()
|
static int CLOOP_CARG cloopsumDispatcher(const ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -702,7 +729,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLOOP_CARG cloopgetMemoryDispatcher(const ICalculator* self) throw()
|
static int CLOOP_CARG cloopgetMemoryDispatcher(const ICalculator* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -715,7 +742,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopsetMemoryDispatcher(ICalculator* self, int n) throw()
|
static void CLOOP_CARG cloopsetMemoryDispatcher(ICalculator* self, int n) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -727,7 +754,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopsumAndStoreDispatcher(ICalculator* self, IStatus* status, int n1, int n2) throw()
|
static void CLOOP_CARG cloopsumAndStoreDispatcher(ICalculator* self, IStatus* status, int n1, int n2) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
StatusType status2(status);
|
StatusType status2(status);
|
||||||
|
|
||||||
@ -741,7 +768,7 @@ namespace calc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw()
|
static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) CLOOP_NOEXCEPT
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
10
extern/cloop/src/tests/test1/CalcPascalApi.pas
vendored
10
extern/cloop/src/tests/test1/CalcPascalApi.pas
vendored
@ -299,6 +299,7 @@ end;
|
|||||||
|
|
||||||
function StatusImpl_getCodeDispatcher(this: Status): Integer; cdecl;
|
function StatusImpl_getCodeDispatcher(this: Status): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := StatusImpl(this).getCode();
|
Result := StatusImpl(this).getCode();
|
||||||
except
|
except
|
||||||
@ -334,6 +335,7 @@ end;
|
|||||||
|
|
||||||
function FactoryImpl_createStatusDispatcher(this: Factory): Status; cdecl;
|
function FactoryImpl_createStatusDispatcher(this: Factory): Status; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
try
|
try
|
||||||
Result := FactoryImpl(this).createStatus();
|
Result := FactoryImpl(this).createStatus();
|
||||||
except
|
except
|
||||||
@ -343,6 +345,7 @@ end;
|
|||||||
|
|
||||||
function FactoryImpl_createCalculatorDispatcher(this: Factory; status: Status): Calculator; cdecl;
|
function FactoryImpl_createCalculatorDispatcher(this: Factory; status: Status): Calculator; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
try
|
try
|
||||||
Result := FactoryImpl(this).createCalculator(status);
|
Result := FactoryImpl(this).createCalculator(status);
|
||||||
except
|
except
|
||||||
@ -352,6 +355,7 @@ end;
|
|||||||
|
|
||||||
function FactoryImpl_createCalculator2Dispatcher(this: Factory; status: Status): Calculator2; cdecl;
|
function FactoryImpl_createCalculator2Dispatcher(this: Factory; status: Status): Calculator2; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
try
|
try
|
||||||
Result := FactoryImpl(this).createCalculator2(status);
|
Result := FactoryImpl(this).createCalculator2(status);
|
||||||
except
|
except
|
||||||
@ -361,6 +365,7 @@ end;
|
|||||||
|
|
||||||
function FactoryImpl_createBrokenCalculatorDispatcher(this: Factory; status: Status): Calculator; cdecl;
|
function FactoryImpl_createBrokenCalculatorDispatcher(this: Factory; status: Status): Calculator; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
try
|
try
|
||||||
Result := FactoryImpl(this).createBrokenCalculator(status);
|
Result := FactoryImpl(this).createBrokenCalculator(status);
|
||||||
except
|
except
|
||||||
@ -387,6 +392,7 @@ end;
|
|||||||
|
|
||||||
function CalculatorImpl_sumDispatcher(this: Calculator; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
function CalculatorImpl_sumDispatcher(this: Calculator; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := CalculatorImpl(this).sum(status, n1, n2);
|
Result := CalculatorImpl(this).sum(status, n1, n2);
|
||||||
except
|
except
|
||||||
@ -396,6 +402,7 @@ end;
|
|||||||
|
|
||||||
function CalculatorImpl_getMemoryDispatcher(this: Calculator): Integer; cdecl;
|
function CalculatorImpl_getMemoryDispatcher(this: Calculator): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := CalculatorImpl(this).getMemory();
|
Result := CalculatorImpl(this).getMemory();
|
||||||
except
|
except
|
||||||
@ -440,6 +447,7 @@ end;
|
|||||||
|
|
||||||
function Calculator2Impl_sumDispatcher(this: Calculator2; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
function Calculator2Impl_sumDispatcher(this: Calculator2; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := Calculator2Impl(this).sum(status, n1, n2);
|
Result := Calculator2Impl(this).sum(status, n1, n2);
|
||||||
except
|
except
|
||||||
@ -449,6 +457,7 @@ end;
|
|||||||
|
|
||||||
function Calculator2Impl_getMemoryDispatcher(this: Calculator2): Integer; cdecl;
|
function Calculator2Impl_getMemoryDispatcher(this: Calculator2): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := Calculator2Impl(this).getMemory();
|
Result := Calculator2Impl(this).getMemory();
|
||||||
except
|
except
|
||||||
@ -476,6 +485,7 @@ end;
|
|||||||
|
|
||||||
function Calculator2Impl_multiplyDispatcher(this: Calculator2; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
function Calculator2Impl_multiplyDispatcher(this: Calculator2; status: Status; n1: Integer; n2: Integer): Integer; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Result := 0;
|
||||||
try
|
try
|
||||||
Result := Calculator2Impl(this).multiply(status, n1, n2);
|
Result := Calculator2Impl(this).multiply(status, n1, n2);
|
||||||
except
|
except
|
||||||
|
@ -823,12 +823,17 @@ namespace Jrd {
|
|||||||
|
|
||||||
void CryptoManager::blockingAstChangeCryptState()
|
void CryptoManager::blockingAstChangeCryptState()
|
||||||
{
|
{
|
||||||
AsyncContextHolder tdbb(&dbb, FB_FUNCTION);
|
try
|
||||||
|
|
||||||
if (stateLock->lck_physical != CRYPT_CHANGE && stateLock->lck_physical != CRYPT_INIT)
|
|
||||||
{
|
{
|
||||||
sync.ast(tdbb);
|
AsyncContextHolder tdbb(&dbb, FB_FUNCTION);
|
||||||
|
|
||||||
|
if (stateLock->lck_physical != CRYPT_CHANGE && stateLock->lck_physical != CRYPT_INIT)
|
||||||
|
{
|
||||||
|
sync.ast(tdbb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (const Exception&)
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CryptoManager::doOnAst(thread_db* tdbb)
|
void CryptoManager::doOnAst(thread_db* tdbb)
|
||||||
|
@ -705,28 +705,33 @@ int TipCache::tpc_block_blocking_ast(void* arg)
|
|||||||
{
|
{
|
||||||
StatusBlockData* data = static_cast<StatusBlockData*>(arg);
|
StatusBlockData* data = static_cast<StatusBlockData*>(arg);
|
||||||
|
|
||||||
Database* dbb = data->existenceLock.lck_dbb;
|
try
|
||||||
AsyncContextHolder tdbb(dbb, FB_FUNCTION);
|
|
||||||
|
|
||||||
// Should we try to process AST?
|
|
||||||
if (!data->acceptAst)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
TipCache* cache = data->cache;
|
|
||||||
TraNumber oldest =
|
|
||||||
cache->m_tpcHeader->getHeader()->oldest_transaction.load(std::memory_order_relaxed);
|
|
||||||
|
|
||||||
// Is data block really old?
|
|
||||||
if (data->blockNumber >= oldest / cache->m_transactionsPerBlock)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Release shared memory
|
|
||||||
if (data->memory)
|
|
||||||
{
|
{
|
||||||
delete data->memory;
|
Database* dbb = data->existenceLock.lck_dbb;
|
||||||
data->memory = NULL;
|
AsyncContextHolder tdbb(dbb, FB_FUNCTION);
|
||||||
|
|
||||||
|
// Should we try to process AST?
|
||||||
|
if (!data->acceptAst)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
TipCache* cache = data->cache;
|
||||||
|
TraNumber oldest =
|
||||||
|
cache->m_tpcHeader->getHeader()->oldest_transaction.load(std::memory_order_relaxed);
|
||||||
|
|
||||||
|
// Is data block really old?
|
||||||
|
if (data->blockNumber >= oldest / cache->m_transactionsPerBlock)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Release shared memory
|
||||||
|
if (data->memory)
|
||||||
|
{
|
||||||
|
delete data->memory;
|
||||||
|
data->memory = NULL;
|
||||||
|
}
|
||||||
|
LCK_release(tdbb, &data->existenceLock);
|
||||||
}
|
}
|
||||||
LCK_release(tdbb, &data->existenceLock);
|
catch (const Exception&)
|
||||||
|
{ }
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1398,7 +1398,19 @@ void LockManager::blocking_action(thread_db* tdbb, SRQ_PTR blocking_owner_offset
|
|||||||
{ // checkout scope
|
{ // checkout scope
|
||||||
LockTableCheckout checkout(this, FB_FUNCTION);
|
LockTableCheckout checkout(this, FB_FUNCTION);
|
||||||
EngineCheckout cout(tdbb, FB_FUNCTION, EngineCheckout::UNNECESSARY);
|
EngineCheckout cout(tdbb, FB_FUNCTION, EngineCheckout::UNNECESSARY);
|
||||||
(*routine)(arg);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
(*routine)(arg);
|
||||||
|
}
|
||||||
|
catch (const Exception& ex)
|
||||||
|
{
|
||||||
|
iscLogException("Exception from AST routine - this should never happen", ex);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
gds__log("Unknown C++ exception from AST routine - this should never happen");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
owner = (own*) SRQ_ABS_PTR(blocking_owner_offset);
|
owner = (own*) SRQ_ABS_PTR(blocking_owner_offset);
|
||||||
|
Loading…
Reference in New Issue
Block a user