mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
BiArray and Index documentation update.
git-svn-id: svn://ultimatepp.org/upp/trunk@920 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
3f3c5517ff
commit
ed25972b67
4 changed files with 258 additions and 182 deletions
|
|
@ -10,45 +10,42 @@ topic "BiArray";
|
|||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[s0;~~~64; BiArray&]
|
||||
[s0;~~~64; template <class [*@4 T]>&]
|
||||
[s0;3 &]
|
||||
[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) class][@(64) _]BiArray[@(64) _
|
||||
:_][@(0.0.255) private][@(64) _][^`:`:MoveableAndDeepCopyOption^@(64) MoveableAndDeepCop
|
||||
yOption][@(64) <_]BiArray[@(64) <][@4 T][@(64) >_>_]&]
|
||||
[s0; &]
|
||||
[s0; [*C@4 T]-|Type or base class of elements stored in the BiArray.
|
||||
There is no common requirement for T.&]
|
||||
[s0; The universal form of bidirectional random access container.
|
||||
[s0;~~~64; [*@3;4 BiArray]&]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][@(0.0.255)3 >]&]
|
||||
[s1;:BiArray`:`:class:%- [@(0.0.255) class]_[* BiArray]_:_[@(0.0.255) private]_[*@3 MoveableAn
|
||||
dDeepCopyOption][@(0.0.255) <]_[* BiArray][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s8; [@4 T]-|Type or base class of elements stored in the BiArray. There
|
||||
is no common requirement for T.&]
|
||||
[s9; The universal form of bidirectional random access container.
|
||||
Its features are derived from the fact that it is typically implemented
|
||||
using an indirect container of pointers to T like BiVector<T`*>.
|
||||
Nevertheless it supports common concepts as ownership of contained
|
||||
elements, reference (not pointer) access to elements and so on.&]
|
||||
[s0; It provides almost all operations of BiVector with the same
|
||||
[s9; It provides almost all operations of BiVector with the same
|
||||
semantics and almost any BiVector can be directly replaced by
|
||||
BiArray. On the other hand, it provides some special operations
|
||||
impossible for BiVector and most important, it never invalidates
|
||||
references (that means C`+`+ references and pointers) to elements
|
||||
(it often invalidates iterators, though).&]
|
||||
[s0; BiArray can also be used to store polymorphic elements `- stored
|
||||
[s9; BiArray can also be used to store polymorphic elements `- stored
|
||||
elements could be derived from T. To store such elements, you
|
||||
pass pointer to element previously created on the heap. Still,
|
||||
BiArray takes over ownership of such element (it e.g. deletes
|
||||
it when appropriate). You can also use this method to create
|
||||
BiArray of elements that do not have pick nor deep copy constructor.&]
|
||||
[s0; There are also operations that allow detaching an element from
|
||||
[s9; There are also operations that allow detaching an element from
|
||||
BiArray, removing it but not destroying. Pointer to such element
|
||||
is returned from these operations and BiArray gives up ownership.&]
|
||||
[s0; Disadvantage of BiArray over BiVector is performance `- most
|
||||
[s9; Disadvantage of BiArray over BiVector is performance `- most
|
||||
operations are significantly slower than with BiVectors (by factor
|
||||
up to 8, it depends on speed of malloc/free).&]
|
||||
[s0; As for memory, for small sized elements, BiArray memory consumption
|
||||
[s9; As for memory, for small sized elements, BiArray memory consumption
|
||||
is significantly higher than BiVector consumption. As the size
|
||||
of the elements grow, BiArray starts to be better than BiVector.&]
|
||||
[s0;~~~.704; Iterators to BiArray satisfy all C`+`+ standard library
|
||||
requirements for random access iterator plus they allow assignment
|
||||
(and copy constructor) and testing for 0 (that is NULL) pointer.&]
|
||||
[s0; Like any other NTL container, BiArray is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
[s9; Iterators to BiArray satisfy all C`+`+ standard library requirements
|
||||
for random access iterator plus they allow assignment (and copy
|
||||
constructor) and testing for 0 (that is NULL) pointer.&]
|
||||
[s9; Like any other NTL container, BiArray is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
oveable][*/ ]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick
|
||||
and optional deep copy] transfer semantics. Calling methods of
|
||||
picked BiArray is logic error with the exceptions of&]
|
||||
|
|
@ -57,19 +54,49 @@ picked BiArray is logic error with the exceptions of&]
|
|||
][/+75 (defined using DeepCopyOptionTemplate)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s0; Optional deep copy is implemented through DeepCopyOptionTemplate
|
||||
[s9; Optional deep copy is implemented through DeepCopyOptionTemplate
|
||||
macro.&]
|
||||
[s0; Members&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_AddHead[@(64) ()]&]
|
||||
[s3;%- &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:BiArray`:`:BiArray`(`):%- [* BiArray]()&]
|
||||
[s2; Default constructor. Constructs empty BiArray.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:BiArray`:`:BiArray`(const`:`:BiArray`&`,int`): [* BiArray](const
|
||||
[* BiArray]`& [*@3 v], int)&]
|
||||
[s2; Optional deep copy constructor.&]
|
||||
[s6; Requires T to have deep copy constructor or optional deep copy
|
||||
constructor if Array stores only objects of type T.&]
|
||||
[s6; Requires polymorphic deep copy if Array stores also objects
|
||||
of type derived from T.&]
|
||||
[s7; [*C@3 v]-|Source Array.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:BiArray`(pick`_ BiArray`&`):%- [* BiArray]([@(0.128.128) pick`_]_[* BiArray
|
||||
][@(0.0.255) `&]_[*@3 src])&]
|
||||
[s2; Pick constructor. Transfers source BiArray in low constant time,
|
||||
but destroys it by picking. &]
|
||||
[s7; [*@3 v]-|Source BiArray.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:`~BiArray`(`):%- [@(0.0.255) `~][* BiArray]()&]
|
||||
[s2; Destructor. Invokes the destructor of every element in the BiArray.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:BiArray`:`:AddHead`(`):%- [*@4 T][@(0.0.255) `&]_[* AddHead]()&]
|
||||
[s2; Adds a new default constructed element at the head of the BiArray.
|
||||
The new element will be at position 0.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*/ Return value]-|Reference to the newly added default constructed
|
||||
element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_AddTail[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddTail`(`):%- [*@4 T][@(0.0.255) `&]_[* AddTail]()&]
|
||||
[s2; Adds a new default constructed element at the tail of BiArray.
|
||||
The new element will be at position GetCount() `- 1.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
|
|
@ -77,36 +104,45 @@ The new element will be at position GetCount() `- 1.&]
|
|||
[s7; [*/ Return value]-|Reference to the newly added default constructed
|
||||
element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]AddHead[@(64) (][@(0.0.255) const][@(64) _T`&_][@3 x][@(64) )]&]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddHead`(const T`&`):%- [@(0.0.255) void]_[* AddHead]([@(0.0.255) const]_[*@4 T
|
||||
][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a new element with the specified value at the head of BiArray.
|
||||
The new element will be at position 0.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|The value that is copied to the newly created element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]AddTail[@(64) (][@(0.0.255) const][@(64) _T`&_][@3 x][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddTail`(const T`&`):%- [@(0.0.255) void]_[* AddTail]([@(0.0.255) const]_[*@4 T
|
||||
][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a new element with the specified value at the tail of BiArray.
|
||||
The new element will be at position GetCount() `- 1.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|The value that is copied to the newly created element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]AddHeadPick[@(64) (pick`__T`&_][@3 x][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddHeadPick`(pick`_ T`&`):%- [@(0.0.255) void]_[* AddHeadPick]([@(0.128.128) p
|
||||
ick`_]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the head of BiArray and picks value of
|
||||
the parameter. The new element will be at position 0.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|Source instance of T that is to be picked.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]AddTailPick[@(64) (pick`__T`&_][@3 x][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddTailPick`(pick`_ T`&`):%- [@(0.0.255) void]_[* AddTailPick]([@(0.128.128) p
|
||||
ick`_]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the tail of BiArray and picks the value
|
||||
of the parameter. The new element will be at position GetCount()
|
||||
`- 1.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|Source instance of T that is to be picked.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_AddHead[@(64) (T_`*][@3 newt][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddHead`(T`*`):%- [*@4 T][@(0.0.255) `&]_[* AddHead]([*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Adds a new element at the head of BiArray. Element is specified
|
||||
by a pointer to the object. BiArray takes over ownership of the
|
||||
object. This variant allows use of BiArray as polymorphic container,
|
||||
|
|
@ -117,7 +153,8 @@ position 0.&]
|
|||
[s7; [*C@3 newt]-|The object to be added.&]
|
||||
[s7; [*/ Return value]-|Reference to the object `= [* `*newt].&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_AddTail[@(64) (T_`*][@3 newt][@(64) )]&]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:AddTail`(T`*`):%- [*@4 T][@(0.0.255) `&]_[* AddTail]([*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Adds new element at the tail of BiArray. Element is specified
|
||||
by a pointer to the object. BiArray takes over ownership of this
|
||||
this object. This variant allows use of BiArray as polymorphic
|
||||
|
|
@ -127,80 +164,100 @@ be at position GetCount() `- 1.&]
|
|||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 newt]-|The object to be added.&]
|
||||
[s7; [*/ Return value]-|Reference to the object `- [* `*newt].&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_Head[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Head`(`):%- [*@4 T][@(0.0.255) `&]_[* Head]()&]
|
||||
[s2; Returns reference to the head of the BiArray. Same as operator`[`](0).&]
|
||||
[s7; [*/ Return value]-|Reference to the head of BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_Tail[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Tail`(`):%- [*@4 T][@(0.0.255) `&]_[* Tail]()&]
|
||||
[s2; Returns reference to the tail of the BiArray. Same as operator`[`](GetCount()
|
||||
`- 1).&]
|
||||
[s7; [*/ Return value]-|Reference to the tail of BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) const][@(64) _T`&_]Head[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Head`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Head]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns reference to the head of the BiArray. Same as operator`[`](0).&]
|
||||
[s7; [*/ Return value]-|Constant reference to the head of BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) const][@(64) _T`&_]Tail[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Tail`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Tail]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns reference to the tail of the BiArray. Same as operator`[`](GetCount()
|
||||
`- 1).&]
|
||||
[s7; [*/ Return value]-|Constant reference to the tail of BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]DropHead[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:DropHead`(`):%- [@(0.0.255) void]_[* DropHead]()&]
|
||||
[s2; Removes element at the head of the BiArray.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]DropTail[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:DropTail`(`):%- [@(0.0.255) void]_[* DropTail]()&]
|
||||
[s2; Removes element at the tail of the BiArray.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T_`*DetachHead[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:DetachHead`(`):%- [*@4 T]_`*[* DetachHead]()&]
|
||||
[s2; Removes element at the head of the BiArray, giving up ownership.
|
||||
Client is responsible for deletion of the element.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*/ Return value]-|Pointer to the element allocated on the heap.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T_`*DetachTail[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:DetachTail`(`):%- [*@4 T]_`*[* DetachTail]()&]
|
||||
[s2; Removes element at the tail of the BiArray, giving up ownership.
|
||||
Client is responsible for deletion of the element.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*/ Return value]-|Pointer to the element allocated on the heap.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T`&_operator`[`][@(64) (][@(0.0.255) int][@(64) _][@3 i][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:operator`[`]`(int`):%- [*@4 T][@(0.0.255) `&]_[* operator`[`]]([@(0.0.255) in
|
||||
t]_[*@3 i])&]
|
||||
[s2; Returns a reference to the element at the specified position.&]
|
||||
[s7; [*C@3 i]-|Position of the element.&]
|
||||
[s7; [*/ Return value]-|Reference to the element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) const][@(64) _T`&_]operator`[`][@(64) (][@(0.0.255) int][@(64) _][@3 i][@(64) )
|
||||
_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:operator`[`]`(int`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* oper
|
||||
ator`[`]]([@(0.0.255) int]_[*@3 i])_[@(0.0.255) const]&]
|
||||
[s2; Returns a reference to the element at the specified position.&]
|
||||
[s7; [*C@3 i]-|Position of the element.&]
|
||||
[s7; [*/ Return value]-|Constant reference to the element.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) int][@(64) _]GetCount[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:GetCount`(`)const:%- [@(0.0.255) int]_[* GetCount]()_[@(0.0.255) const]&]
|
||||
[s2; Returns the number of elements in the BiArray.&]
|
||||
[s7; [*/ Return value]-|Actual number of elements.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) bool][@(64) _]IsEmpty[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s2; Tests whether the BiArray is empty. Same as GetCount() `=`=
|
||||
0.&]
|
||||
[s7; [*/ Return value]-|true if Vector is empty, false otherwise.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]Clear[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes all elements from the BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]Shrink[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Shrink`(`):%- [@(0.0.255) void]_[* Shrink]()&]
|
||||
[s2; Minimizes memory consumption of the BiArray by minimizing capacity.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]Reserve[@(64) (][@(0.0.255) int][@(64) _][@3 n][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Reserve`(int`):%- [@(0.0.255) void]_[* Reserve]([@(0.0.255) int]_[*@3 n])&]
|
||||
[s2; Reserves capacity. If required capacity is greater than the
|
||||
current capacity, capacity is increased to the required value.&]
|
||||
[s7; [*C@3 n]-|Required capacity.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) int][@(64) _]GetAlloc[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:GetAlloc`(`)const:%- [@(0.0.255) int]_[* GetAlloc]()_[@(0.0.255) const]&]
|
||||
[s2; Returns current capacity of BiArray.&]
|
||||
[s7; [*/ Return value]-|Capacity of the BiArray.&]
|
||||
[s0; &]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:friend BiArray`& operator`<`<`(BiArray`& b`, const T`& x`): friend
|
||||
BiArray`& [* operator]<<(BiArray`& [*@3 b], const T`& [*@3 x])&]
|
||||
[s2; Operator replacement of [* void AddTail(const T`&x)]. By returning
|
||||
|
|
@ -212,7 +269,8 @@ BiArray as part of an expression like Foo(BiArray<int>() << 1
|
|||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|The value that is copied to the newly created element.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[s0; &]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:friend BiArray`& operator`>`>`(const T`& x`, BiArray`& b`): friend
|
||||
BiArray`& [* operator]>>(const T`& [*@3 x], BiArray`& [*@3 b])&]
|
||||
[s2; Operator replacement of [* void AddHead(const T`&x)]. By returning
|
||||
|
|
@ -223,94 +281,91 @@ BiArray as part of an expression like Foo(1 >> (2 >> BiArray<int>())).&]
|
|||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*C@3 x]-|The value that is copied to the newly created element.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]Serialize[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) )
|
||||
]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Serialize`(Stream`&`):%- [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2; Serializes the content of the BiArray to/from a Stream. Works
|
||||
only if NTL is used as part of UPP.&]
|
||||
[s6; Requires T to have serialization operator defined.&]
|
||||
[s7; [*C@3 s]-|Target/source stream.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) bool][@(64) _]IsPicked[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:IsPicked`(`)const:%- [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&]
|
||||
[s2; Returns [* true] if BiArray is in picked state.&]
|
||||
[s7; [*/ Return value]-|[* true] if BiArray is in picked state, [* false]
|
||||
otherwise.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:BiArray`:`:BiArray`(const`:`:BiArray`&`,int`): [* BiArray](const
|
||||
[* BiArray]`& [*@3 v], int)&]
|
||||
[s2; Optional deep copy constructor.&]
|
||||
[s6; Requires T to have deep copy constructor or optional deep copy
|
||||
constructor if Array stores only objects of type T.&]
|
||||
[s6; Requires polymorphic deep copy if Array stores also objects
|
||||
of type derived from T.&]
|
||||
[s7; [*C@3 v]-|Source Array.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:BiArray`:`:BiArray`(pick`_`:`:BiArray`&`): [* BiArray](pick`_
|
||||
[* BiArray]`& [*@3 src])&]
|
||||
[s2; Pick constructor. Transfers source BiArray in low constant time,
|
||||
but destroys it by picking. &]
|
||||
[s7; [*C@3 v]-|Source BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [@(0.0.255) void][@(64) _]operator`=[@(64) (pick`__][^`:`:BiArray^@(64) BiArray][@(64) `&
|
||||
_][@3 src][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:operator`=`(pick`_ BiArray`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p
|
||||
ick`_]_[_^BiArray^ BiArray][@(0.0.255) `&]_[*@3 src])&]
|
||||
[s2; Pick operator. Transfers source Array in low constant time,
|
||||
but destroys it by picking.&]
|
||||
[s7; [*C@3 v]-|Source Array.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:BiArray`:`:BiArray`(`): [* BiArray]()&]
|
||||
[s2; Default constructor. Constructs empty BiArray.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:BiArray`:`:`~BiArray`(`): `~[* BiArray]()&]
|
||||
[s2; Destructor. Invokes the destructor of every element in the BiArray.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- typedef_T_ValueType&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:ValueType`:`:typedef:%- [@(0.0.255) typedef]_T_[* ValueType]&]
|
||||
[s2; Typedef of T for use in templated algorithms.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- typedef_[^`:`:IIterator^ IIterator]<[^`:`:BiArray^ BiArray]>_Iterator&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Iterator`:`:typedef:%- [@(0.0.255) typedef]_[_^IIterator^ IIterator][@(0.0.255) <
|
||||
][_^BiArray^ BiArray][@(0.0.255) >]_[* Iterator]&]
|
||||
[s2; Iterator type.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- typedef_[^`:`:ConstIIterator^ ConstIIterator]<[^`:`:BiArray^ BiArray]>_ConstItera
|
||||
tor&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:ConstIterator`:`:typedef:%- [@(0.0.255) typedef]_[_^ConstIIterator^ Const
|
||||
IIterator][@(0.0.255) <][_^BiArray^ BiArray][@(0.0.255) >]_[* ConstIterator]&]
|
||||
[s2; Constant iterator type.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:Iterator^ Iterator]_Begin[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Begin`(`):%- [_^BiArray`:`:Iterator^ Iterator]_[* Begin]()&]
|
||||
[s2; Returns a non`-constant iterator to the head of the BiArray.
|
||||
&]
|
||||
[s7; [*/ Return value]-|Iterator.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:Iterator^ Iterator]_End[@(64) ()]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:End`(`):%- [_^BiArray`:`:Iterator^ Iterator]_[* End]()&]
|
||||
[s2; Returns a non`-constant iterator to the position just beyond
|
||||
the tail of the BiArray.&]
|
||||
[s7; [*/ Return value]-|Iterator.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:Iterator^ Iterator]_GetIter[@(64) (][@(0.0.255) int][@(64) _][@3 pos][@(64) )
|
||||
]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:GetIter`(int`):%- [_^BiArray`:`:Iterator^ Iterator]_[* GetIter]([@(0.0.255) i
|
||||
nt]_[*@3 pos])&]
|
||||
[s2; Returns a non`-constant iterator to the element at the specified
|
||||
position. Same as [* Begin() `+ pos]. The benefit of this method
|
||||
is that [* pos] is range checked in debug mode.&]
|
||||
[s7; [*C@3 pos]-|Required position.&]
|
||||
[s7; [*/ Return value]-|Iterator.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:ConstIterator^ ConstIterator]_Begin[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Begin`(`)const:%- [_^BiArray`:`:ConstIterator^ ConstIterator]_[* Begin]()
|
||||
_[@(0.0.255) const]&]
|
||||
[s2; Returns a constant iterator to the head of the BiArray. &]
|
||||
[s7; [*/ Return value]-|Iterator.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:ConstIterator^ ConstIterator]_End[@(64) ()_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:End`(`)const:%- [_^BiArray`:`:ConstIterator^ ConstIterator]_[* End]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a constant iterator to the position just beyond the
|
||||
tail of the Array.&]
|
||||
[s7; [*/ Return value]-|Iterator.-|&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:BiArray`:`:ConstIterator^ ConstIterator]_GetIter[@(64) (][@(0.0.255) int][@(64) _
|
||||
][@3 pos][@(64) )_][@(0.0.255) const]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:GetIter`(int`)const:%- [_^BiArray`:`:ConstIterator^ ConstIterator]_[* Get
|
||||
Iter]([@(0.0.255) int]_[*@3 pos])_[@(0.0.255) const]&]
|
||||
[s2; Returns a constant iterator to the element at the specified
|
||||
position. Same as [* Begin() `+ pos]. The benefit of this method
|
||||
is that [* pos] is range checked in debug mode.&]
|
||||
[s7; [*C@3 pos]-|Required position.&]
|
||||
[s7; [*/ Return value]-|Iterator.&]
|
||||
[s0;3 &]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;K%- friend_[@(0.0.255) void][@(64) _]Swap[@(64) (][^`:`:BiArray^@(64) BiArray][@(64) `&_][@3 a
|
||||
][@(64) , ][^`:`:BiArray^@(64) BiArray][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s2; Specialization of the generic [* Swap] for BiArrays. Swaps BiArray
|
||||
in low constant time operation.&]
|
||||
[s7; [*C@3 a]-|First BiArray to swap.&]
|
||||
[s0; [*C@3 b]-|Second BiArray to swap.]
|
||||
[s7; [*@3 a]-|First BiArray to swap.&]
|
||||
[s7; [*@3 b]-|Second BiArray to swap.&]
|
||||
[s3; &]
|
||||
[s0; ]
|
||||
|
|
@ -14,10 +14,10 @@ topic "BiVector";
|
|||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][@(0.0.255)3 >]&]
|
||||
[s1;:BiVector`:`:class:%- [@(0.0.255) class]_[* BiVector]_:_[@(0.0.255) private]_[*@3 Moveable
|
||||
AndDeepCopyOption][@(0.0.255) <]_[* BiVector][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s7;#l0;i704;~~~.704; [*C@4 T]-|Type of elements stored in the [* BiVector].
|
||||
T is required to be [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/
|
||||
]and must have either [*/ deep copy constructor], [*/ pick constructor]
|
||||
or [*/ default constructor].&]
|
||||
[s8; [*@4 T]-|Type of elements stored in the BiVector. T is required
|
||||
to be [/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][/
|
||||
]and must have either [/ deep copy constructor], [/ pick constructor]
|
||||
or [/ default constructor].&]
|
||||
[s0; &]
|
||||
[s0;# Vector flavor of bidirectional container. Allows adding elements
|
||||
at both sides of sequence in constant amortized time.&]
|
||||
|
|
|
|||
|
|
@ -10,33 +10,26 @@ topic "Index";
|
|||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[s0;~~~64; Index&]
|
||||
[s0;~~~64; template <class [*@4 T], class [*@4 HashFn] `= StdHash<[*@4 T]>
|
||||
>&]
|
||||
[s0;3 &]
|
||||
[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) , ][@(0.0.255) class][@(64) _][@4 HashFn][@(64) _
|
||||
`=_StdHash<][@4 T][@(64) >_>__][@(0.0.255) class][@(64) _]Index[@(64) _:_][@(0.0.255) private][@(64) _
|
||||
][^`:`:MoveableAndDeepCopyOption^@(64) MoveableAndDeepCopyOption][@(64) <_]Index[@(64) <
|
||||
][@4 T][@(64) , ][@4 HashFn][@(64) _>_>, ][@(0.0.255) public][@(64) _][^`:`:AIndex^@(64) AIndex
|
||||
][@(64) <][@4 T][@(64) , ][^`:`:Vector^@(64) Vector][@(64) <][@4 T][@(64) >,
|
||||
][@4 HashFn][@(64) >_]&]
|
||||
[s0; &]
|
||||
[s0; [*C@4 T]-|Type of elements stored in Index. T is required to be
|
||||
[*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/ ]and
|
||||
must have [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ deep copy
|
||||
constructor] and deep copy assignment.&]
|
||||
[s0; [*C@4 HashFn]-|Hashing class. Must have [*C unsigned operator()(const
|
||||
T`& x)] method defined, returning hash value for elements. Defaults
|
||||
to[* ][*C StdHash<T>] which requires [*C unsigned GetHashValue(const
|
||||
T`&)][C ]function returning hash value of elements to be defined.&]
|
||||
[s0; Base class&]
|
||||
[s0; [^topic`:`/`/Core`/src`/AIndex`$en`-us^ AIndex<T, Vector<T>, HashFn>
|
||||
] &]
|
||||
[s0; &]
|
||||
[s0; Vector flavor of index. Inherits most of its functionality from
|
||||
[s0;~~~64; [*@3;4 Index]&]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][3 ,
|
||||
][@(0.0.255)3 class][3 _][*@4;3 HashFn][3 _`=_StdHash][@(0.0.255)3 <][*@4;3 T][@(0.0.255)3 >][3 _
|
||||
>]&]
|
||||
[s1;:Index`:`:class:%- [@(0.0.255) class]_[* Index]_:_[@(0.0.255) private]_[*@3 MoveableAndDee
|
||||
pCopyOption][@(0.0.255) <]_[* Index][@(0.0.255) <][*@4 T], [*@4 HashFn]_>_>,
|
||||
[@(0.0.255) public]_[*@3 AIndex][@(0.0.255) <][*@4 T], [_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >
|
||||
], [*@4 HashFn][@(0.0.255) >]_&]
|
||||
[s8; [*@4 T]-|Type of elements stored in Index. T is required to be
|
||||
[/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][/ ]and must
|
||||
have [/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ deep copy constructor]
|
||||
and deep copy assignment.&]
|
||||
[s8; [*@4 HashFn]-|Hashing class. Must have unsigned operator()(const
|
||||
T`& x) method defined, returning hash value for elements. Defaults
|
||||
to StdHash<T> which requires unsigned GetHashValue(const T`&)
|
||||
function returning hash value of elements to be defined.&]
|
||||
[s9; Vector flavor of index. Inherits most of its functionality from
|
||||
[^topic`:`/`/Core`/src`/AIndex`$en`-us^ AIndex] and adds only members
|
||||
specific for its flavor.&]
|
||||
[s0; Like any other NTL container, Index is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
[s9; Like any other NTL container, Index is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
oveable][*/ ]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick
|
||||
and optional deep copy] transfer semantics. Calling methods of
|
||||
picked Index is logic error with exception of&]
|
||||
|
|
@ -46,47 +39,63 @@ picked Index is logic error with exception of&]
|
|||
][/+75 (defined in AIndex)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s0; Optional deep copy operator is inherited from AIndex class.
|
||||
Pick operator is implicitly defined by composition.&]
|
||||
[s0; Members&]
|
||||
[s0;3 &]
|
||||
[s5;K%- T_Pop[@(64) ()]&]
|
||||
[s2; Drops last element of the Index and returns its value.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s7; [*/ Return value]-|Value of the dropped element.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:Index`:`:Index`(`): [* Index]()&]
|
||||
[s9; Optional deep copy operator is inherited from AIndex class.
|
||||
Pick operator is implicitly defined by composition&]
|
||||
[s0; .&]
|
||||
[s0; [* Base class]&]
|
||||
[s0; [^topic`:`/`/Core`/src`/AIndex`$en`-us`#AIndex`:`:class^ AIndex<T,
|
||||
Vector<T>, HashFn>]&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Index`:`:Index`(`):%- [* Index]()&]
|
||||
[s2; Constructs empty Index.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:Index`:`:Index`(pick`_`:`:Index`&`): [* Index](pick`_ Index`&
|
||||
[*@3 s])&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Index`:`:Index`(pick`_ Index`&`):%- [* Index]([@(0.128.128) pick`_]_[* Index][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2; Pick constructor. Transfers source Index in low constant time,
|
||||
but destroys it by picking.&]
|
||||
[s7; [*C@3 s]-|Source Index.&]
|
||||
[s0;3 &]
|
||||
[s5;K%- [^`:`:Index^ Index]`&_operator`=[@(64) (pick`__][^`:`:Vector^@(64) Vector][@(64) <][^T^@(64) T
|
||||
][@(64) >`&_][@3 x][@(64) )]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Index`:`:Index`(pick`_ Vector`<T`>`&`):%- [* Index]([@(0.128.128) pick`_]_[_^Vector^ V
|
||||
ector][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 s])&]
|
||||
[s2; Pick operator. Transfers source Vector to Index in low constant
|
||||
time, but destroys it by picking.&]
|
||||
[s7; [*C@3 x]-|Source Vector.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:Index`:`:Index`(const`:`:Index`&`,int`): [* Index](const Index`&
|
||||
[*@3 s], int)&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Index`:`:Index`(const Index`&`,int`):%- [* Index]([@(0.0.255) const]_[* Index][@(0.0.255) `&
|
||||
]_[*@3 s], [@(0.0.255) int])&]
|
||||
[s2; Optional deep copy constructor.&]
|
||||
[s6; Requires T to have deep copy constructor or optional deep copy
|
||||
constructor.&]
|
||||
[s7; [*C@3 s]-|Source Index.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:Index`:`:Index`(pick`_`:`:Vector`<T`>`&`): [* Index](pick`_
|
||||
Vector<T>`& [*@3 s])&]
|
||||
[s2; Pick`-constructs Index from Vector. Transfers source container
|
||||
in low constant time, but destroys it by picking.&]
|
||||
[s7; [*C@3 s]-|Source Vector.&]
|
||||
[s0;3 &]
|
||||
[s0;:`:`:Index`:`:Index`(const`:`:Vector`<T`>`&`,int`): [* Index](const
|
||||
Vector<T>`& [*@3 s], int)&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Index`:`:Index`(const Vector`<T`>`&`,int`):%- [* Index]([@(0.0.255) const]_[_^Vector^ V
|
||||
ector][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 s], [@(0.0.255) int])&]
|
||||
[s2; Deep`-copy constructs Index from Vector.&]
|
||||
[s0; Requires T to have deep copy constructor or optional deep copy
|
||||
[s6; Requires T to have deep copy constructor or optional deep copy
|
||||
constructor.&]
|
||||
[s7; [*C@3 s]-|Source Vector.&]
|
||||
[s7; [*@3 s]-|Source Vector.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Index`:`:Pop`(`):%- [*@4 T]_[* Pop]()&]
|
||||
[s2; Drops last element of the Index and returns its value.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s7; [*/ Return value]-|Value of the dropped element.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Index`:`:operator`=`(pick`_ Vector`<T`>`&`):%- [_^Index^ Index][@(0.0.255) `&]_[* oper
|
||||
ator`=]([@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 x])
|
||||
&]
|
||||
[s2; Pick operator. Transfers source Vector to Index in low constant
|
||||
time, but destroys it by picking.&]
|
||||
[s7; [*@3 x]-|Source Vector.&]
|
||||
[s3; &]
|
||||
[s0; ]
|
||||
|
|
@ -30,6 +30,14 @@ TOPIC("ArrayMap$en-us")
|
|||
#include "ArrayMap$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("BiArray$en-us")
|
||||
#include "BiArray$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("BiVector$en-us")
|
||||
#include "BiVector$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("DateFmt$en-us")
|
||||
#include "DateFmt$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
|
@ -46,6 +54,10 @@ TOPIC("FormatFn$en-us")
|
|||
#include "FormatFn$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Indext$en-us")
|
||||
#include "Indext$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("MathUtil$en-us")
|
||||
#include "MathUtil$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue