본문으로 건너뛰기
로딩중...
검색중...
일치하는것 없음
glsConnectionIdentityService.h
1#pragma once
2#include "gdk_dll/glsTypes.h"
3namespace GDK {
4class glsDataSource;
7enum class glsIdentityComparison : int32_t {
8 Unknown = 0,
9 Same = 1,
11};
12
14enum class glsIdentityScope : int32_t {
16 Schema = 1,
17 Table = 2
18};
19// Immutable captured identity. Missing/inaccessible file and endpoint aliases
20// are Unknown. Re-capture before mutations: the captured identity does not lock
21// the underlying file.
28class GDK_DLL_API glsConnectionIdentity final {
29public:
32 bool IsResolved() const noexcept;
37 glsIdentityComparison Compare(const glsConnectionIdentity *other,
38 glsIdentityScope scope) const noexcept;
40 void Release() noexcept;
41
42private:
43 glsConnectionIdentity(const glsConnectionIdentity&) = delete;
44 glsConnectionIdentity& operator=(const glsConnectionIdentity&) = delete;
45 struct Impl;
46 Impl *impl_;
47 explicit glsConnectionIdentity(Impl *) noexcept;
48 ~glsConnectionIdentity();
49 friend class glsConnectionIdentityService;
50 friend class glsConnectionUsageRegistry;
51};
52
57public:
67 static glsStatus FromUri(const char *provider, const char *uri,
68 const char *schema, const char *table,
69 glsConnectionIdentity **out) noexcept;
70 // JSON metadata: provider,path,host,socket,port,database,schema,table. No
71 // credentials.
78 static glsStatus FromMetadata(const char *metadataJson,
79 glsConnectionIdentity **out) noexcept;
85 glsConnectionIdentity **out) noexcept;
86};
87// A lease covers both deferred work and visible UI lifetime. Release it only after
88// all owned readers have stopped. Mutation acquisition rejects new overlapping
89// registrations until its lease is released; it does not lock external processes.
94class GDK_DLL_API glsConnectionUsageLease final {
95public:
97 void Release() noexcept;
98private:
99 explicit glsConnectionUsageLease(uint64_t id) noexcept : id_(id) {}
102 glsConnectionUsageLease& operator=(const glsConnectionUsageLease&) = delete;
103 uint64_t id_;
104 friend class glsConnectionUsageRegistry;
105};
106
111public:
131 static glsStatus CanMutate(const glsConnectionIdentity* identity, glsIdentityScope scope, bool* out) noexcept;
132private:
133 static glsStatus Acquire(const glsConnectionIdentity*, glsIdentityScope, bool, glsConnectionUsageLease**) noexcept;
134};
135} // namespace GDK
연결 URI, 메타데이터 또는 열린 소스의 식별자를 캡처합니다.
정의 glsConnectionIdentityService.h:56
static glsStatus FromUri(const char *provider, const char *uri, const char *schema, const char *table, glsConnectionIdentity **out) noexcept
연결 URI에서 테이블 식별자를 캡처합니다.
static glsStatus FromDataSource(glsDataSource *source, glsConnectionIdentity **out) noexcept
열린 데이터 소스의 메타데이터에서 식별자를 캡처합니다.
static glsStatus FromMetadata(const char *metadataJson, glsConnectionIdentity **out) noexcept
데이터 소스 메타데이터의 JSON에서 식별자를 캡처합니다.
두 연결이 같은 데이터를 가리키는지 판별할 데이터베이스, 스키마 및 테이블 식별자입니다.
정의 glsConnectionIdentityService.h:28
glsIdentityComparison Compare(const glsConnectionIdentity *other, glsIdentityScope scope) const noexcept
지정한 범위에서 다른 연결 식별자와 비교합니다.
bool IsResolved() const noexcept
식별자가 특정 데이터베이스를 가리키는지 확인합니다.
void Release() noexcept
식별자를 해제합니다. 해제한 객체를 다시 사용하면 안 됩니다.
연결 사용 또는 변경을 등록하는 임대입니다.
정의 glsConnectionIdentityService.h:94
void Release() noexcept
등록을 제거하고 임대를 해제합니다. 이후 객체를 사용하면 안 됩니다.
사용 중인 연결과 겹치는 데이터 변경을 막는 프로세스 단위 레지스트리입니다.
정의 glsConnectionIdentityService.h:110
static glsStatus CanMutate(const glsConnectionIdentity *identity, glsIdentityScope scope, bool *out) noexcept
지금 변경 임대를 얻을 수 있는지 조회합니다.
static glsStatus AcquireMutation(const glsConnectionIdentity *identity, glsIdentityScope scope, glsConnectionUsageLease **out) noexcept
해제될 때까지 겹치는 신규 임대를 차단하는 변경 임대를 얻습니다.
static glsStatus Register(const glsConnectionIdentity *identity, glsIdentityScope scope, glsConnectionUsageLease **out) noexcept
연결 식별자가 가리키는 데이터의 사용을 등록합니다.
데이터셋에서 연 벡터 피처 테이블입니다.
정의 glsDataset.h:177
공개 gdk_dll API가 공유하는 값 형식, 결과 코드, 호출 규약입니다.
#define GDK_DLL_API
Windows에서는 SDK 심볼을 내보내거나 가져오고, 그 외 플랫폼에서는 SDK 빌드의 심볼을 공개합니다.
정의 glsExport.h:20
glsIdentityScope
연결 식별자 및 사용 레지스트리에서 비교할 범위입니다.
정의 glsConnectionIdentityService.h:14
glsIdentityComparison
연결 식별자의 비교 결과입니다.
정의 glsConnectionIdentityService.h:7
@ Table
테이블 이름까지 비교합니다.
정의 glsConnectionIdentityService.h:17
@ Schema
PostgreSQL 스키마까지 비교합니다. 파일에서는 Database와 같습니다.
정의 glsConnectionIdentityService.h:16
@ Database
파일 또는 PostgreSQL 데이터베이스까지 비교합니다.
정의 glsConnectionIdentityService.h:15
@ Different
지정한 범위에서 서로 다른 객체입니다.
정의 glsConnectionIdentityService.h:10
@ Unknown
미확정 식별자가 있거나 PostgreSQL 서버 표기가 달라 같거나 다른지 판단할 수 없습니다.
정의 glsConnectionIdentityService.h:8
@ Same
지정한 범위에서 동일한 객체입니다.
정의 glsConnectionIdentityService.h:9
glsGdk SDK의 네이티브 C++ API 이름 공간입니다.
정의 glsAttributeTable.h:5
DLL 경계의 공개 함수가 반환하는 상태입니다.
정의 glsTypes.h:83