본문으로 건너뛰기
로딩중...
검색중...
일치하는것 없음
glsAttributeTableReadGate.h
1#pragma once
2#include "gdk_dll/glsTypes.h"
3
4namespace GDK {
5class glsDataSource;
6
13// Operation lease: Release after the cursor/clone has been closed, including
14// failed and cancelled operations. Does not own or access a source handle.
15class GDK_DLL_API glsAttributeTableReadLease final {
16public:
18 void Release() noexcept;
19private:
20 struct Impl;
21 Impl* impl_;
22 explicit glsAttributeTableReadLease(Impl*) noexcept;
23 ~glsAttributeTableReadLease();
24 glsAttributeTableReadLease(const glsAttributeTableReadLease&) = delete;
25 glsAttributeTableReadLease& operator=(const glsAttributeTableReadLease&) = delete;
26 friend class glsAttributeTableReadGate;
27};
28
45// Coordinates participating readers (including clones) and writers across
46// contexts for the same database. Unknown identities conservatively conflict.
47// This does not replace source ownership, per-source cursor serialization,
48// connection usage registration, or external database locking.
49class GDK_DLL_API glsAttributeTableReadGate final {
50public:
57 // Capture identity on the source owner's thread. The source is not retained.
58 static glsStatus Create(glsDataSource*, glsAttributeTableReadGate**) noexcept;
65 // Same identity metadata contract as glsConnectionIdentityService.
66 static glsStatus CreateFromMetadata(const char*, glsAttributeTableReadGate**) noexcept;
73 // timeoutMs: -1 waits indefinitely, 0 polls, positive values bound the wait.
74 // Ok with a null lease means timeout; Cancelled means closed/suspended.
75 // A pending writer blocks new conflicting readers to prevent starvation.
96 // Only this context's active operations; no UI callback/event-loop dependency.
97 glsStatus Drain(int timeoutMs, bool* drained) noexcept;
101 void Close() noexcept;
105 // Close and release the gate; existing leases keep its state alive.
106 // Like other facade objects, don't Release concurrently with a member call.
107 void Release() noexcept;
108private:
109 struct Impl;
110 Impl* impl_;
111 explicit glsAttributeTableReadGate(Impl*) noexcept;
112 ~glsAttributeTableReadGate();
113 glsAttributeTableReadGate(const glsAttributeTableReadGate&) = delete;
114 glsAttributeTableReadGate& operator=(const glsAttributeTableReadGate&) = delete;
115 glsStatus Enter(bool write, int timeoutMs, glsAttributeTableReadLease**) noexcept;
116};
117} // namespace GDK
void Close() noexcept
게이트를 닫아 대기 및 이후 진입에 Cancelled를 반환합니다.
glsStatus EnterRead(int timeoutMs, glsAttributeTableReadLease **) noexcept
읽기 권한을 얻을 때까지 대기합니다.
static glsStatus Create(glsDataSource *, glsAttributeTableReadGate **) noexcept
데이터 소스가 속한 데이터베이스의 게이트를 생성합니다.
static glsStatus CreateFromMetadata(const char *, glsAttributeTableReadGate **) noexcept
연결 메타데이터 JSON에서 게이트를 생성합니다.
glsStatus SetReadsSuspended(bool) noexcept
이 게이트의 새 읽기 진입을 중지하거나 다시 허용합니다.
glsStatus EnterWrite(int timeoutMs, glsAttributeTableReadLease **) noexcept
충돌하는 읽기·쓰기 권한이 없을 때까지 쓰기 권한을 기다립니다.
glsStatus Drain(int timeoutMs, bool *drained) noexcept
이 게이트가 발급한 권한이 모두 반환될 때까지 대기합니다.
void Release() noexcept
게이트를 닫고 해제합니다.
속성 테이블의 읽기 또는 쓰기 권한을 보유하는 객체입니다.
정의 glsAttributeTableReadGate.h:15
void Release() noexcept
권한을 반환하고 객체를 파괴하여 대기 중인 호출이 진입할 수 있게 합니다.
데이터셋에서 연 벡터 피처 테이블입니다.
정의 glsDataset.h:177
공개 gdk_dll API가 공유하는 값 형식, 결과 코드, 호출 규약입니다.
#define GDK_DLL_API
Windows에서는 SDK 심볼을 내보내거나 가져오고, 그 외 플랫폼에서는 SDK 빌드의 심볼을 공개합니다.
정의 glsExport.h:20
glsGdk SDK의 네이티브 C++ API 이름 공간입니다.
정의 glsAttributeTable.h:5
DLL 경계의 공개 함수가 반환하는 상태입니다.
정의 glsTypes.h:83