nl:: Weave:: Profiles:: DataManagement_Current:: TraitSchemaEngine
#include <src/lib/profiles/data-management/Current/TraitData.h>
स्कीमा इंजन, किसी खास विशेषता से जुड़ी स्कीमा की जानकारी लेता है. साथ ही, उसे पार्स करने और उसे WDM मशीनरी के इस्तेमाल किए जा सकने वाले फ़ॉर्मैट में बदलने की सुविधाएं उपलब्ध कराता है.
खास जानकारी
इसमें पाथहैंडल से डब्ल्यूडीएम पाथ और डब्ल्यूडीएम पाथ को डब्ल्यूडीएम पाथ में बदलना और स्कीमा को समझने/क्वेरी करने के तरीके शामिल हैं. साथ ही, किसी हैंडल के लिए TLV को/से डेटा पढ़ने/लिखने के तरीके भी शामिल हैं.
स्कीमा को टेबल के तौर पर स्टोर किया जाता है. इसमें किसी विशेषता के लिए WDM पाथ/डेटा को सामान्य पार्स करने/संरचना देने के लिए ज़रूरी जानकारी दी गई है. ये टेबल 'code-gen' का आखिरी आउटपुट होंगी (किसी भी जनरेट किए गए कोड :P के न होने की वजह से, यह शब्द कुछ हद तक गुमराह करने वाला है)
सार्वजनिक स्टैटिक एट्रिब्यूट |
|
---|---|
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 का प्रोफ़ाइल आईडी दिखाता है.
|
GetRelativePathTags(const PropertyPathHandle aCandidateHandle, uint64_t *aTags, const uint32_t aTagsSize, uint32_t & aNumTags) const
|
यह प्रॉपर्टीज़PathHandle को कॉन्टेक्स्ट टैग के कलेक्शन में बदलता है.
|
GetTag(PropertyPathHandle aHandle) const
|
uint64_t
यह फ़ंक्शन किसी पाथ हैंडल से जुड़ा टैग दिखाता है.
|
GetVersionIntersection(SchemaVersionRange & aVersion, SchemaVersionRange & aIntersection) const
|
bool
वर्शन रेंज दिए जाने पर, यह फ़ंक्शन यह जांच करता है कि इस स्कीमा इंजन का बैक अप लेने वाले स्कीमा के साथ काम करने वाली चीज़ों के बीच क्या काम करता है.
|
IsDictionary(PropertyPathHandle aHandle) const
|
bool
अगर हैंडल कोई डिक्शनरी है, तो 'सही' दिखाता है (न कि शब्दकोश में - नीचे दिया गया तरीका देखें).
|
IsEphemeral(PropertyPathHandle aHandle) const
|
bool
|
IsInDictionary(PropertyPathHandle aHandle, PropertyPathHandle & aDictionaryItemHandle) const
|
bool
अगर हैंडल, डिक्शनरी (शब्दकोश के एलिमेंट) के अंदर है, तो 'सही' दिखाता है.
|
IsLeaf(PropertyPathHandle aPropertyHandle) const
|
bool
अगर हैंडल, स्कीमा ट्री में लीफ़ नोड से जुड़ा है, तो 'सही' दिखाता है.
|
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 में पास किया गया दस्तावेज़, स्कीमा में स्टोर किए गए डेटा से मेल खाता है, तो 'सही' दिखाता है.
|
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
किसी खास पाथ हैंडल के बारे में जानकारी देने वाले PropertyInfo स्ट्रक्चर पर पॉइंटर दिखाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
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 का प्रोफ़ाइल आईडी दिखाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
GetRelativePathTags
WEAVE_ERROR GetRelativePathTags( const PropertyPathHandle aCandidateHandle, uint64_t *aTags, const uint32_t aTagsSize, uint32_t & aNumTags ) const
यह प्रॉपर्टीज़PathHandle को कॉन्टेक्स्ट टैग के कलेक्शन में बदलता है.
ब्यौरा | |||||||||
---|---|---|---|---|---|---|---|---|---|
पैरामीटर |
|
||||||||
लौटाए जाने वाले प्रॉडक्ट |
सफलता के मामले में WEAVE_NO_ERROR; अगर पूरा पाथ स्टोर करने के लिहाज़ से कोई टैग बहुत छोटा है, तो WEAVE_ERROR_NO_MEMORY.
|
GetTag
uint64_t GetTag( PropertyPathHandle aHandle ) const
यह फ़ंक्शन किसी पाथ हैंडल से जुड़ा टैग दिखाता है.
अगर यह एक डिक्शनरी एलिमेंट है, तो यह फ़ंक्शन ProfileTag दिखाता है. ऐसा न होने पर, यह कॉन्टेक्स्ट टैग दिखाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
GetVersionIntersection
bool GetVersionIntersection( SchemaVersionRange & aVersion, SchemaVersionRange & aIntersection ) const
वर्शन रेंज दिए जाने पर, यह फ़ंक्शन यह जांच करता है कि इस स्कीमा इंजन का बैक अप लेने वाले स्कीमा के साथ काम करने वाली चीज़ों के बीच क्या काम करता है.
अगर कोई चौराहा है, तो फ़ंक्शन सही रिटर्न करेगा और पास किए गए aIntersection तर्क को अपडेट करेगा. ऐसा इसलिए, ताकि उस प्रतिच्छेदन परीक्षण के नतीजों को दिखाया जा सके.
IsDictionary
bool IsDictionary( PropertyPathHandle aHandle ) const
अगर हैंडल कोई डिक्शनरी है, तो 'सही' दिखाता है (न कि शब्दकोश में - नीचे दिया गया तरीका देखें).
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
IsEphemeral
bool IsEphemeral( PropertyPathHandle aHandle ) const
IsInDictionary
bool IsInDictionary( PropertyPathHandle aHandle, PropertyPathHandle & aDictionaryItemHandle ) const
अगर हैंडल, डिक्शनरी (शब्दकोश के एलिमेंट) के अंदर है, तो 'सही' दिखाता है.
हैंडल (aDictionaryItemHandle) में पास किया गया उपयोगकर्ता, शब्दकोश में सबसे ऊपर मौजूद डिक्शनरी एलिमेंट हैंडल पर ले जाने के लिए अपडेट किया जाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
IsLeaf
bool IsLeaf( PropertyPathHandle aPropertyHandle ) const
अगर हैंडल, स्कीमा ट्री में लीफ़ नोड से जुड़ा है, तो 'सही' दिखाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
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 लाइब्रेरी का इस्तेमाल करके एन्कोड करना ज़रूरी है, उदाहरण के लिए, दशमलव एन्कोडिंग (डिफ़ॉल्ट) में शुरुआत में 0 नहीं होना चाहिए, हेक्साडेसिमल एन्कोडिंग में
0x
से शुरू होना चाहिए, और ऑक्टल एन्कोडिंग में शुरू में0
होना चाहिए.
ब्यौरा | |||||||
---|---|---|---|---|---|---|---|
रिटर्न वैल्यू |
|
MatchesProfileId
bool MatchesProfileId( uint32_t aProfileId ) const
अगर ProfileId में पास किया गया दस्तावेज़, स्कीमा में स्टोर किए गए डेटा से मेल खाता है, तो 'सही' दिखाता है.
ब्यौरा | |||
---|---|---|---|
रिटर्न वैल्यू |
|
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 कॉल शुरू करें. इसके बाद, इस बफ़र को सिंक में स्टोर करें.
ब्यौरा | |||||
---|---|---|---|---|---|
रिटर्न वैल्यू |
|