YObjects.h (Firebird-3.0.2.32703-0.tar.bz2) | : | YObjects.h (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* | * | |||
*/ | */ | |||
#ifndef YVALVE_Y_OBJECTS_H | #ifndef YVALVE_Y_OBJECTS_H | |||
#define YVALVE_Y_OBJECTS_H | #define YVALVE_Y_OBJECTS_H | |||
#include "firebird.h" | #include "firebird.h" | |||
#include "firebird/Interface.h" | #include "firebird/Interface.h" | |||
#include "gen/iberror.h" | #include "gen/iberror.h" | |||
#include "../common/StatusHolder.h" | #include "../common/StatusHolder.h" | |||
#include "../common/classes/fb_atomic.h" | ||||
#include "../common/classes/alloc.h" | #include "../common/classes/alloc.h" | |||
#include "../common/classes/array.h" | #include "../common/classes/array.h" | |||
#include "../common/MsgMetadata.h" | #include "../common/MsgMetadata.h" | |||
namespace Firebird | namespace Firebird | |||
{ | { | |||
class ClumpletWriter; | class ClumpletWriter; | |||
} | } | |||
namespace Why | namespace Why | |||
skipping to change at line 172 | skipping to change at line 173 | |||
if (dstrFlags & DF_RELEASE) | if (dstrFlags & DF_RELEASE) | |||
{ | { | |||
RefDeb(Firebird::DEB_RLS_YATT, "destroy2"); | RefDeb(Firebird::DEB_RLS_YATT, "destroy2"); | |||
release(); | release(); | |||
} | } | |||
} | } | |||
Firebird::RefPtr<NextInterface> next; | Firebird::RefPtr<NextInterface> next; | |||
}; | }; | |||
template <class YT> | ||||
class AtomicYPtr | ||||
{ | ||||
public: | ||||
AtomicYPtr(YT* v) | ||||
: atmPtr(v) | ||||
{ } | ||||
YT* get() | ||||
{ | ||||
return atmPtr; | ||||
} | ||||
YT* release() | ||||
{ | ||||
YT* v = atmPtr; | ||||
if (v && atmPtr.compareExchange(v, NULL)) | ||||
return v; | ||||
return NULL; | ||||
} | ||||
private: | ||||
Firebird::AtomicPointer<YT> atmPtr; | ||||
}; | ||||
typedef AtomicYPtr<YAttachment> AtomicAttPtr; | ||||
typedef AtomicYPtr<YTransaction> AtomicTraPtr; | ||||
class YEvents FB_FINAL : | class YEvents FB_FINAL : | |||
public YHelper<YEvents, Firebird::IEventsImpl<YEvents, Firebird::CheckSta tusWrapper> > | public YHelper<YEvents, Firebird::IEventsImpl<YEvents, Firebird::CheckSta tusWrapper> > | |||
{ | { | |||
public: | public: | |||
static const ISC_STATUS ERROR_CODE = isc_bad_events_handle; | static const ISC_STATUS ERROR_CODE = isc_bad_events_handle; | |||
YEvents(YAttachment* aAttachment, Firebird::IEvents* aNext, Firebird::IEv entCallback* aCallback); | YEvents(YAttachment* aAttachment, Firebird::IEvents* aNext, Firebird::IEv entCallback* aCallback); | |||
void destroy(unsigned dstrFlags); | void destroy(unsigned dstrFlags); | |||
FB_API_HANDLE& getHandle(); | FB_API_HANDLE& getHandle(); | |||
// IEvents implementation | // IEvents implementation | |||
void cancel(Firebird::CheckStatusWrapper* status); | void cancel(Firebird::CheckStatusWrapper* status); | |||
public: | public: | |||
YAttachment* attachment; | AtomicAttPtr attachment; | |||
Firebird::RefPtr<Firebird::IEventCallback> callback; | Firebird::RefPtr<Firebird::IEventCallback> callback; | |||
private: | private: | |||
Firebird::AtomicCounter destroyed; | Firebird::AtomicCounter destroyed; | |||
}; | }; | |||
class YRequest FB_FINAL : | class YRequest FB_FINAL : | |||
public YHelper<YRequest, Firebird::IRequestImpl<YRequest, Firebird::Check StatusWrapper> > | public YHelper<YRequest, Firebird::IRequestImpl<YRequest, Firebird::Check StatusWrapper> > | |||
{ | { | |||
public: | public: | |||
skipping to change at line 219 | skipping to change at line 248 | |||
unsigned int length, const unsigned char* message); | unsigned int length, const unsigned char* message); | |||
void getInfo(Firebird::CheckStatusWrapper* status, int level, unsigned in t itemsLength, | void getInfo(Firebird::CheckStatusWrapper* status, int level, unsigned in t itemsLength, | |||
const unsigned char* items, unsigned int bufferLength, unsigned c har* buffer); | const unsigned char* items, unsigned int bufferLength, unsigned c har* buffer); | |||
void start(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction, int level); | void start(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction, int level); | |||
void startAndSend(Firebird::CheckStatusWrapper* status, Firebird::ITransa ction* transaction, int level, | void startAndSend(Firebird::CheckStatusWrapper* status, Firebird::ITransa ction* transaction, int level, | |||
unsigned int msgType, unsigned int length, const unsigned char* m essage); | unsigned int msgType, unsigned int length, const unsigned char* m essage); | |||
void unwind(Firebird::CheckStatusWrapper* status, int level); | void unwind(Firebird::CheckStatusWrapper* status, int level); | |||
void free(Firebird::CheckStatusWrapper* status); | void free(Firebird::CheckStatusWrapper* status); | |||
public: | public: | |||
YAttachment* attachment; | AtomicAttPtr attachment; | |||
FB_API_HANDLE* userHandle; | FB_API_HANDLE* userHandle; | |||
}; | }; | |||
class YTransaction FB_FINAL : | class YTransaction FB_FINAL : | |||
public YHelper<YTransaction, Firebird::ITransactionImpl<YTransaction, Fir ebird::CheckStatusWrapper> > | public YHelper<YTransaction, Firebird::ITransactionImpl<YTransaction, Fir ebird::CheckStatusWrapper> > | |||
{ | { | |||
public: | public: | |||
static const ISC_STATUS ERROR_CODE = isc_bad_trans_handle; | static const ISC_STATUS ERROR_CODE = isc_bad_trans_handle; | |||
YTransaction(YAttachment* aAttachment, Firebird::ITransaction* aNext); | YTransaction(YAttachment* aAttachment, Firebird::ITransaction* aNext); | |||
skipping to change at line 252 | skipping to change at line 281 | |||
void rollbackRetaining(Firebird::CheckStatusWrapper* status); | void rollbackRetaining(Firebird::CheckStatusWrapper* status); | |||
void disconnect(Firebird::CheckStatusWrapper* status); | void disconnect(Firebird::CheckStatusWrapper* status); | |||
Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebi rd::ITransaction* transaction); | Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebi rd::ITransaction* transaction); | |||
Firebird::ITransaction* validate(Firebird::CheckStatusWrapper* status, Fi rebird::IAttachment* testAtt); | Firebird::ITransaction* validate(Firebird::CheckStatusWrapper* status, Fi rebird::IAttachment* testAtt); | |||
YTransaction* enterDtc(Firebird::CheckStatusWrapper* status); | YTransaction* enterDtc(Firebird::CheckStatusWrapper* status); | |||
void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallb ack* callback); | void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallb ack* callback); | |||
void selfCheck(); | void selfCheck(); | |||
public: | public: | |||
YAttachment* attachment; | AtomicAttPtr attachment; | |||
HandleArray<YBlob> childBlobs; | HandleArray<YBlob> childBlobs; | |||
HandleArray<YResultSet> childCursors; | HandleArray<YResultSet> childCursors; | |||
Firebird::Array<CleanupCallback*> cleanupHandlers; | Firebird::Array<CleanupCallback*> cleanupHandlers; | |||
private: | private: | |||
YTransaction(YTransaction* from) | YTransaction(YTransaction* from) | |||
: YHelper(from->next), | : YHelper(from->next), | |||
attachment(from->attachment), | attachment(from->attachment.get()), | |||
childBlobs(getPool()), | childBlobs(getPool()), | |||
childCursors(getPool()), | childCursors(getPool()), | |||
cleanupHandlers(getPool()) | cleanupHandlers(getPool()) | |||
{ | { | |||
childBlobs.assign(from->childBlobs); | childBlobs.assign(from->childBlobs); | |||
from->childBlobs.clear(); | from->childBlobs.clear(); | |||
childCursors.assign(from->childCursors); | childCursors.assign(from->childCursors); | |||
from->childCursors.clear(); | from->childCursors.clear(); | |||
cleanupHandlers.assign(from->cleanupHandlers); | cleanupHandlers.assign(from->cleanupHandlers); | |||
from->cleanupHandlers.clear(); | from->cleanupHandlers.clear(); | |||
} | } | |||
}; | }; | |||
typedef Firebird::RefPtr<Firebird::ITransaction> NextTransaction; | typedef Firebird::RefPtr<Firebird::ITransaction> NextTransaction; | |||
class YBlob FB_FINAL : public YHelper<YBlob, Firebird::IBlobImpl<YBlob, Firebird | class YBlob FB_FINAL : | |||
::CheckStatusWrapper> > | public YHelper<YBlob, Firebird::IBlobImpl<YBlob, Firebird::CheckStatusWra | |||
pper> > | ||||
{ | { | |||
public: | public: | |||
static const ISC_STATUS ERROR_CODE = isc_bad_segstr_handle; | static const ISC_STATUS ERROR_CODE = isc_bad_segstr_handle; | |||
YBlob(YAttachment* aAttachment, YTransaction* aTransaction, Firebird::IBl ob* aNext); | YBlob(YAttachment* aAttachment, YTransaction* aTransaction, Firebird::IBl ob* aNext); | |||
void destroy(unsigned dstrFlags); | void destroy(unsigned dstrFlags); | |||
FB_API_HANDLE& getHandle(); | FB_API_HANDLE& getHandle(); | |||
// IBlob implementation | // IBlob implementation | |||
void getInfo(Firebird::CheckStatusWrapper* status, unsigned int itemsLeng th, | void getInfo(Firebird::CheckStatusWrapper* status, unsigned int itemsLeng th, | |||
const unsigned char* items, unsigned int bufferLength, unsigned c har* buffer); | const unsigned char* items, unsigned int bufferLength, unsigned c har* buffer); | |||
int getSegment(Firebird::CheckStatusWrapper* status, unsigned int length, void* buffer, | int getSegment(Firebird::CheckStatusWrapper* status, unsigned int length, void* buffer, | |||
unsigned int* segmentLength); | unsigned int* segmentLength); | |||
void putSegment(Firebird::CheckStatusWrapper* status, unsigned int length , const void* buffer); | void putSegment(Firebird::CheckStatusWrapper* status, unsigned int length , const void* buffer); | |||
void cancel(Firebird::CheckStatusWrapper* status); | void cancel(Firebird::CheckStatusWrapper* status); | |||
void close(Firebird::CheckStatusWrapper* status); | void close(Firebird::CheckStatusWrapper* status); | |||
int seek(Firebird::CheckStatusWrapper* status, int mode, int offset); | int seek(Firebird::CheckStatusWrapper* status, int mode, int offset); | |||
public: | public: | |||
YAttachment* attachment; | AtomicAttPtr attachment; | |||
YTransaction* transaction; | AtomicTraPtr transaction; | |||
}; | }; | |||
class YResultSet FB_FINAL : | class YResultSet FB_FINAL : | |||
public YHelper<YResultSet, Firebird::IResultSetImpl<YResultSet, Firebird: :CheckStatusWrapper> > | public YHelper<YResultSet, Firebird::IResultSetImpl<YResultSet, Firebird: :CheckStatusWrapper> > | |||
{ | { | |||
public: | public: | |||
static const ISC_STATUS ERROR_CODE = isc_bad_result_set; | static const ISC_STATUS ERROR_CODE = isc_bad_result_set; | |||
YResultSet(YAttachment* anAttachment, YTransaction* aTransaction, Firebir d::IResultSet* aNext); | YResultSet(YAttachment* anAttachment, YTransaction* aTransaction, Firebir d::IResultSet* aNext); | |||
YResultSet(YAttachment* anAttachment, YTransaction* aTransaction, YStatem ent* aStatement, | YResultSet(YAttachment* anAttachment, YTransaction* aTransaction, YStatem ent* aStatement, | |||
skipping to change at line 327 | skipping to change at line 357 | |||
int fetchLast(Firebird::CheckStatusWrapper* status, void* message); | int fetchLast(Firebird::CheckStatusWrapper* status, void* message); | |||
int fetchAbsolute(Firebird::CheckStatusWrapper* status, int position, voi d* message); | int fetchAbsolute(Firebird::CheckStatusWrapper* status, int position, voi d* message); | |||
int fetchRelative(Firebird::CheckStatusWrapper* status, int offset, void* message); | int fetchRelative(Firebird::CheckStatusWrapper* status, int offset, void* message); | |||
FB_BOOLEAN isEof(Firebird::CheckStatusWrapper* status); | FB_BOOLEAN isEof(Firebird::CheckStatusWrapper* status); | |||
FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status); | FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status); | |||
Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* sta tus); | Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* sta tus); | |||
void close(Firebird::CheckStatusWrapper* status); | void close(Firebird::CheckStatusWrapper* status); | |||
void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebir d::IMessageMetadata* format); | void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebir d::IMessageMetadata* format); | |||
public: | public: | |||
YAttachment* attachment; | AtomicAttPtr attachment; | |||
YTransaction* transaction; | AtomicTraPtr transaction; | |||
YStatement* statement; | YStatement* statement; | |||
}; | }; | |||
class YMetadata | class YMetadata | |||
{ | { | |||
public: | public: | |||
explicit YMetadata(bool in) | explicit YMetadata(bool in) | |||
: flag(false), input(in) | : flag(false), input(in) | |||
{ } | { } | |||
skipping to change at line 377 | skipping to change at line 407 | |||
Firebird::IMessageMetadata* inMetadata, void* inBuffer, | Firebird::IMessageMetadata* inMetadata, void* inBuffer, | |||
Firebird::IMessageMetadata* outMetadata, void* outBuffer); | Firebird::IMessageMetadata* outMetadata, void* outBuffer); | |||
Firebird::IResultSet* openCursor(Firebird::CheckStatusWrapper* status, Fi rebird::ITransaction* transaction, | Firebird::IResultSet* openCursor(Firebird::CheckStatusWrapper* status, Fi rebird::ITransaction* transaction, | |||
Firebird::IMessageMetadata* inMetadata, void* inBuffer, Firebird: :IMessageMetadata* outMetadata, | Firebird::IMessageMetadata* inMetadata, void* inBuffer, Firebird: :IMessageMetadata* outMetadata, | |||
unsigned int flags); | unsigned int flags); | |||
void setCursorName(Firebird::CheckStatusWrapper* status, const char* name ); | void setCursorName(Firebird::CheckStatusWrapper* status, const char* name ); | |||
void free(Firebird::CheckStatusWrapper* status); | void free(Firebird::CheckStatusWrapper* status); | |||
unsigned getFlags(Firebird::CheckStatusWrapper* status); | unsigned getFlags(Firebird::CheckStatusWrapper* status); | |||
public: | public: | |||
AtomicAttPtr attachment; | ||||
Firebird::Mutex statementMutex; | Firebird::Mutex statementMutex; | |||
YAttachment* attachment; | ||||
YResultSet* cursor; | YResultSet* cursor; | |||
Firebird::IMessageMetadata* getMetadata(bool in, Firebird::IStatement* ne xt); | Firebird::IMessageMetadata* getMetadata(bool in, Firebird::IStatement* ne xt); | |||
private: | private: | |||
YMetadata input, output; | YMetadata input, output; | |||
}; | }; | |||
class EnterCount | class EnterCount | |||
{ | { | |||
End of changes. 11 change blocks. | ||||
11 lines changed or deleted | 41 lines changed or added |