IMetaHierarchyInstance.GetRootTree

Syntax

GetRootTree: IMetaMembersTree;

Description

The GetRootTree method returns full hierarchy of time series database elements.

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.

Sub Main;

Var

Mb: Imetabase;

Rubr: IMetabaseObject;

RubrInst: IRubricatorInstance;

Facts: IMetaDictionaryInstance;

Hierarchy: IMetaHierarchy;

HInstance: IMetaHierarchyInstance;

Tree: IMetaMembersTree;

Begin

Mb := MetabaseClass.Active;

Rubr := MB.ItemById("OBJ_FC").Edit;

RubrInst := Rubr.Open(Null) As IRubricatorInstance;

Facts := RubrInst.GetDictionary(RubricatorDictionary.Facts);

Hierarchy := Facts.Dictionary.DefaultHierarchy;

HInstance := Facts.OpenHierarchy(Hierarchy);

Tree := HInstance.GetRootTree;

Tree.Reset;

While Not Tree.Eof Do

If Tree.CurrentOffset = 0 Then

Debug.WriteLine(Tree.Current.Name);

End If;

Tree.Next;

End While;

End Sub Main;

After executing the example the names of all root elements of hierarchy first level are displayed in the console window.

See also:

IMetaHierarchyInstance