Ada 编程/库/Ada.Containers.Bounded_Vectors
外观
此语言特性在 Ada 2012 中引入。
Ada.Containers.Bounded_Vectors 是 预定义语言环境 自 Ada 2012 以来的一部分。
-- 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;generictypeIndex_Typeisrange<>;typeElement_Typeisprivate;withfunction"=" (Left, Right : Element_Type)returnBooleanis<>;packageAda.Containers.Bounded_VectorsispragmaPure(Bounded_Vectors);pragmaRemote_Types(Bounded_Vectors);subtypeExtended_IndexisIndex_Type'BaserangeIndex_Type'First-1 .. Index_Type'Min (Index_Type'Base'Last - 1, Index_Type'Last) + 1; No_Index :constantExtended_Index := Extended_Index'First;typeVector (Capacity : Count_Type)istaggedprivatewithConstant_Indexing => Constant_Reference, Variable_Indexing => Reference, Default_Iterator => Iterate, Iterator_Element => Element_Type;pragmaPreelaborable_Initialization(Vector);typeCursorisprivate;pragmaPreelaborable_Initialization(Cursor); Empty_Vector :constantVector; No_Element :constantCursor;functionHas_Element (Position : Cursor)returnBoolean;packageVector_Iterator_InterfacesisnewAda.Iterator_Interfaces (Cursor, Has_Element);function"=" (Left, Right : Vector)returnBoolean;functionTo_Vector (Length : Count_Type)returnVector;functionTo_Vector (New_Item : Element_Type; Length : Count_Type)returnVector;function"&" (Left, Right : Vector)returnVector;function"&" (Left : Vector; Right : Element_Type)returnVector;function"&" (Left : Element_Type; Right : Vector)returnVector;function"&" (Left, Right : Element_Type)returnVector;functionCapacity (Container : Vector)returnCount_Type;procedureReserve_Capacity (Container :inoutVector; Capacity :inCount_Type);functionLength (Container : Vector)returnCount_Type;procedureSet_Length (Container :inoutVector; Length :inCount_Type);functionIs_Empty (Container : Vector)returnBoolean;procedureClear (Container :inoutVector);functionTo_Cursor (Container : Vector; Index : Extended_Index)returnCursor;functionTo_Index (Position : Cursor)returnExtended_Index;functionElement (Container : Vector; Index : Index_Type)returnElement_Type;functionElement (Position : Cursor)returnElement_Type;procedureReplace_Element (Container :inoutVector; Index :inIndex_Type; New_Item :inElement_Type);procedureReplace_Element (Container :inoutVector; Position :inCursor; New_item :inElement_Type);procedureQuery_Element (Container :inVector; Index :inIndex_Type; Process :notnullaccessprocedure(Element :inElement_Type));procedureQuery_Element (Position :inCursor; Process :notnullaccessprocedure(Element :inElement_Type));procedureUpdate_Element (Container :inoutVector; Index :inIndex_Type; Process :notnullaccessprocedure(Element :inoutElement_Type));procedureUpdate_Element (Container :inoutVector; 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 :aliasedinVector; Index :inIndex_Type)returnConstant_Reference_Type;functionReference (Container :aliasedinoutVector; Index :inIndex_Type)returnReference_Type;functionConstant_Reference (Container :aliasedinVector; Position :inCursor)returnConstant_Reference_Type;functionReference (Container :aliasedinoutVector; Position :inCursor)returnReference_Type;procedureAssign (Target :inoutVector; Source :inVector);functionCopy (Source : Vector; Capacity : Count_Type := 0)returnVector;procedureMove (Target :inoutVector; Source :inoutVector);procedureInsert (Container :inoutVector; Before :inExtended_Index; New_Item :inVector);procedureInsert (Container :inoutVector; Before :inCursor; New_Item :inVector);procedureInsert (Container :inoutVector; Before :inCursor; New_Item :inVector; Position :outCursor);procedureInsert (Container :inoutVector; Before :inExtended_Index; New_Item :inElement_Type; Count :inCount_Type := 1);procedureInsert (Container :inoutVector; Before :inCursor; New_Item :inElement_Type; Count :inCount_Type := 1);procedureInsert (Container :inoutVector; Before :inCursor; New_Item :inElement_Type; Position :outCursor; Count :inCount_Type := 1);procedureInsert (Container :inoutVector; Before :inExtended_Index; Count :inCount_Type := 1);procedureInsert (Container :inoutVector; Before :inCursor; Position :outCursor; Count :inCount_Type := 1);procedurePrepend (Container :inoutVector; New_Item :inVector);procedurePrepend (Container :inoutVector; New_Item :inElement_Type; Count :inCount_Type := 1);procedureAppend (Container :inoutVector; New_Item :inVector);procedureAppend (Container :inoutVector; New_Item :inElement_Type; Count :inCount_Type := 1);procedureInsert_Space (Container :inoutVector; Before :inExtended_Index; Count :inCount_Type := 1);procedureInsert_Space (Container :inoutVector; Before :inCursor; Position :outCursor; Count :inCount_Type := 1);procedureDelete (Container :inoutVector; Index :inExtended_Index; Count :inCount_Type := 1);procedureDelete (Container :inoutVector; Position :inoutCursor; Count :inCount_Type := 1);procedureDelete_First (Container :inoutVector; Count :inCount_Type := 1);procedureDelete_Last (Container :inoutVector; Count :inCount_Type := 1);procedureReverse_Elements (Container :inoutVector);procedureSwap (Container :inoutVector; I, J :inIndex_Type);procedureSwap (Container :inoutVector; I, J :inCursor);functionFirst_Index (Container : Vector)returnIndex_Type;functionFirst (Container : Vector)returnCursor;functionFirst_Element (Container : Vector)returnElement_Type;functionLast_Index (Container : Vector)returnExtended_Index;functionLast (Container : Vector)returnCursor;functionLast_Element (Container : Vector)returnElement_Type;functionNext (Position : Cursor)returnCursor;procedureNext (Position :inoutCursor);functionPrevious (Position : Cursor)returnCursor;procedurePrevious (Position :inoutCursor);functionFind_Index (Container : Vector; Item : Element_Type; Index : Index_Type := Index_Type'First)returnExtended_Index;functionFind (Container : Vector; Item : Element_Type; Position : Cursor := No_Element)returnCursor;functionReverse_Find_Index (Container : Vector; Item : Element_Type; Index : Index_Type := Index_Type'Last)returnExtended_Index;functionReverse_Find (Container : Vector; Item : Element_Type; Position : Cursor := No_Element)returnCursor;functionContains (Container : Vector; Item : Element_Type)returnBoolean;procedureIterate (Container :inVector; Process :notnullaccessprocedure(Position :inCursor));procedureReverse_Iterate (Container :inVector; Process :notnullaccessprocedure(Position :inCursor));functionIterate (Container :inVector)returnVector_Iterator_Interfaces.Reversible_Iterator'Class;functionIterate (Container :inVector; Start :inCursor)returnVector_Iterator_Interfaces.Reversible_Iterator'Class;genericwithfunction"<" (Left, Right : Element_Type)returnBooleanis<>;packageGeneric_SortingisfunctionIs_Sorted (Container : Vector)returnBoolean;procedureSort (Container :inoutVector);procedureMerge (Target :inoutVector; Source :inoutVector);endGeneric_Sorting;private-- not specified by the languageendAda.Containers.Bounded_Vectors;
外部示例
[编辑源代码]- 在以下位置搜索
Ada.Containers.Bounded_Vectors的示例:Rosetta Code,GitHub (gists),任何 Alire 包 或 此。 - 在以下位置搜索与
Ada.Containers.Bounded_Vectors相关的帖子:Stack Overflow,comp.lang.ada 或 任何与 Ada 相关的页面。
FSF GNAT
- 规范:a-cobove.ads
- 主体:a-cobove.adb
