nl:: Weave:: Profiles:: DataManagement_Current:: TraitSchemaEngine
#include <src/lib/profiles/data-management/Current/TraitData.h>
스키마 엔진은 특정 특성과 관련된 스키마 정보를 가져오고 이를 파싱하여 WDM 기계에서 사용할 수 있는 형식으로 변환하는 기능을 제공합니다.
요약
여기에는 PathHandles에서 WDM 경로로 (또는 그 반대로) 변환하는 메서드, 스키마 자체를 해석/쿼리하는 메서드, 핸들이 지정된 TLV에서 데이터를 읽고 쓰는 데 도움이 되는 메서드가 포함됩니다.
스키마 자체는 표 형식으로 저장되며, 주어진 특성에 대한 WDM 경로/데이터의 일반적인 파싱/컴포지션이 가능하도록 충분히 설명되어 있습니다. 이러한 테이블은 'code-gen'의 최종 출력입니다(생성된 코드가 없는 경우 용어 자체는 다소 오해의 소지가 있음).
공개 정적 속성 |
|
---|---|
kHandleTableOffset = 2
|
const uint32_t
|
공개 속성 |
|
---|---|
mSchema
|
const Schema
|
공개 함수 |
|
---|---|
FindLowestCommonAncestor(PropertyPathHandle aHandle1, PropertyPathHandle aHandle2, PropertyPathHandle *aHandle1BranchChild, PropertyPathHandle *aHandle2BranchChild) const
|
두 개의 속성 핸들이 주어지면 이 두 핸들의 상위 요소 역할을 하는 가장 낮은 핸들을 계산합니다.
|
GetChildHandle(PropertyPathHandle aParentHandle, uint8_t aContextTag) const
|
|
GetDepth(PropertyPathHandle aHandle) const
|
int32_t
스키마 트리에서 지정된 핸들의 깊이를 계산합니다.
|
GetDictionaryItemHandle(PropertyPathHandle aParentHandle, uint16_t aDictionaryKey) const
|
|
GetFirstChild(PropertyPathHandle aParentHandle) const
|
특정 상위 요소와 연결된 첫 번째 하위 핸들을 반환합니다.
|
GetHighestForwardVersion(SchemaVersion aVersion) const
|
SchemaVersion
제공된 데이터 스키마 버전이 있으면 이후 버전과 호환되는 가장 높은 스키마 버전이 반환됩니다.
|
GetLowestCompatibleVersion(SchemaVersion aVersion) const
|
SchemaVersion
제공된 데이터 스키마 버전이 있으면 호환 가능한 최소 스키마 버전이 반환됩니다.
|
GetMap(PropertyPathHandle aHandle) const
|
const PropertyInfo *
특정 경로 핸들을 설명하는 PropertyInfo 구조의 포인터를 반환합니다.
|
GetMaxVersion() const
|
SchemaVersion
|
GetMinVersion() const
|
SchemaVersion
|
GetNextChild(PropertyPathHandle aParentId, PropertyPathHandle aChildHandle) const
|
기존 하위 요소에 대한 핸들이 주어지면 특정 상위 요소와 연결된 다음 하위 핸들을 반환합니다.
|
GetParent(PropertyPathHandle aHandle) const
|
지정된 하위 경로 핸들의 상위 핸들을 반환합니다.
|
GetProfileId(void) const
|
uint32_t
연결된 trait의 프로필 ID를 반환합니다.
|
GetRelativePathTags(const PropertyPathHandle aCandidateHandle, uint64_t *aTags, const uint32_t aTagsSize, uint32_t & aNumTags) const
|
PropertyPathHandle을 컨텍스트 태그 배열로 변환합니다.
|
GetTag(PropertyPathHandle aHandle) const
|
uint64_t
경로 핸들과 연결된 태그를 반환합니다.
|
GetVersionIntersection(SchemaVersionRange & aVersion, SchemaVersionRange & aIntersection) const
|
bool
이 함수는 버전 범위가 주어지면 해당 버전과 이 스키마 엔진을 지원하는 스키마에서 지원하는 기능 사이에 호환성 교차가 있는지 확인합니다.
|
IsDictionary(PropertyPathHandle aHandle) const
|
bool
핸들이 사전에 없는 경우 true를 반환합니다 (아래 메서드 참조).
|
IsEphemeral(PropertyPathHandle aHandle) const
|
bool
|
IsInDictionary(PropertyPathHandle aHandle, PropertyPathHandle & aDictionaryItemHandle) const
|
bool
핸들이 사전 (사전 요소) 내에 있으면 true를 반환합니다.
|
IsLeaf(PropertyPathHandle aPropertyHandle) const
|
bool
핸들이 스키마 트리의 리프 노드를 참조하는 경우 true를 반환합니다.
|
IsNullable(PropertyPathHandle aHandle) const
|
bool
|
IsOptional(PropertyPathHandle aHandle) const
|
bool
|
IsParent(PropertyPathHandle aChildHandle, PropertyPathHandle aParentHandle) const
|
bool
지정된 핸들이 다른 핸들의 하위 요소인지 확인합니다.
|
MapHandleToPath(PropertyPathHandle aHandle, nl::Weave::TLV::TLVWriter & aPathWriter) const
|
경로 핸들을 TLV 경로로 변환합니다.
|
MapPathToHandle(nl::Weave::TLV::TLVReader & aPathReader, PropertyPathHandle & aHandle) const
|
WDM 경로 요소의 루트에 위치한 판독기가 주어지면 관련 태그를 읽고 동등한 경로 핸들을 제공합니다.
|
MapPathToHandle(const char *aPathString, PropertyPathHandle & aHandle) const
|
WDM 경로의 문자열 표현이 주어지면 관련 태그를 읽고 동등한 경로 핸들을 제공합니다.
|
MatchesProfileId(uint32_t aProfileId) const
|
bool
profileId에 전달된 것이 스키마에 저장된 것과 일치하면 true를 반환합니다.
|
RetrieveData(PropertyPathHandle aHandle, uint64_t aTagToWrite, nl::Weave::TLV::TLVWriter & aWriter, IGetDataDelegate *aDelegate, IDirtyPathCut *apDirtyPathCut) const
|
해당 데이터 요소의 경로 핸들과 작성자 위치가 주어지면 소스에서 리프 데이터를 가져와 스키마와 호환되는 방식으로 작성자가 가리키는 버퍼에 씁니다.
|
RetrieveUpdatableDictionaryData(PropertyPathHandle aHandle, uint64_t aTagToWrite, nl::Weave::TLV::TLVWriter & aWriter, IGetDataDelegate *aDelegate, PropertyPathHandle & aPropertyPathHandleOfDictItemToStartFrom) const
|
|
StoreData(PropertyPathHandle aHandle, nl::Weave::TLV::TLVReader & aReader, ISetDataDelegate *aDelegate, IPathFilter *aPathFilter) const
|
경로 핸들과 해당 데이터 요소에 위치한 판독기가 주어지면 판독기가 가리키는 데이터 버퍼를 처리하고 리프 데이터 항목이 발생할 때마다 SetLeafData 호출을 호출하여 싱크에 저장합니다.
|
클래스 |
|
---|---|
nl:: |
|
nl:: |
구조체 |
|
---|---|
nl:: |
|
nl:: |
스키마 정보가 포함된 기본 스키마 구조입니다. |
공개 정적 속성
kHandleTableOffset
const uint32_t kHandleTableOffset = 2
공개 속성
mSchema
const Schema mSchema
공개 함수
FindLowestCommonAncestor
PropertyPathHandle FindLowestCommonAncestor( PropertyPathHandle aHandle1, PropertyPathHandle aHandle2, PropertyPathHandle *aHandle1BranchChild, PropertyPathHandle *aHandle2BranchChild ) const
두 개의 속성 핸들이 주어지면 이 두 핸들의 상위 요소 역할을 하는 가장 낮은 핸들을 계산합니다.
또한 두 핸들이 각각 동일한 경우에도 두 개의 핸들이 각각 포함된 두 개의 하위 브랜치를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetChildHandle
PropertyPathHandle GetChildHandle( PropertyPathHandle aParentHandle, uint8_t aContextTag ) const
GetDepth
int32_t GetDepth( PropertyPathHandle aHandle ) const
스키마 트리에서 지정된 핸들의 깊이를 계산합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetDictionaryItemHandle
PropertyPathHandle GetDictionaryItemHandle( PropertyPathHandle aParentHandle, uint16_t aDictionaryKey ) const
GetFirstChild
PropertyPathHandle GetFirstChild( PropertyPathHandle aParentHandle ) const
특정 상위 요소와 연결된 첫 번째 하위 핸들을 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetHighestForwardVersion
SchemaVersion GetHighestForwardVersion( SchemaVersion aVersion ) const
제공된 데이터 스키마 버전이 있으면 이후 버전과 호환되는 가장 높은 스키마 버전이 반환됩니다.
GetLowestCompatibleVersion
SchemaVersion GetLowestCompatibleVersion( SchemaVersion aVersion ) const
제공된 데이터 스키마 버전이 있으면 호환 가능한 최소 스키마 버전이 반환됩니다.
GetMap
const PropertyInfo * GetMap( PropertyPathHandle aHandle ) const
GetMaxVersion
SchemaVersion GetMaxVersion() const
GetMinVersion
SchemaVersion GetMinVersion() const
GetNextChild
PropertyPathHandle GetNextChild( PropertyPathHandle aParentId, PropertyPathHandle aChildHandle ) const
기존 하위 요소에 대한 핸들이 주어지면 특정 상위 요소와 연결된 다음 하위 핸들을 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetParent
PropertyPathHandle GetParent( PropertyPathHandle aHandle ) const
지정된 하위 경로 핸들의 상위 핸들을 반환합니다.
상위 핸들이 사전 요소인 경우에도 핸들의 사전 키가 유지됩니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetProfileId
uint32_t GetProfileId( void ) const
연결된 trait의 프로필 ID를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetRelativePathTags
WEAVE_ERROR GetRelativePathTags( const PropertyPathHandle aCandidateHandle, uint64_t *aTags, const uint32_t aTagsSize, uint32_t & aNumTags ) const
PropertyPathHandle을 컨텍스트 태그 배열로 변환합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 |
성공 시 WEAVE_NO_ERROR, aTag가 너무 작아 전체 경로를 저장할 수 없는 경우 WEAVE_ERROR_NO_MEMORY
|
GetTag
uint64_t GetTag( PropertyPathHandle aHandle ) const
경로 핸들과 연결된 태그를 반환합니다.
사전 요소인 경우 이 함수는 ProfileTag를 반환합니다. 그렇지 않으면 컨텍스트 태그를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetVersionIntersection
bool GetVersionIntersection( SchemaVersionRange & aVersion, SchemaVersionRange & aIntersection ) const
이 함수는 버전 범위가 주어지면 해당 버전과 이 스키마 엔진을 지원하는 스키마에서 지원하는 기능 사이에 호환성 교차가 있는지 확인합니다.
교집합이 있으면 이 함수는 true를 반환하고 교차 테스트의 결과를 반영하도록 전달된 aIntersection 인수를 업데이트합니다.
IsDictionary
bool IsDictionary( PropertyPathHandle aHandle ) const
핸들이 사전에 없는 경우 true를 반환합니다 (아래 메서드 참조).
세부정보 | |||
---|---|---|---|
반환 값 |
|
IsEphemeral
bool IsEphemeral( PropertyPathHandle aHandle ) const
IsInDictionary
bool IsInDictionary( PropertyPathHandle aHandle, PropertyPathHandle & aDictionaryItemHandle ) const
핸들이 사전 (사전 요소) 내에 있으면 true를 반환합니다.
핸들에 전달된 사용자 (aDictionaryItemHandle)는 사전 내의 최상위 사전 요소 핸들을 가리키도록 업데이트됩니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
IsLeaf
bool IsLeaf( PropertyPathHandle aPropertyHandle ) const
핸들이 스키마 트리의 리프 노드를 참조하는 경우 true를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
IsNullable
bool IsNullable( PropertyPathHandle aHandle ) const
IsOptional
bool IsOptional( PropertyPathHandle aHandle ) const
IsParent
bool IsParent( PropertyPathHandle aChildHandle, PropertyPathHandle aParentHandle ) const
지정된 핸들이 다른 핸들의 하위 요소인지 확인합니다.
간접 상위 계정일 수 있습니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
MapHandleToPath
WEAVE_ERROR MapHandleToPath( PropertyPathHandle aHandle, nl::Weave::TLV::TLVWriter & aPathWriter ) const
MapPathToHandle
WEAVE_ERROR MapPathToHandle( nl::Weave::TLV::TLVReader & aPathReader, PropertyPathHandle & aHandle ) const
WDM 경로 요소의 루트에 위치한 판독기가 주어지면 관련 태그를 읽고 동등한 경로 핸들을 제공합니다.
세부정보 | |||||
---|---|---|---|---|---|
반환 값 |
|
MapPathToHandle
WEAVE_ERROR MapPathToHandle( const char *aPathString, PropertyPathHandle & aHandle ) const
WDM 경로의 문자열 표현이 주어지면 관련 태그를 읽고 동등한 경로 핸들을 제공합니다.
WDM 경로는 다음 규칙을 사용하여 문자열로 표시됩니다.
- 태그는
/
로 구분됩니다. - 경로는 선행
/
로 시작해야 하며 후행 슬래시를 포함하면 안 됩니다. - WDM 경로의 숫자 태그는 정수-문자열 인코딩을 위한 표준 C 라이브러리를 사용하여 인코딩되어야 합니다(MUST). 즉, 십진수 인코딩(기본값)은 선행 0을 포함하면 안 되며(MUST NOT), 16진수 인코딩은
0x
로 시작해야 하며(MUST) 8진수 인코딩은 선행0
를 포함해야 합니다(MUST).
세부정보 | |||||||
---|---|---|---|---|---|---|---|
반환 값 |
|
MatchesProfileId
bool MatchesProfileId( uint32_t aProfileId ) const
profileId에 전달된 것이 스키마에 저장된 것과 일치하면 true를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
RetrieveData
WEAVE_ERROR RetrieveData( PropertyPathHandle aHandle, uint64_t aTagToWrite, nl::Weave::TLV::TLVWriter & aWriter, IGetDataDelegate *aDelegate, IDirtyPathCut *apDirtyPathCut ) const
해당 데이터 요소의 경로 핸들과 작성자 위치가 주어지면 소스에서 리프 데이터를 가져와 스키마와 호환되는 방식으로 작성자가 가리키는 버퍼에 씁니다.
세부정보 | |||||
---|---|---|---|---|---|
반환 값 |
|
RetrieveUpdatableDictionaryData
WEAVE_ERROR RetrieveUpdatableDictionaryData( PropertyPathHandle aHandle, uint64_t aTagToWrite, nl::Weave::TLV::TLVWriter & aWriter, IGetDataDelegate *aDelegate, PropertyPathHandle & aPropertyPathHandleOfDictItemToStartFrom ) const
StoreData
WEAVE_ERROR StoreData( PropertyPathHandle aHandle, nl::Weave::TLV::TLVReader & aReader, ISetDataDelegate *aDelegate, IPathFilter *aPathFilter ) const
경로 핸들과 해당 데이터 요소에 위치한 판독기가 주어지면 판독기가 가리키는 데이터 버퍼를 처리하고 리프 데이터 항목이 발생할 때마다 SetLeafData 호출을 호출하여 싱크에 저장합니다.
세부정보 | |||||
---|---|---|---|---|---|
반환 값 |
|