Ada Programming/Libraries/Ada.Containers.Bounded_Multiway_Trees
This language feature has been introduced in Ada 2012.
Ada.Containers.Bounded_Multiway_Trees is a unit of the Predefined Language Environment since Ada 2012.
Specification
-- Standard Ada library specification -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual -- -------------------------------------------------------------------------withAda.Iterator_Interfaces;generictypeElement_Typeisprivate;withfunction"=" (Left, Right : Element_Type)returnBooleanis<>;packageAda.Containers.Bounded_Multiway_TreesispragmaPure(Bounded_Multiway_Trees);pragmaRemote_Types(Bounded_Multiway_Trees);typeTree (Capacity : Count_Type)istaggedprivatewithConstant_Indexing => Constant_Reference, Variable_Indexing => Reference, Default_Iterator => Iterate, Iterator_Element => Element_Type;pragmaPreelaborable_Initialization(Tree);typeCursorisprivate;pragmaPreelaborable_Initialization(Cursor); Empty_Tree :constantTree; No_Element :constantCursor;functionHas_Element (Position : Cursor)returnBoolean;packageTree_Iterator_InterfacesisnewAda.Iterator_Interfaces (Cursor, Has_Element);functionEqual_Subtree (Left_Position : Cursor; Right_Position: Cursor)returnBoolean;function"=" (Left, Right : Tree)returnBoolean;functionIs_Empty (Container : Tree)returnBoolean;functionNode_Count (Container : Tree)returnCount_Type;functionSubtree_Node_Count (Position : Cursor)returnCount_Type;functionDepth (Position : Cursor)returnCount_Type;functionIs_Root (Position : Cursor[[Ada Programming|]]returnBoolean;functionIs_Leaf (Position : Cursor)returnBoolean;functionRoot (Container : Tree)returnCursor;procedureClear (Container :inoutTree);functionElement (Position : Cursor)returnElement_Type;procedureReplace_Element (Container :inoutTree; Position :inCursor; New_Item :inElement_Type);procedureQuery_Element (Position :inCursor; Process :notnullaccessprocedure(Element :inElement_Type));procedureUpdate_Element (Container :inoutTree; Position :inCursor; Process :notnullaccessprocedure(Element :inoutElement_Type));typeConstant_Reference_Type (Element :notnullaccessconstantElement_Type)isprivatewithImplicit_Dereference => Element;typeReference_Type (Element :notnullaccessElement_Type)isprivatewithImplicit_Dereference => Element;functionConstant_Reference (Container :aliasedinTree; Position :inCursor)returnConstant_Reference_Type;functionReference (Container :aliasedinoutTree; Position :inCursor)returnReference_Type;procedureAssign (Target :inoutTree; Source :inTree);functionCopy (Source : Tree; Capacity : Count_Type := 0)returnTree;procedureMove (Target :inoutTree; Source :inoutTree);procedureDelete_Leaf (Container :inoutTree; Position :inoutCursor);procedureDelete_Subtree (Container :inoutTree; Position :inoutCursor);procedureSwap (Container :inoutTree; I, J :inCursor);functionFind (Container : Tree; Item : Element_Type)returnCursor;functionFind_In_Subtree (Position : Cursor; Item : Element_Type)returnCursor;functionAncestor_Find (Position : Cursor; Item : Element_Type)returnCursor;functionContains (Container : Tree; Item : Element_Type)returnBoolean;procedureIterate (Container :inTree; Process :notnullaccessprocedure(Position :inCursor));procedureIterate_Subtree (Position :inCursor; Process :notnullaccessprocedure(Position :inCursor));functionIterate (Container :inTree)returnTree_Iterator_Interfaces.Forward_Iterator'Class;functionIterate_Subtree (Position :inCursor)returnTree_Iterator_Interfaces.Forward_Iterator'Class;functionChild_Count (Parent : Cursor)returnCount_Type;functionChild_Depth (Parent, Child : Cursor)returnCount_Type;procedureInsert_Child (Container :inoutTree; Parent :inCursor; Before :inCursor; New_Item :inElement_Type; Count :inCount_Type := 1);procedureInsert_Child (Container :inoutTree; Parent :inCursor; Before :inCursor; New_Item :inElement_Type; Position :outCursor; Count :inCount_Type := 1);procedureInsert_Child (Container :inoutTree; Parent :inCursor; Before :inCursor; Position :outCursor; Count :inCount_Type := 1);procedurePrepend_Child (Container :inoutTree; Parent :inCursor; New_Item :inElement_Type; Count :inCount_Type := 1);procedureAppend_Child (Container :inoutTree; Parent :inCursor; New_Item :inElement_Type; Count :inCount_Type := 1);procedureDelete_Children (Container :inoutTree; Parent :inCursor);procedureCopy_Subtree (Target :inoutTree; Parent :inCursor; Before :inCursor; Source :inCursor);procedureSplice_Subtree (Target :inoutTree; Parent :inCursor; Before :inCursor; Source :inoutTree; Position :inoutCursor);procedureSplice_Subtree (Container:inoutTree; Parent :inCursor; Before :inCursor; Position :inCursor);procedureSplice_Children (Target :inoutTree; Target_Parent :inCursor; Before :inCursor; Source :inoutTree; Source_Parent :inCursor);procedureSplice_Children (Container :inoutTree; Target_Parent :inCursor; Before :inCursor; Source_Parent :inCursor);functionParent (Position : Cursor)returnCursor;functionFirst_Child (Parent : Cursor)returnCursor;functionFirst_Child_Element (Parent : Cursor)returnElement_Type;functionLast_Child (Parent : Cursor)returnCursor;functionLast_Child_Element (Parent : Cursor)returnElement_Type;functionNext_Sibling (Position : Cursor)returnCursor;functionPrevious_Sibling (Position : Cursor)returnCursor;procedureNext_Sibling (Position :inoutCursor);procedurePrevious_Sibling (Position :inoutCursor);procedureIterate_Children (Parent :inCursor; Process :notnullaccessprocedure(Position :inCursor));procedureReverse_Iterate_Children (Parent :inCursor; Process :notnullaccessprocedure(Position :inCursor));functionIterate_Children (Container :inTree; Parent :inCursor)returnTree_Iterator_Interfaces.Reversible_Iterator'Class;private-- not specified by the languageendAda.Containers.Bounded_Multiway_Trees;
See also
Wikibook
External examples
- Search for examples of
Ada.Containers.Bounded_Multiway_Treesin: Rosetta Code, GitHub (gists), any Alire crate or this Wikibook. - Search for posts related to
Ada.Containers.Bounded_Multiway_Treesin: Stack Overflow, comp.lang.ada or any Ada related page.
Ada Reference Manual
Ada 2012
Open-Source Implementations
FSF GNAT
- Specification: a-cbmutr.ads
- Body: a-cbmutr.adb