nl:: Weave:: 프로필::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
연결된 특성의 프로필 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
전달된 schemaId가 스키마에 저장된 정보와 일치하면 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
깊이
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
제공된 데이터 스키마 버전이 지정된 경우 가장 높은 정방향 호환 스키마 버전이 반환됩니다.
GetLowestCompatibilityVersion
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
연결된 특성의 프로필 ID를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
GetRelativePathTag
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 인수를 업데이트하여 교집합 테스트의 결과를 반영합니다.
이 사전
bool IsDictionary( PropertyPathHandle aHandle ) const
핸들이 사전인 경우 true를 반환합니다 (사전이 아닌 경우 - 아래 메서드 참조).
세부정보 | |||
---|---|---|---|
반환 값 |
|
임시
bool IsEphemeral( PropertyPathHandle aHandle ) const
InInDictionary
bool IsInDictionary( PropertyPathHandle aHandle, PropertyPathHandle & aDictionaryItemHandle ) const
핸들이 사전 내 (사전 요소)에 있는 경우 true를 반환합니다.
핸들 (aDictionaryItemHandle)에서 전달된 사용자는 사전 내에서 최상위 사전 요소 핸들을 가리키도록 업데이트됩니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
이리프
bool IsLeaf( PropertyPathHandle aPropertyHandle ) const
핸들이 스키마 트리의 리프 노드를 참조하는 경우 true를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
IsNullable
bool IsNullable( PropertyPathHandle aHandle ) const
선택사항
bool IsOptional( PropertyPathHandle aHandle ) const
상위 요소
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 경로는 다음 규칙을 사용하여 문자열로 표시됩니다.
- 태그는
/
으로 구분됩니다. - 경로는 선행
/
로 시작해야 하며 후행 슬래시를 포함해서는 안 됩니다(MUST NOT). - WDM 경로의 숫자 태그는 표준 C 라이브러리를 사용하여 정수와 문자열 인코딩을 함께 인코딩해야 합니다(예: 십진수 인코딩은 앞에 오는 0을 포함하면 안 됨(MUST NOT), 16진수 인코딩은
0x
로 시작해야 하며, 8진수 인코딩은 선행0
를 포함해야 합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
반환 값 |
|
MatchProfileId
bool MatchesProfileId( uint32_t aProfileId ) const
전달된 schemaId가 스키마에 저장된 정보와 일치하면 true를 반환합니다.
세부정보 | |||
---|---|---|---|
반환 값 |
|
검색 데이터
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
스토어 데이터
WEAVE_ERROR StoreData( PropertyPathHandle aHandle, nl::Weave::TLV::TLVReader & aReader, ISetDataDelegate *aDelegate, IPathFilter *aPathFilter ) const
상응하는 데이터 요소에 배치된 경로 핸들과 판독기가 제공되면 리프 데이터 항목이 발생할 때마다 SetLeafData 호출을 호출하여 판독기가 가리키는 데이터 버퍼를 처리하고 싱크에 저장합니다.
세부정보 | |||||
---|---|---|---|---|---|
반환 값 |
|