Ada 编程/库/Ada.Containers.Indefinite Vectors
外观
此语言特性仅从 Ada 2005 开始可用。
Ada.Containers.Indefinite_Vectors 是 预定义语言环境 自 Ada 2005 以来的一部分。
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- 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 -- -------------------------------------------------------------------------generictypeIndex_Typeisrange<>;typeElement_Type (<>)isprivate;withfunction"=" (Left :inElement_Type; Right :inElement_Type)returnBooleanis<>;packageAda.Containers.Indefinite_VectorsispragmaPreelaborate (Indefinite_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;typeVectoristaggedprivate;pragmaPreelaborable_Initialization (Vector);typeCursorisprivate;pragmaPreelaborable_Initialization (Cursor); Empty_Vector :constantVector; No_Element :constantCursor;function"=" (Left :inVector; Right :inVector)returnBoolean;functionTo_Vector (Length :inCount_Type)returnVector;functionTo_Vector (New_Item :inElement_Type; Length :inCount_Type)returnVector;function"&" (Left :inVector; Right :inVector)returnVector;function"&" (Left :inVector; Right :inElement_Type)returnVector;function"&" (Left :inElement_Type; Right :inVector)returnVector;function"&" (Left :inElement_Type; Right :inElement_Type)returnVector;functionCapacity (Container :inVector)returnCount_Type;procedureReserve_Capacity (Container :inoutVector; Capacity :inCount_Type);functionLength (Container :inVector)returnCount_Type;procedureSet_Length (Container :inoutVector; Length :inCount_Type);functionIs_Empty (Container :inVector)returnBoolean;procedureClear (Container :inoutVector);functionTo_Cursor (Container : Vector; Index : Extended_Index)returnCursor;functionTo_Index (Position :inCursor)returnExtended_Index;functionElement (Container :inVector; Index :inIndex_Type)returnElement_Type;functionElement (Position :inCursor)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));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);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 :inIndex_Type; J :inIndex_Type);procedureSwap (Container :inoutVector; I :inCursor; J :inCursor);functionFirst_Index (Container :inVector)returnIndex_Type;functionFirst (Container :inVector)returnCursor;functionFirst_Element (Container :inVector)returnElement_Type;functionLast_Index (Container :inVector)returnExtended_Index;functionLast (Container :inVector)returnCursor;functionLast_Element (Container :inVector)returnElement_Type;functionNext (Position :inCursor)returnCursor;procedureNext (Position :inoutCursor);functionPrevious (Position :inCursor)returnCursor;procedurePrevious (Position :inoutCursor);functionFind_Index (Container :inVector; Item :inElement_Type; Index :inIndex_Type := Index_Type'First)returnExtended_Index;functionFind (Container :inVector; Item :inElement_Type; Position :inCursor := No_Element)returnCursor;functionReverse_Find_Index (Container :inVector; Item :inElement_Type; Index :inIndex_Type := Index_Type'Last)returnExtended_Index;functionReverse_Find (Container :inVector; Item :inElement_Type; Position :inCursor := No_Element)returnCursor;functionContains (Container :inVector; Item :inElement_Type)returnBoolean;functionHas_Element (Position :inCursor)returnBoolean;procedureIterate (Container :inVector; Process :notnullaccessprocedure(Position :inCursor));procedureReverse_Iterate (Container :inVector; Process :notnullaccessprocedure(Position :inCursor));genericwithfunction"<" (Left :inElement_Type; Right :inElement_Type)returnBooleanis<>;packageGeneric_SortingisfunctionIs_Sorted (Container :inVector)returnBoolean;procedureSort (Container :inoutVector);procedureMerge (Target :inoutVector; Source :inoutVector);endGeneric_Sorting;privatetypeVectoristaggednullrecord; Empty_Vector :constantVector := (nullrecord);typeCursorisnullrecord; No_Element :constantCursor := (nullrecord);endAda.Containers.Indefinite_Vectors;
外部示例
[编辑源代码]- 在以下位置搜索
Ada.Containers.Indefinite_Vectors的示例:Rosetta Code,GitHub (gists),任何 Alire 包 或 本。 - 在以下位置搜索与
Ada.Containers.Indefinite_Vectors相关的帖子:Stack Overflow,comp.lang.ada 或 任何与 Ada 相关的页面。
FSF GNAT
- 规范:a-coinve.ads
- 主体:a-coinve.adb
drake
