mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
uppsrc: Topic Language Separator change (more)
git-svn-id: svn://ultimatepp.org/upp/trunk@11510 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2850ed2911
commit
0fd7305fcc
259 changed files with 49699 additions and 49791 deletions
|
|
@ -61,12 +61,12 @@ CONSOLE_APP_MAIN
|
|||
count += src[i & 15].val[0];
|
||||
}
|
||||
}
|
||||
{
|
||||
/* {
|
||||
RTIMING("Barrier read");
|
||||
for(int i = 0; i < N; i++) {
|
||||
count += ReadWithBarrier(src[i & 15].val[0]);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
{
|
||||
static StaticMutex mtx;
|
||||
RTIMING("StaticMutex");
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@ uses
|
|||
Core;
|
||||
|
||||
file
|
||||
BenchOps.cpp.mine,
|
||||
BenchOps.cpp.r10063,
|
||||
BenchOps.cpp.r10157,
|
||||
BenchOps.cpp;
|
||||
|
||||
mainconfig
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
topic "This is Topic++ example page";[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[{_}%EN-US
|
||||
[s0;=*6 This is Topic`+`+ example page&]
|
||||
[s0; &]
|
||||
[s0; This is a [^topic`:`/`/Topic`/app`/page2`$en`-us^ link to another
|
||||
page].&]
|
||||
[s0; ]
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
TITLE("This is Topic++ example page 2")
|
||||
COMPRESSED
|
||||
120,156,139,86,80,81,49,208,49,80,54,32,0,172,92,82,
|
||||
211,18,75,115,74,98,163,171,227,107,85,93,253,116,67,131,
|
||||
21,162,139,13,172,21,66,50,50,139,21,128,168,36,35,85,
|
||||
33,49,47,31,72,21,41,20,36,166,167,234,197,2,0,214,
|
||||
14,24,213,
|
||||
|
|
@ -1,88 +1,88 @@
|
|||
topic "Any";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Any]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:Any`:`:class:%- [@(0.0.255) class]_[* Any]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <
|
||||
][* Any][@(0.0.255) >]&]
|
||||
[s9; Any is a special type of container capable of containing none
|
||||
or single element of [/ any] type. It also provides methods for
|
||||
querying the type stored and retrieving the content of specific
|
||||
type.&]
|
||||
[s0; Any has pick semantics.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:Any`:`:Any`(`):%- [* Any]()&]
|
||||
[s2; Constructs an empty Any.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Any`(pick`_ Any`&`):%- [* Any]([@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Pick constructor. Transfers content of source [* Any] [%-*@3 s]
|
||||
while destroying its content by picking..&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:`~Any`(`):%- [@(0.0.255) `~][* Any]()&]
|
||||
[s2; Default destructor.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Upp`:`:Any`:`:Create`(Args`.`.`.args`):%- [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 T], [@(0.0.255) class...]_[*@4 Args]>_[*@4 T][@(0.0.255) `&]_[* Create]([*@4 Args][@(0.0.255) .
|
||||
..]_args)&]
|
||||
[s2; Creates content of type T inside Any. Additional parameters
|
||||
to constructor can be specified.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Is`(`)const:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[@(0.0.255) b
|
||||
ool]_[* Is]()_[@(0.0.255) const]&]
|
||||
[s2; Tests whether Any contains content of type T.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|true if there is content with type T in Any.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Get`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[*@4 T][@(0.0.255) `&
|
||||
]_[* Get]()&]
|
||||
[s2; Returns reference to content. Is<T> must be true, otherwise
|
||||
this operation is illegal.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|Reference to content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Get`(`)const:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[@(0.0.255) c
|
||||
onst]_[*@4 T][@(0.0.255) `&]_[* Get]()_[@(0.0.255) const]&]
|
||||
[s2; Returns constant reference to content. Is<T> must be true, otherwise
|
||||
this operation is illegal.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|Reference to content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes (and destroys) content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|true if there is no content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Any`:`:operator`=`(Upp`:`:Any`&`&`):%- [@(0.0.255) void]_[* operator`=]([_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&`&]_[*@3 s])&]
|
||||
[s2; Pick assignment.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Any`:`:Any`(Upp`:`:Any`&`&`):%- [* Any]([_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&`&]_[*@3 s])&]
|
||||
[s2; Pick constructor.&]
|
||||
topic "Any";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Any]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:Any`:`:class:%- [@(0.0.255) class]_[* Any]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <
|
||||
][* Any][@(0.0.255) >]&]
|
||||
[s9; Any is a special type of container capable of containing none
|
||||
or single element of [/ any] type. It also provides methods for
|
||||
querying the type stored and retrieving the content of specific
|
||||
type.&]
|
||||
[s0; Any has pick semantics.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:Any`:`:Any`(`):%- [* Any]()&]
|
||||
[s2; Constructs an empty Any.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Any`(pick`_ Any`&`):%- [* Any]([@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Pick constructor. Transfers content of source [* Any] [%-*@3 s]
|
||||
while destroying its content by picking..&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:`~Any`(`):%- [@(0.0.255) `~][* Any]()&]
|
||||
[s2; Default destructor.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Upp`:`:Any`:`:Create`(Args`.`.`.args`):%- [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 T], [@(0.0.255) class...]_[*@4 Args]>_[*@4 T][@(0.0.255) `&]_[* Create]([*@4 Args][@(0.0.255) .
|
||||
..]_args)&]
|
||||
[s2; Creates content of type T inside Any. Additional parameters
|
||||
to constructor can be specified.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Is`(`)const:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[@(0.0.255) b
|
||||
ool]_[* Is]()_[@(0.0.255) const]&]
|
||||
[s2; Tests whether Any contains content of type T.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|true if there is content with type T in Any.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Get`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[*@4 T][@(0.0.255) `&
|
||||
]_[* Get]()&]
|
||||
[s2; Returns reference to content. Is<T> must be true, otherwise
|
||||
this operation is illegal.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|Reference to content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Get`(`)const:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[@(0.0.255) c
|
||||
onst]_[*@4 T][@(0.0.255) `&]_[* Get]()_[@(0.0.255) const]&]
|
||||
[s2; Returns constant reference to content. Is<T> must be true, otherwise
|
||||
this operation is illegal.&]
|
||||
[s7; [*C@4 T]-|Required type.&]
|
||||
[s7; [*/ Return value]-|Reference to content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes (and destroys) content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Any`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|true if there is no content.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Any`:`:operator`=`(Upp`:`:Any`&`&`):%- [@(0.0.255) void]_[* operator`=]([_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&`&]_[*@3 s])&]
|
||||
[s2; Pick assignment.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Any`:`:Any`(Upp`:`:Any`&`&`):%- [* Any]([_^topic`:`/`/Core`/src`/Any`$en`-us`#Any`:`:class^ A
|
||||
ny][@(0.0.255) `&`&]_[*@3 s])&]
|
||||
[s2; Pick constructor.&]
|
||||
[s0; ]]
|
||||
|
|
@ -1,176 +1,176 @@
|
|||
topic "ArrayMap";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 ArrayMap]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 K][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 K][@(0.0.255)3 >][3 _>]&]
|
||||
[s1;:ArrayMap`:`:class:%- [@(0.0.255) class]_[* ArrayMap]_:_[@(0.0.255) public]_[*@3 MoveableA
|
||||
ndDeepCopyOption][@(0.0.255) <]_[* ArrayMap][@(0.0.255) <][*@4 K], [*@4 T],
|
||||
[*@4 HashFn][@(0.0.255) >]_>, [@(0.0.255) public]_[*@3 AMap][@(0.0.255) <]_[*@4 K],
|
||||
[*@4 T], [_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ Array][@(0.0.255) <][*@4 T
|
||||
][@(0.0.255) >], [*@4 HashFn]_>_&]
|
||||
[s8; [*@4 K]-|Type of keys. K must have deep copy constructor, be [/^dpp`:`/`/SourceDoc`/Containers`/Moveable^ m
|
||||
oveable] and must have operator`=`= defined.&]
|
||||
[s8; [*@4 T]-|Type or base class of the values stored in ArrayMap. There
|
||||
is no common requirement for T.&]
|
||||
[s8; [*@4 HashFn]-|Hashing class. Must have defined unsigned operator()(const
|
||||
K`& x) method returning hash value for elements.&]
|
||||
[s9; Array flavor of map. Inherits most of its functionality from
|
||||
[^topic`:`/`/Core`/src`/AMap`$en`-us^ AMap] and adds only members
|
||||
specific for its flavor.&]
|
||||
[s9; Like any other NTL container, ArrayMap 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
|
||||
a picked VectorMap is logic error with the exceptions of:&]
|
||||
[s0; &]
|
||||
[s0; [C+75 void ][*C+75 operator`=][C+75 (pick`_ ArrayMap`& ][*C@3+75 v][C+75 )
|
||||
][/+75 (defined by composition)]&]
|
||||
[s0; [C+75 void ][*C+75 operator<<`=][C+75 (const AMap`& ][*C@3+75 v][C+75 )][+75
|
||||
][/+75 (defined in AMap)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s9; Optional deep copy operator is inherited from AMap class. Pick
|
||||
operator is implicitly defined by composition.&]
|
||||
[s0; &]
|
||||
[s0;~~~.416; [* Base classes]&]
|
||||
[s0; [^topic`:`/`/Core`/src`/AMap`$en`-us`#AMap`:`:class^ AMap< K,
|
||||
T, Array<T>, HashFn >]&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(`):%- [* ArrayMap]()&]
|
||||
[s2; Default constructor. Creates empty ArrayMap.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:ArrayMap`(std`:`:initializer`_list`<std`:`:pair`<K`,T`>`>`):%- [* A
|
||||
rrayMap]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ st
|
||||
d`::initializer`_list]<[_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/pair^ st
|
||||
d`::pair]<[*@4 K], [*@4 T]>>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:operator`(`)`(const K`&`,const T`&`):%- [*_^Upp`:`:ArrayMap^ Ar
|
||||
rayMap][@(0.0.255) `&]_[* operator()]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&]_[*@3 k],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Same as Add([%-*@3 k], [%-*@3 v]), returns `*this. Syntax sugar
|
||||
for creating map.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(const ArrayMap`&`,int`):%- [* ArrayMap]([@(0.0.255) const]_[* Ar
|
||||
rayMap][@(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 if Array stores only objects of type T.&]
|
||||
[s6; Requires polymorphic deep copy if Array also stores objects
|
||||
of type derived from T.&]
|
||||
[s7; [*C@3 s]-|Source ArrayMap.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(pick`_ Index`<K`,HashFn`>`&`,pick`_ Array`<T`>`&`):%- [* Arr
|
||||
ayMap]([@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Indext`$en`-us`#Index`:`:class^ I
|
||||
ndex][@(0.0.255) <][*@4 K], [*@4 HashFn][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ A
|
||||
rray][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs ArrayMap from Index of keys and Array of values.
|
||||
The source containers should have equal number of elements.&]
|
||||
[s7; [*C@3 ndx]-|Source Index.&]
|
||||
[s7; [*C@3 val]-|Source Array.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(pick`_ Vector`<K`>`&`,pick`_ Array`<T`>`&`):%- [* ArrayMap](
|
||||
[@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Vector`$en`-us`#Vector`:`:class^ Vecto
|
||||
r][@(0.0.255) <][*@4 K][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ A
|
||||
rray][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs ArrayMap from Vector of keys and Array of values.
|
||||
The source containers should have equal number of elements.&]
|
||||
[s7; [*C@3 ndx]-|Source Index.&]
|
||||
[s7; [*C@3 val]-|Source Array.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`,const T`&`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) co
|
||||
nst]_[*@4 K][@(0.0.255) `&]_[*@3 k], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a key and value pair to the ArrayMap. This method has to
|
||||
be reimplemented in ArrayMap (using simple forwarding) due to
|
||||
overloading of Add in other forms.Returns a reference to the
|
||||
element.&]
|
||||
[s6; T must have deep copy constructor.&]
|
||||
[s6; Invalidates iterators to the ArrayMap.&]
|
||||
[s6; Invalidates references to keys.&]
|
||||
[s7; [*C@3 k]-|Key.&]
|
||||
[s7; [*C@3 x]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&
|
||||
]_[*@3 k])&]
|
||||
[s2; Adds a key to the ArrayMap and returns a reference to the corresponding
|
||||
default constructed value. This method has to be reimplemented
|
||||
in ArrayMap (using simple forwarding) due to overloading of [* Add]
|
||||
in other forms.&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s6; Invalidates iterators to the ArrayMap.&]
|
||||
[s6; Invalidates references to keys.&]
|
||||
[s7; [*@3 k]-|Key.&]
|
||||
[s7; [*/ Return value]-|Reference to value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`,T`*`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) const]_[*@4 K
|
||||
][@(0.0.255) `&]_[*@3 k], [*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Adds a key`-value pair to the ArrayMap. The value is specified
|
||||
by a pointer to the object. ArrayMap takes over ownership of
|
||||
this object. This variant allows use of ArrayMap as polymorphic
|
||||
container, because type of added element can be also derived
|
||||
from T as well. No constructor is applied.&]
|
||||
[s7; [*@3 k]-|Key.&]
|
||||
[s7; [%-*@3 newt]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:Create`(const K`&`,Args`.`.`.args`):%- [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 TT], [@(0.0.255) class...]_[*@4 Args]>_[*@4 TT][@(0.0.255) `&]_[* Create]([@(0.0.255) c
|
||||
onst]_[*@4 K][@(0.0.255) `&]_[*@3 k], [*@4 Args][@(0.0.255) ...]_args)&]
|
||||
[s2;%- [%% Adds a new key ][*@3 k][%% with value element of type ][*@4 TT][%%
|
||||
(must be derived from ][*@4 T]). Value is constructd in`-place,
|
||||
with args as constructor parameters.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Set`(int`,T`*`):%- [*@4 T][@(0.0.255) `&]_[* Set]([@(0.0.255) int]_[*@3 i],
|
||||
[*@4 T]_`*[*@3 ptr])&]
|
||||
[s2; Sets value at specified index. Value is specified by a pointer
|
||||
to the object. ArrayMap takes over ownership of this object.
|
||||
Returns a reference to the element.&]
|
||||
[s7; [*C@3 i]-|Index.&]
|
||||
[s7; [*C@3 ptr]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:PopDetach`(`):%- [*@4 T]_`*[* PopDetach]()&]
|
||||
[s2; Drops last element in the ArrayMap, giving up ownership of value.
|
||||
Client is responsible for deletion of the element.&]
|
||||
[s6; Invalidates iterators to ArrayMap.&]
|
||||
[s7; [* Return value]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Detach`(int`):%- [*@4 T]_`*[* Detach]([@(0.0.255) int]_[*@3 i])&]
|
||||
[s2; Removes element [%-*@3 i]. but does not destroy it `- the heap
|
||||
pointer to the element is returned. Client is responsible for
|
||||
deletion of the element.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Swap`(int`,T`*`):%- [*@4 T]_`*[* Swap]([@(0.0.255) int]_[*@3 i],
|
||||
[*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Sets element at [%-*@3 i] to [%-*@3 newt].and returns a pointer
|
||||
to original element. Client is responsible for deletion of the
|
||||
original element.&]
|
||||
[s3; &]
|
||||
topic "ArrayMap";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 ArrayMap]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 K][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 K][@(0.0.255)3 >][3 _>]&]
|
||||
[s1;:ArrayMap`:`:class:%- [@(0.0.255) class]_[* ArrayMap]_:_[@(0.0.255) public]_[*@3 MoveableA
|
||||
ndDeepCopyOption][@(0.0.255) <]_[* ArrayMap][@(0.0.255) <][*@4 K], [*@4 T],
|
||||
[*@4 HashFn][@(0.0.255) >]_>, [@(0.0.255) public]_[*@3 AMap][@(0.0.255) <]_[*@4 K],
|
||||
[*@4 T], [_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ Array][@(0.0.255) <][*@4 T
|
||||
][@(0.0.255) >], [*@4 HashFn]_>_&]
|
||||
[s8; [*@4 K]-|Type of keys. K must have deep copy constructor, be [/^dpp`:`/`/SourceDoc`/Containers`/Moveable^ m
|
||||
oveable] and must have operator`=`= defined.&]
|
||||
[s8; [*@4 T]-|Type or base class of the values stored in ArrayMap. There
|
||||
is no common requirement for T.&]
|
||||
[s8; [*@4 HashFn]-|Hashing class. Must have defined unsigned operator()(const
|
||||
K`& x) method returning hash value for elements.&]
|
||||
[s9; Array flavor of map. Inherits most of its functionality from
|
||||
[^topic`:`/`/Core`/src`/AMap`$en`-us^ AMap] and adds only members
|
||||
specific for its flavor.&]
|
||||
[s9; Like any other NTL container, ArrayMap 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
|
||||
a picked VectorMap is logic error with the exceptions of:&]
|
||||
[s0; &]
|
||||
[s0; [C+75 void ][*C+75 operator`=][C+75 (pick`_ ArrayMap`& ][*C@3+75 v][C+75 )
|
||||
][/+75 (defined by composition)]&]
|
||||
[s0; [C+75 void ][*C+75 operator<<`=][C+75 (const AMap`& ][*C@3+75 v][C+75 )][+75
|
||||
][/+75 (defined in AMap)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s9; Optional deep copy operator is inherited from AMap class. Pick
|
||||
operator is implicitly defined by composition.&]
|
||||
[s0; &]
|
||||
[s0;~~~.416; [* Base classes]&]
|
||||
[s0; [^topic`:`/`/Core`/src`/AMap`$en`-us`#AMap`:`:class^ AMap< K,
|
||||
T, Array<T>, HashFn >]&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(`):%- [* ArrayMap]()&]
|
||||
[s2; Default constructor. Creates empty ArrayMap.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:ArrayMap`(std`:`:initializer`_list`<std`:`:pair`<K`,T`>`>`):%- [* A
|
||||
rrayMap]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ st
|
||||
d`::initializer`_list]<[_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/pair^ st
|
||||
d`::pair]<[*@4 K], [*@4 T]>>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:operator`(`)`(const K`&`,const T`&`):%- [*_^Upp`:`:ArrayMap^ Ar
|
||||
rayMap][@(0.0.255) `&]_[* operator()]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&]_[*@3 k],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Same as Add([%-*@3 k], [%-*@3 v]), returns `*this. Syntax sugar
|
||||
for creating map.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(const ArrayMap`&`,int`):%- [* ArrayMap]([@(0.0.255) const]_[* Ar
|
||||
rayMap][@(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 if Array stores only objects of type T.&]
|
||||
[s6; Requires polymorphic deep copy if Array also stores objects
|
||||
of type derived from T.&]
|
||||
[s7; [*C@3 s]-|Source ArrayMap.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(pick`_ Index`<K`,HashFn`>`&`,pick`_ Array`<T`>`&`):%- [* Arr
|
||||
ayMap]([@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Indext`$en`-us`#Index`:`:class^ I
|
||||
ndex][@(0.0.255) <][*@4 K], [*@4 HashFn][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ A
|
||||
rray][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs ArrayMap from Index of keys and Array of values.
|
||||
The source containers should have equal number of elements.&]
|
||||
[s7; [*C@3 ndx]-|Source Index.&]
|
||||
[s7; [*C@3 val]-|Source Array.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:ArrayMap`(pick`_ Vector`<K`>`&`,pick`_ Array`<T`>`&`):%- [* ArrayMap](
|
||||
[@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Vector`$en`-us`#Vector`:`:class^ Vecto
|
||||
r][@(0.0.255) <][*@4 K][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^topic`:`/`/Core`/src`/Array`$en`-us`#Array`:`:class^ A
|
||||
rray][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs ArrayMap from Vector of keys and Array of values.
|
||||
The source containers should have equal number of elements.&]
|
||||
[s7; [*C@3 ndx]-|Source Index.&]
|
||||
[s7; [*C@3 val]-|Source Array.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`,const T`&`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) co
|
||||
nst]_[*@4 K][@(0.0.255) `&]_[*@3 k], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Adds a key and value pair to the ArrayMap. This method has to
|
||||
be reimplemented in ArrayMap (using simple forwarding) due to
|
||||
overloading of Add in other forms.Returns a reference to the
|
||||
element.&]
|
||||
[s6; T must have deep copy constructor.&]
|
||||
[s6; Invalidates iterators to the ArrayMap.&]
|
||||
[s6; Invalidates references to keys.&]
|
||||
[s7; [*C@3 k]-|Key.&]
|
||||
[s7; [*C@3 x]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&
|
||||
]_[*@3 k])&]
|
||||
[s2; Adds a key to the ArrayMap and returns a reference to the corresponding
|
||||
default constructed value. This method has to be reimplemented
|
||||
in ArrayMap (using simple forwarding) due to overloading of [* Add]
|
||||
in other forms.&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s6; Invalidates iterators to the ArrayMap.&]
|
||||
[s6; Invalidates references to keys.&]
|
||||
[s7; [*@3 k]-|Key.&]
|
||||
[s7; [*/ Return value]-|Reference to value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Add`(const K`&`,T`*`):%- [*@4 T][@(0.0.255) `&]_[* Add]([@(0.0.255) const]_[*@4 K
|
||||
][@(0.0.255) `&]_[*@3 k], [*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Adds a key`-value pair to the ArrayMap. The value is specified
|
||||
by a pointer to the object. ArrayMap takes over ownership of
|
||||
this object. This variant allows use of ArrayMap as polymorphic
|
||||
container, because type of added element can be also derived
|
||||
from T as well. No constructor is applied.&]
|
||||
[s7; [*@3 k]-|Key.&]
|
||||
[s7; [%-*@3 newt]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ArrayMap`:`:Create`(const K`&`,Args`.`.`.args`):%- [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 TT], [@(0.0.255) class...]_[*@4 Args]>_[*@4 TT][@(0.0.255) `&]_[* Create]([@(0.0.255) c
|
||||
onst]_[*@4 K][@(0.0.255) `&]_[*@3 k], [*@4 Args][@(0.0.255) ...]_args)&]
|
||||
[s2;%- [%% Adds a new key ][*@3 k][%% with value element of type ][*@4 TT][%%
|
||||
(must be derived from ][*@4 T]). Value is constructd in`-place,
|
||||
with args as constructor parameters.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Set`(int`,T`*`):%- [*@4 T][@(0.0.255) `&]_[* Set]([@(0.0.255) int]_[*@3 i],
|
||||
[*@4 T]_`*[*@3 ptr])&]
|
||||
[s2; Sets value at specified index. Value is specified by a pointer
|
||||
to the object. ArrayMap takes over ownership of this object.
|
||||
Returns a reference to the element.&]
|
||||
[s7; [*C@3 i]-|Index.&]
|
||||
[s7; [*C@3 ptr]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:PopDetach`(`):%- [*@4 T]_`*[* PopDetach]()&]
|
||||
[s2; Drops last element in the ArrayMap, giving up ownership of value.
|
||||
Client is responsible for deletion of the element.&]
|
||||
[s6; Invalidates iterators to ArrayMap.&]
|
||||
[s7; [* Return value]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Detach`(int`):%- [*@4 T]_`*[* Detach]([@(0.0.255) int]_[*@3 i])&]
|
||||
[s2; Removes element [%-*@3 i]. but does not destroy it `- the heap
|
||||
pointer to the element is returned. Client is responsible for
|
||||
deletion of the element.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ArrayMap`:`:Swap`(int`,T`*`):%- [*@4 T]_`*[* Swap]([@(0.0.255) int]_[*@3 i],
|
||||
[*@4 T]_`*[*@3 newt])&]
|
||||
[s2; Sets element at [%-*@3 i] to [%-*@3 newt].and returns a pointer
|
||||
to original element. Client is responsible for deletion of the
|
||||
original element.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,389 +1,389 @@
|
|||
topic "BiArray";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 BiArray]]}}&]
|
||||
[s3; &]
|
||||
[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.&]
|
||||
[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).&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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).&]
|
||||
[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.&]
|
||||
[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&]
|
||||
[s0; [C+75 void ][*C+75 operator`=][C+75 (pick`_ BiArray`& ][*C@3+75 v][C+75 )]&]
|
||||
[s0; [C+75 void ][*C+75 operator<<`=][C+75 (const BiArray`& ][*C@3+75 v][C+75 )][+75
|
||||
][/+75 (defined using DeepCopyOptionTemplate)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s9; Optional deep copy is implemented through DeepCopyOptionTemplate
|
||||
macro.&]
|
||||
[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;:Upp`:`:BiArray`:`:BiArray`(std`:`:initializer`_list`<T`>`):%- [* BiArray]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*/ Return value]-|Reference to the newly added default constructed
|
||||
element.&]
|
||||
[s0;3 &]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:AddHeadPick`(T`&`&`):%- [@(0.0.255) void]_[* AddHeadPick]([*@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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:AddTailPick`(T`&`&`):%- [@(0.0.255) void]_[* AddTailPick]([*@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.&]
|
||||
[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,
|
||||
because the type of added element can also be derived from T
|
||||
as well. No constructor is applied. The new element will be at
|
||||
position 0.&]
|
||||
[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 &]
|
||||
[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
|
||||
container, because the type of added element can also be derived
|
||||
from T as well. No constructor is applied. The new element will
|
||||
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].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:CreateHead`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>
|
||||
_[*@4 TT][@(0.0.255) `&]_[* CreateHead]()&]
|
||||
[s2; Creates a new element of type [%-*@4 TT] at the head.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:CreateTail`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>
|
||||
_[*@4 TT][@(0.0.255) `&]_[* CreateTail]()&]
|
||||
[s2; Creates a new element of type [%-*@4 TT] at the tail.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes all elements from the BiArray.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Shrink`(`):%- [@(0.0.255) void]_[* Shrink]()&]
|
||||
[s2; Minimizes memory consumption of the BiArray by minimizing capacity.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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
|
||||
a reference to the BiArray it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiArray as part of an expression like Foo(BiArray<int>() << 1
|
||||
<< 2 << 4).&]
|
||||
[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.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[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
|
||||
a reference to the BiArray it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiArray as part of an expression like Foo(1 >> (2 >> BiArray<int>())).&]
|
||||
[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.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:BiArray`(const Upp`:`:BiArray`&`,int`):%- [* BiArray]([@(0.0.255) c
|
||||
onst]_[* BiArray][@(0.0.255) `&]_[*@3 v], [@(0.0.255) int])&]
|
||||
[s2; Optional deep copy constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:BiArray`(Upp`:`:BiArray`&`&`):%- [* BiArray]([* BiArray][@(0.0.255) `&
|
||||
`&]_[*@3 src])&]
|
||||
[s2; Pick constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:operator`=`(Upp`:`:BiArray`&`&`):%- [@(0.0.255) void]_[* operator`=
|
||||
]([_^Upp`:`:BiArray^ BiArray][@(0.0.255) `&`&]_[*@3 src])&]
|
||||
[s2; Pick assignment.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:ValueType`:`:typedef:%- [@(0.0.255) typedef]_T_[* ValueType]&]
|
||||
[s2; Typedef of T for use in templated algorithms.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Iterator`:`:typedef:%- [@(0.0.255) typedef]_[_^IIterator^ IIterator][@(0.0.255) <
|
||||
][_^BiArray^ BiArray][@(0.0.255) >]_[* Iterator]&]
|
||||
[s2; Iterator type.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.-|&]
|
||||
[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.&]
|
||||
[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; [*@3 a]-|First BiArray to swap.&]
|
||||
[s7; [*@3 b]-|Second BiArray to swap.&]
|
||||
[s3; &]
|
||||
topic "BiArray";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 BiArray]]}}&]
|
||||
[s3; &]
|
||||
[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.&]
|
||||
[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).&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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).&]
|
||||
[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.&]
|
||||
[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&]
|
||||
[s0; [C+75 void ][*C+75 operator`=][C+75 (pick`_ BiArray`& ][*C@3+75 v][C+75 )]&]
|
||||
[s0; [C+75 void ][*C+75 operator<<`=][C+75 (const BiArray`& ][*C@3+75 v][C+75 )][+75
|
||||
][/+75 (defined using DeepCopyOptionTemplate)]&]
|
||||
[s0; [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0; [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s9; Optional deep copy is implemented through DeepCopyOptionTemplate
|
||||
macro.&]
|
||||
[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;:Upp`:`:BiArray`:`:BiArray`(std`:`:initializer`_list`<T`>`):%- [* BiArray]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s6; Invalidates iterators to the BiArray.&]
|
||||
[s7; [*/ Return value]-|Reference to the newly added default constructed
|
||||
element.&]
|
||||
[s0;3 &]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:AddHeadPick`(T`&`&`):%- [@(0.0.255) void]_[* AddHeadPick]([*@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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:AddTailPick`(T`&`&`):%- [@(0.0.255) void]_[* AddTailPick]([*@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.&]
|
||||
[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,
|
||||
because the type of added element can also be derived from T
|
||||
as well. No constructor is applied. The new element will be at
|
||||
position 0.&]
|
||||
[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 &]
|
||||
[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
|
||||
container, because the type of added element can also be derived
|
||||
from T as well. No constructor is applied. The new element will
|
||||
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].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:CreateHead`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>
|
||||
_[*@4 TT][@(0.0.255) `&]_[* CreateHead]()&]
|
||||
[s2; Creates a new element of type [%-*@4 TT] at the head.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:CreateTail`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>
|
||||
_[*@4 TT][@(0.0.255) `&]_[* CreateTail]()&]
|
||||
[s2; Creates a new element of type [%-*@4 TT] at the tail.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes all elements from the BiArray.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Shrink`(`):%- [@(0.0.255) void]_[* Shrink]()&]
|
||||
[s2; Minimizes memory consumption of the BiArray by minimizing capacity.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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
|
||||
a reference to the BiArray it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiArray as part of an expression like Foo(BiArray<int>() << 1
|
||||
<< 2 << 4).&]
|
||||
[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.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[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
|
||||
a reference to the BiArray it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiArray as part of an expression like Foo(1 >> (2 >> BiArray<int>())).&]
|
||||
[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.&]
|
||||
[s7; [*/ Return value]-|Reference to the BiArray (that is `*this).&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:BiArray`(const Upp`:`:BiArray`&`,int`):%- [* BiArray]([@(0.0.255) c
|
||||
onst]_[* BiArray][@(0.0.255) `&]_[*@3 v], [@(0.0.255) int])&]
|
||||
[s2; Optional deep copy constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:BiArray`(Upp`:`:BiArray`&`&`):%- [* BiArray]([* BiArray][@(0.0.255) `&
|
||||
`&]_[*@3 src])&]
|
||||
[s2; Pick constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiArray`:`:operator`=`(Upp`:`:BiArray`&`&`):%- [@(0.0.255) void]_[* operator`=
|
||||
]([_^Upp`:`:BiArray^ BiArray][@(0.0.255) `&`&]_[*@3 src])&]
|
||||
[s2; Pick assignment.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:ValueType`:`:typedef:%- [@(0.0.255) typedef]_T_[* ValueType]&]
|
||||
[s2; Typedef of T for use in templated algorithms.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiArray`:`:Iterator`:`:typedef:%- [@(0.0.255) typedef]_[_^IIterator^ IIterator][@(0.0.255) <
|
||||
][_^BiArray^ BiArray][@(0.0.255) >]_[* Iterator]&]
|
||||
[s2; Iterator type.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.&]
|
||||
[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.-|&]
|
||||
[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.&]
|
||||
[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; [*@3 a]-|First BiArray to swap.&]
|
||||
[s7; [*@3 b]-|Second BiArray to swap.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,290 +1,290 @@
|
|||
topic "BiVector";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 BiVector]]}}&]
|
||||
[s3; &]
|
||||
[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) >]_>_&]
|
||||
[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.&]
|
||||
[s0;# &]
|
||||
[s0; Like any other NTL container, BiVector 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 a BiVector is logic error with the exceptions of:&]
|
||||
[s0;%- [C+75 void ][*C+75 operator`=][C+75 (pick`_ Vector`& ][*C@3+75 v][C+75 )]&]
|
||||
[s0;%- [C+75 void ][*C+75 operator<<`=][C+75 (const Vector`& ][*C@3+75 v][C+75 )
|
||||
][/C+75 (defined using DeepCopyOptionTemplate)]&]
|
||||
[s0;%- [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0;%- [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s0;C+75%- &]
|
||||
[s0; Optional deep copy is implemented through [* DeepCopyOptionTemplate]
|
||||
macro.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:BiVector`:`:BiVector`(`):%- [* BiVector]()&]
|
||||
[s2; Default constructor. Creates an empty [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:BiVector`(Upp`:`:BiVector`&`&`):%- [* BiVector]([* BiVector][@(0.0.255) `&
|
||||
`&]_[*@3 src])&]
|
||||
[s2; Pick constructor. Transfers source [* BiVector ][%-*@3 src ]in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:operator`=`(Upp`:`:BiVector`&`&`):%- [@(0.0.255) void]_[* operato
|
||||
r`=]([_^Upp`:`:BiVector^ BiVector][@(0.0.255) `&`&]_[*@3 src])&]
|
||||
[s2; Pick assignment. Transfers source [* BiVector ][%-*@3 src ]in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:BiVector`(const BiVector`&`,int`):%- [* BiVector]([@(0.0.255) const]_[* Bi
|
||||
Vector][@(0.0.255) `&]_[*@3 src], [@(0.0.255) int])&]
|
||||
[s2; Optional deep copy constructor. Creates a deep copy of [%-*@3 src].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:BiVector`(std`:`:initializer`_list`<T`>`):%- [* BiVector]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:`~BiVector`(`):%- [@(0.0.255) `~][* BiVector]()&]
|
||||
[s2; Default destructor. Invokes the destructor of every element
|
||||
in the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:BiVector`:`:AddHead`(`):%- [*@4 T][@(0.0.255) `&]_[* AddHead]()&]
|
||||
[s2; Adds a new default constructed element at the head of the [* BiVector].
|
||||
The new element will be at position 0. Returns reference to the
|
||||
newly added default constructed element.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:AddTail`(`):%- [*@4 T][@(0.0.255) `&]_[* AddTail]()&]
|
||||
[s2; Adds a new default constructed element at the tail of the [* BiVector].
|
||||
The new element will be at position [* GetCount]() `- 1. Returns
|
||||
reference to the newly added default constructed element.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`: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 [%-*@3 x ]at the head
|
||||
of the [* BiVector]. The new element will be at position 0.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`: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 [%-*@3 x ]at the tail
|
||||
of the [* BiVector]. The new element will be at position [* GetCount]()
|
||||
`- 1.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:AddHeadPick`(T`&`&`):%- [@(0.0.255) void]_[* AddHeadPick]([*@4 T][@(0.0.255) `&
|
||||
`&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the head of the [* BiVector] and picks value
|
||||
of the parameter [%-*@3 x]. The new element will be at position
|
||||
0.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s2; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:AddTailPick`(T`&`&`):%- [@(0.0.255) void]_[* AddTailPick]([*@4 T][@(0.0.255) `&
|
||||
`&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the tail of the [* BiVector] and picks value
|
||||
of the parameter [%-*@3 x]. The new element will be at position
|
||||
[* GetCount]() `- 1.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s2; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Head`(`):%- [*@4 T][@(0.0.255) `&]_[* Head]()&]
|
||||
[s2; Returns a reference to the head of the [* BiVector] . Same as
|
||||
operator`[`](0).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Tail`(`):%- [*@4 T][@(0.0.255) `&]_[* Tail]()&]
|
||||
[s2; Returns a reference to the tail of the [* BiVector] . Same as
|
||||
operator`[`]([* GetCount]() `- 1).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Head`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Head]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a [* const] reference to the head of the [* BiVector] .
|
||||
Same as operator`[`](0).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Tail`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Tail]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a [* const ]reference to the tail of the [* BiVector] .
|
||||
Same as operator`[`]([* GetCount]() `- 1).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:DropHead`(`):%- [@(0.0.255) void]_[* DropHead]()&]
|
||||
[s2; Removes the element at the head of the [* BiVector].&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:DropTail`(`):%- [@(0.0.255) void]_[* DropTail]()&]
|
||||
[s2; Removes the element at the tail of the [* BiVector].&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`[`]`(int`):%- [*@4 T][@(0.0.255) `&]_[* operator`[`]]([@(0.0.255) i
|
||||
nt]_[*@3 i])&]
|
||||
[s2; Returns a reference to the element at the specified position
|
||||
[%-*@3 i].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`[`]`(int`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* ope
|
||||
rator`[`]]([@(0.0.255) int]_[*@3 i])_[@(0.0.255) const]&]
|
||||
[s2; Returns a [* const] reference to the element at the specified
|
||||
position [%-*@3 i].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetCount`(`)const:%- [@(0.0.255) int]_[* GetCount]()_[@(0.0.255) const]&]
|
||||
[s2; Returns the number of elements in the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s2; Tests whether the [* BiVector ]is empty. Same as [* GetCount]()
|
||||
`=`= 0.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes all elements from the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Shrink`(`):%- [@(0.0.255) void]_[* Shrink]()&]
|
||||
[s2; Minimizes memory consumption of the [* BiVector ]by minimizing
|
||||
capacity.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Reserve`(int`):%- [@(0.0.255) void]_[* Reserve]([@(0.0.255) int]_[*@3 n])&]
|
||||
[s2; Reserves capacity. If required capacity [%-*@3 n ]is greater than
|
||||
the current capacity, capacity is increased to the required value.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetAlloc`(`)const:%- [@(0.0.255) int]_[* GetAlloc]()_[@(0.0.255) const]&]
|
||||
[s2; Returns current capacity of the [* BiVector].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Serialize`(Stream`&`):%- [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream
|
||||
][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Serializes content of the [* BiVector ]to/from the Stream [%-*@3 s].&]
|
||||
[s6; Requires T to have serialization operator defined.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:IsPicked`(`):%- [@(0.0.255) bool]_[* IsPicked]()&]
|
||||
[s2; Returns [* true ]if [* BiVector ]has been picked, false otherwise.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`=`(pick`_ BiVector`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p
|
||||
ick`_]_[_^BiVector^ BiVector][@(0.0.255) `&]_[*@3 src])&]
|
||||
[s2; Pick operator. Transfers source [* BiVector ][%-*@3 src] in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:ValueType`:`:typedef:%- [@(0.0.255) typedef]_[*@4 T]_[* ValueType]&]
|
||||
[s2; Typedef of [*@4 T] for use in templated algorithms.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Iterator`:`:typedef:%- [@(0.0.255) typedef]_[_^IIterator^ IIterator][@(0.0.255) <
|
||||
][_^BiVector^ BiVector][@(0.0.255) >]_[* Iterator]&]
|
||||
[s2; Iterator type.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:ConstIterator`:`:typedef:%- [@(0.0.255) typedef]_[_^ConstIIterator^ Cons
|
||||
tIIterator][@(0.0.255) <][_^BiVector^ BiVector][@(0.0.255) >]_[* ConstIterator]&]
|
||||
[s2; Constant iterator type.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Begin`(`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* Begin](
|
||||
)_[@(0.0.255) const]&]
|
||||
[s7; Returns a constant iterator to the first element in the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:End`(`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* End]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a constant iterator to the position just beyond the
|
||||
last element in the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetIter`(int`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* G
|
||||
etIter]([@(0.0.255) int]_[*@3 pos])_[@(0.0.255) const]&]
|
||||
[s2; Returns a constant iterator to the element at the specified
|
||||
position [%-*@3 pos]. Same as [* Begin() `+ ][%-*@3 pos]. The benefit
|
||||
of this method is that [%-*@3 pos] is range checked in debug mode.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Begin`(`):%- [_^BiVector`:`:Iterator^ Iterator]_[* Begin]()&]
|
||||
[s2; Returns a non`-constant iterator to the first element in the
|
||||
[* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:End`(`):%- [_^BiVector`:`:Iterator^ Iterator]_[* End]()&]
|
||||
[s2; Returns non`-constant iterator to the position just beyond the
|
||||
last element in the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetIter`(int`):%- [_^BiVector`:`: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.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;K%- friend_[@(0.0.255) void][@(64) _]Swap[@(64) (][^`:`:BiVector^@(64) BiVector][@(64) `&_][@3 a
|
||||
][@(64) , ][^`:`:BiVector^@(64) BiVector][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s2; Specialization of the generic [* Swap] for BiVectors. Swaps BiVectors
|
||||
in low constant time operation.&]
|
||||
[s3; &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global Operators]]}}&]
|
||||
[s3; &]
|
||||
[s0;:friend BiVector`& operator`<`<`(BiVector`& b`, const T`& x`): friend
|
||||
BiVector`& [* operator]<<(BiVector`& [*@3 b], const T`& [*@3 x])&]
|
||||
[s2; Operator replacement of [* void AddTail(const T`&x)]. By returning
|
||||
a reference to the BiVector it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiVector as part of an expression like Foo(BiVector<int>() <<
|
||||
1 << 2 << 4).&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:friend BiVector`& operator`>`>`(const T`& x`, BiVector`& b`): friend
|
||||
BiVector`& [* operator]>>(const T`& [*@3 x], BiVector`& [*@3 b])&]
|
||||
[s2; Operator replacement of [* void AddHead(const T`&x)]. By returning
|
||||
a reference to the BiVector it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiVector as part of an expression like Foo(1 >> (2 >> BiVector<int>())).&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
topic "BiVector";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 BiVector]]}}&]
|
||||
[s3; &]
|
||||
[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) >]_>_&]
|
||||
[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.&]
|
||||
[s0;# &]
|
||||
[s0; Like any other NTL container, BiVector 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 a BiVector is logic error with the exceptions of:&]
|
||||
[s0;%- [C+75 void ][*C+75 operator`=][C+75 (pick`_ Vector`& ][*C@3+75 v][C+75 )]&]
|
||||
[s0;%- [C+75 void ][*C+75 operator<<`=][C+75 (const Vector`& ][*C@3+75 v][C+75 )
|
||||
][/C+75 (defined using DeepCopyOptionTemplate)]&]
|
||||
[s0;%- [C+75 void ][*C+75 Clear][C+75 ()]&]
|
||||
[s0;%- [C+75 bool ][*C+75 IsPicked][C+75 () const]&]
|
||||
[s0;C+75%- &]
|
||||
[s0; Optional deep copy is implemented through [* DeepCopyOptionTemplate]
|
||||
macro.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:BiVector`:`:BiVector`(`):%- [* BiVector]()&]
|
||||
[s2; Default constructor. Creates an empty [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:BiVector`(Upp`:`:BiVector`&`&`):%- [* BiVector]([* BiVector][@(0.0.255) `&
|
||||
`&]_[*@3 src])&]
|
||||
[s2; Pick constructor. Transfers source [* BiVector ][%-*@3 src ]in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:operator`=`(Upp`:`:BiVector`&`&`):%- [@(0.0.255) void]_[* operato
|
||||
r`=]([_^Upp`:`:BiVector^ BiVector][@(0.0.255) `&`&]_[*@3 src])&]
|
||||
[s2; Pick assignment. Transfers source [* BiVector ][%-*@3 src ]in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:BiVector`(const BiVector`&`,int`):%- [* BiVector]([@(0.0.255) const]_[* Bi
|
||||
Vector][@(0.0.255) `&]_[*@3 src], [@(0.0.255) int])&]
|
||||
[s2; Optional deep copy constructor. Creates a deep copy of [%-*@3 src].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:BiVector`(std`:`:initializer`_list`<T`>`):%- [* BiVector]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:`~BiVector`(`):%- [@(0.0.255) `~][* BiVector]()&]
|
||||
[s2; Default destructor. Invokes the destructor of every element
|
||||
in the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:BiVector`:`:AddHead`(`):%- [*@4 T][@(0.0.255) `&]_[* AddHead]()&]
|
||||
[s2; Adds a new default constructed element at the head of the [* BiVector].
|
||||
The new element will be at position 0. Returns reference to the
|
||||
newly added default constructed element.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:AddTail`(`):%- [*@4 T][@(0.0.255) `&]_[* AddTail]()&]
|
||||
[s2; Adds a new default constructed element at the tail of the [* BiVector].
|
||||
The new element will be at position [* GetCount]() `- 1. Returns
|
||||
reference to the newly added default constructed element.&]
|
||||
[s6; Requires T to have default constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`: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 [%-*@3 x ]at the head
|
||||
of the [* BiVector]. The new element will be at position 0.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`: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 [%-*@3 x ]at the tail
|
||||
of the [* BiVector]. The new element will be at position [* GetCount]()
|
||||
`- 1.&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:AddHeadPick`(T`&`&`):%- [@(0.0.255) void]_[* AddHeadPick]([*@4 T][@(0.0.255) `&
|
||||
`&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the head of the [* BiVector] and picks value
|
||||
of the parameter [%-*@3 x]. The new element will be at position
|
||||
0.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s2; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:BiVector`:`:AddTailPick`(T`&`&`):%- [@(0.0.255) void]_[* AddTailPick]([*@4 T][@(0.0.255) `&
|
||||
`&]_[*@3 x])&]
|
||||
[s2; Adds a new element at the tail of the [* BiVector] and picks value
|
||||
of the parameter [%-*@3 x]. The new element will be at position
|
||||
[* GetCount]() `- 1.&]
|
||||
[s6; Requires T to have pick constructor.&]
|
||||
[s2; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Head`(`):%- [*@4 T][@(0.0.255) `&]_[* Head]()&]
|
||||
[s2; Returns a reference to the head of the [* BiVector] . Same as
|
||||
operator`[`](0).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Tail`(`):%- [*@4 T][@(0.0.255) `&]_[* Tail]()&]
|
||||
[s2; Returns a reference to the tail of the [* BiVector] . Same as
|
||||
operator`[`]([* GetCount]() `- 1).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Head`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Head]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a [* const] reference to the head of the [* BiVector] .
|
||||
Same as operator`[`](0).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Tail`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* Tail]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a [* const ]reference to the tail of the [* BiVector] .
|
||||
Same as operator`[`]([* GetCount]() `- 1).&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:DropHead`(`):%- [@(0.0.255) void]_[* DropHead]()&]
|
||||
[s2; Removes the element at the head of the [* BiVector].&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:DropTail`(`):%- [@(0.0.255) void]_[* DropTail]()&]
|
||||
[s2; Removes the element at the tail of the [* BiVector].&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`[`]`(int`):%- [*@4 T][@(0.0.255) `&]_[* operator`[`]]([@(0.0.255) i
|
||||
nt]_[*@3 i])&]
|
||||
[s2; Returns a reference to the element at the specified position
|
||||
[%-*@3 i].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`[`]`(int`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* ope
|
||||
rator`[`]]([@(0.0.255) int]_[*@3 i])_[@(0.0.255) const]&]
|
||||
[s2; Returns a [* const] reference to the element at the specified
|
||||
position [%-*@3 i].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetCount`(`)const:%- [@(0.0.255) int]_[* GetCount]()_[@(0.0.255) const]&]
|
||||
[s2; Returns the number of elements in the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s2; Tests whether the [* BiVector ]is empty. Same as [* GetCount]()
|
||||
`=`= 0.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes all elements from the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Shrink`(`):%- [@(0.0.255) void]_[* Shrink]()&]
|
||||
[s2; Minimizes memory consumption of the [* BiVector ]by minimizing
|
||||
capacity.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Reserve`(int`):%- [@(0.0.255) void]_[* Reserve]([@(0.0.255) int]_[*@3 n])&]
|
||||
[s2; Reserves capacity. If required capacity [%-*@3 n ]is greater than
|
||||
the current capacity, capacity is increased to the required value.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetAlloc`(`)const:%- [@(0.0.255) int]_[* GetAlloc]()_[@(0.0.255) const]&]
|
||||
[s2; Returns current capacity of the [* BiVector].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Serialize`(Stream`&`):%- [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream
|
||||
][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Serializes content of the [* BiVector ]to/from the Stream [%-*@3 s].&]
|
||||
[s6; Requires T to have serialization operator defined.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:IsPicked`(`):%- [@(0.0.255) bool]_[* IsPicked]()&]
|
||||
[s2; Returns [* true ]if [* BiVector ]has been picked, false otherwise.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:operator`=`(pick`_ BiVector`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p
|
||||
ick`_]_[_^BiVector^ BiVector][@(0.0.255) `&]_[*@3 src])&]
|
||||
[s2; Pick operator. Transfers source [* BiVector ][%-*@3 src] in low
|
||||
constant time, but destroys it by picking.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:ValueType`:`:typedef:%- [@(0.0.255) typedef]_[*@4 T]_[* ValueType]&]
|
||||
[s2; Typedef of [*@4 T] for use in templated algorithms.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Iterator`:`:typedef:%- [@(0.0.255) typedef]_[_^IIterator^ IIterator][@(0.0.255) <
|
||||
][_^BiVector^ BiVector][@(0.0.255) >]_[* Iterator]&]
|
||||
[s2; Iterator type.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:ConstIterator`:`:typedef:%- [@(0.0.255) typedef]_[_^ConstIIterator^ Cons
|
||||
tIIterator][@(0.0.255) <][_^BiVector^ BiVector][@(0.0.255) >]_[* ConstIterator]&]
|
||||
[s2; Constant iterator type.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Begin`(`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* Begin](
|
||||
)_[@(0.0.255) const]&]
|
||||
[s7; Returns a constant iterator to the first element in the BiVector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:End`(`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* End]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2; Returns a constant iterator to the position just beyond the
|
||||
last element in the BiVector.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetIter`(int`)const:%- [_^BiVector`:`:ConstIterator^ ConstIterator]_[* G
|
||||
etIter]([@(0.0.255) int]_[*@3 pos])_[@(0.0.255) const]&]
|
||||
[s2; Returns a constant iterator to the element at the specified
|
||||
position [%-*@3 pos]. Same as [* Begin() `+ ][%-*@3 pos]. The benefit
|
||||
of this method is that [%-*@3 pos] is range checked in debug mode.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:Begin`(`):%- [_^BiVector`:`:Iterator^ Iterator]_[* Begin]()&]
|
||||
[s2; Returns a non`-constant iterator to the first element in the
|
||||
[* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:End`(`):%- [_^BiVector`:`:Iterator^ Iterator]_[* End]()&]
|
||||
[s2; Returns non`-constant iterator to the position just beyond the
|
||||
last element in the [* BiVector].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:BiVector`:`:GetIter`(int`):%- [_^BiVector`:`: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.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;K%- friend_[@(0.0.255) void][@(64) _]Swap[@(64) (][^`:`:BiVector^@(64) BiVector][@(64) `&_][@3 a
|
||||
][@(64) , ][^`:`:BiVector^@(64) BiVector][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s2; Specialization of the generic [* Swap] for BiVectors. Swaps BiVectors
|
||||
in low constant time operation.&]
|
||||
[s3; &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global Operators]]}}&]
|
||||
[s3; &]
|
||||
[s0;:friend BiVector`& operator`<`<`(BiVector`& b`, const T`& x`): friend
|
||||
BiVector`& [* operator]<<(BiVector`& [*@3 b], const T`& [*@3 x])&]
|
||||
[s2; Operator replacement of [* void AddTail(const T`&x)]. By returning
|
||||
a reference to the BiVector it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiVector as part of an expression like Foo(BiVector<int>() <<
|
||||
1 << 2 << 4).&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:friend BiVector`& operator`>`>`(const T`& x`, BiVector`& b`): friend
|
||||
BiVector`& [* operator]>>(const T`& [*@3 x], BiVector`& [*@3 b])&]
|
||||
[s2; Operator replacement of [* void AddHead(const T`&x)]. By returning
|
||||
a reference to the BiVector it allows adding more elements in
|
||||
a single expression, thus e.g. allowing to construct a temporary
|
||||
BiVector as part of an expression like Foo(1 >> (2 >> BiVector<int>())).&]
|
||||
[s6; Requires T to have deep copy constructor.&]
|
||||
[s6; Invalidates iterators and references to the BiVector.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,114 +1,114 @@
|
|||
topic "Buffer";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Buffer]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Buffer`:`:class:%- [@(0.0.255) class]_[* Buffer]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <
|
||||
]_[* Buffer][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s0;%- &]
|
||||
[s0; [%-*C@4 T]-|Type of elements stored in Buffer.&]
|
||||
[s0; &]
|
||||
[s0; Buffer is a simple class used to manage a fixed size plain old
|
||||
C dynamically allocated vector of elements of a specified type.
|
||||
The size of the buffer is specified as a constructor parameter
|
||||
and it can be also reallocated with new size, while loosing all
|
||||
current data.&]
|
||||
[s0; &]
|
||||
[s0; Buffer is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/
|
||||
]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick] (only)
|
||||
transfer semantics. Calling methods of picked Buffer is logic
|
||||
error with the exceptions of:&]
|
||||
[s0; [C+75 void Alloc(int size);]&]
|
||||
[s0; [C+75 void Alloc(int size, const T`& in);]&]
|
||||
[s0; [C+75 void Clear();]&]
|
||||
[s0; [C+75 void operator`=(pick`_ Buffer`& v);]&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Buffer`:`:Buffer`(`):%- [* Buffer]()&]
|
||||
[s2; Constructs an empty buffer.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(size`_t`):%- [* Buffer](size`_t_[*@3 size])&]
|
||||
[s2; Constructs the Buffer with a [%-*@3 size][%- number of elements].&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(size`_t`,const T`&`):%- [* Buffer](size`_t_[*@3 size],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 init])&]
|
||||
[s2; Constructs the Buffer initializing the [%-@3 size ]elements to
|
||||
the specified value [%-@3 init].&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(pick`_ Buffer`&`):%- [* Buffer]([@(0.128.128) pick`_]_[* Buffer][@(0.0.255) `&
|
||||
]_[*@3 v])&]
|
||||
[s2;%- [%% Pick constructor. Destroys source container ][*@3 v.]&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:`~Buffer`(`):%- [@(0.0.255) `~][* Buffer]()&]
|
||||
[s2; Default destructor.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Buffer`:`:Buffer`(size`_t`,std`:`:initializer`_list`<T`>`):%- [* Buffer](si
|
||||
ze`_t_[*@3 size], [_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s5;:Upp`:`:Buffer`:`:Buffer`(std`:`:initializer`_list`<T`>`):%- [* Buffer]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Buffer`:`:operator`=`(pick`_ Buffer`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p
|
||||
ick`_]_[_^Buffer^ Buffer][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Pick operator. Source buffer [%-*@3 v ]is destroyed.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:operator T`*`(`):%- [* operator_T`*]()&]
|
||||
[s5;:Buffer`:`:operator const T`*`(`)const:%- [* operator_const_T`*]()_[@(0.0.255) const]&]
|
||||
[s5;:Buffer`:`:operator`~`(`):%- [*@4 T]_`*[* operator`~]()&]
|
||||
[s5;:Buffer`:`:operator`~`(`)const:%- [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s5;:Upp`:`:Buffer`:`:Get`(`):%- [*@4 T]_`*[* Get]()&]
|
||||
[s5;:Upp`:`:Buffer`:`:Get`(`)const:%- [@(0.0.255) const]_[*@4 T]_`*[* Get]()_[@(0.0.255) cons
|
||||
t]&]
|
||||
[s2; Returns a pointer to the first element of the Buffer or NULL
|
||||
if the Buffer is empty.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Alloc`(size`_t`):%- [@(0.0.255) void]_[* Alloc](size`_t_[*@3 size])&]
|
||||
[s2; Clears the buffer and allocates it with the new size [%-*@3 size].
|
||||
All current elements are lost.&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Alloc`(size`_t`,const T`&`):%- [@(0.0.255) void]_[* Alloc](size`_t_[*@3 size
|
||||
], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 in])&]
|
||||
[s2; Clears the buffer and allocates it with the new size [%-*@3 size],
|
||||
using the initialization value [%-*@3 in]. All current elements
|
||||
are lost.&]
|
||||
[s6; T must have deep copy constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Clears the buffer to the same state as default constructor.
|
||||
All current elements are destroyed.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Buffer`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const
|
||||
]&]
|
||||
[s2; Returns true if Buffer is empty.&]
|
||||
[s3;%- &]
|
||||
topic "Buffer";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Buffer]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Buffer`:`:class:%- [@(0.0.255) class]_[* Buffer]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <
|
||||
]_[* Buffer][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s0;%- &]
|
||||
[s0; [%-*C@4 T]-|Type of elements stored in Buffer.&]
|
||||
[s0; &]
|
||||
[s0; Buffer is a simple class used to manage a fixed size plain old
|
||||
C dynamically allocated vector of elements of a specified type.
|
||||
The size of the buffer is specified as a constructor parameter
|
||||
and it can be also reallocated with new size, while loosing all
|
||||
current data.&]
|
||||
[s0; &]
|
||||
[s0; Buffer is a [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/
|
||||
]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick] (only)
|
||||
transfer semantics. Calling methods of picked Buffer is logic
|
||||
error with the exceptions of:&]
|
||||
[s0; [C+75 void Alloc(int size);]&]
|
||||
[s0; [C+75 void Alloc(int size, const T`& in);]&]
|
||||
[s0; [C+75 void Clear();]&]
|
||||
[s0; [C+75 void operator`=(pick`_ Buffer`& v);]&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Buffer`:`:Buffer`(`):%- [* Buffer]()&]
|
||||
[s2; Constructs an empty buffer.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(size`_t`):%- [* Buffer](size`_t_[*@3 size])&]
|
||||
[s2; Constructs the Buffer with a [%-*@3 size][%- number of elements].&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(size`_t`,const T`&`):%- [* Buffer](size`_t_[*@3 size],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 init])&]
|
||||
[s2; Constructs the Buffer initializing the [%-@3 size ]elements to
|
||||
the specified value [%-@3 init].&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Buffer`(pick`_ Buffer`&`):%- [* Buffer]([@(0.128.128) pick`_]_[* Buffer][@(0.0.255) `&
|
||||
]_[*@3 v])&]
|
||||
[s2;%- [%% Pick constructor. Destroys source container ][*@3 v.]&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:`~Buffer`(`):%- [@(0.0.255) `~][* Buffer]()&]
|
||||
[s2; Default destructor.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Buffer`:`:Buffer`(size`_t`,std`:`:initializer`_list`<T`>`):%- [* Buffer](si
|
||||
ze`_t_[*@3 size], [_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s5;:Upp`:`:Buffer`:`:Buffer`(std`:`:initializer`_list`<T`>`):%- [* Buffer]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[*@4 T]>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Buffer`:`:operator`=`(pick`_ Buffer`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p
|
||||
ick`_]_[_^Buffer^ Buffer][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Pick operator. Source buffer [%-*@3 v ]is destroyed.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:operator T`*`(`):%- [* operator_T`*]()&]
|
||||
[s5;:Buffer`:`:operator const T`*`(`)const:%- [* operator_const_T`*]()_[@(0.0.255) const]&]
|
||||
[s5;:Buffer`:`:operator`~`(`):%- [*@4 T]_`*[* operator`~]()&]
|
||||
[s5;:Buffer`:`:operator`~`(`)const:%- [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s5;:Upp`:`:Buffer`:`:Get`(`):%- [*@4 T]_`*[* Get]()&]
|
||||
[s5;:Upp`:`:Buffer`:`:Get`(`)const:%- [@(0.0.255) const]_[*@4 T]_`*[* Get]()_[@(0.0.255) cons
|
||||
t]&]
|
||||
[s2; Returns a pointer to the first element of the Buffer or NULL
|
||||
if the Buffer is empty.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Alloc`(size`_t`):%- [@(0.0.255) void]_[* Alloc](size`_t_[*@3 size])&]
|
||||
[s2; Clears the buffer and allocates it with the new size [%-*@3 size].
|
||||
All current elements are lost.&]
|
||||
[s6; T must have default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Alloc`(size`_t`,const T`&`):%- [@(0.0.255) void]_[* Alloc](size`_t_[*@3 size
|
||||
], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 in])&]
|
||||
[s2; Clears the buffer and allocates it with the new size [%-*@3 size],
|
||||
using the initialization value [%-*@3 in]. All current elements
|
||||
are lost.&]
|
||||
[s6; T must have deep copy constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Buffer`:`:Clear`(`):%- [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Clears the buffer to the same state as default constructor.
|
||||
All current elements are destroyed.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Buffer`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const
|
||||
]&]
|
||||
[s2; Returns true if Buffer is empty.&]
|
||||
[s3;%- &]
|
||||
[s0; ]]
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,417 +1,417 @@
|
|||
topic "Callbacks";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,2#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Callbacks]]}}&]
|
||||
[s9; [/ Note: Callbacks are now deprecated. Use Function/Event/Gate
|
||||
instead!]&]
|
||||
[s9; Callbacks can be described as a very generalized form of function
|
||||
pointers. Each Callback represents some kind of action (usually
|
||||
calling a certain function or a certain object method) that can
|
||||
be invoked at any time.&]
|
||||
[s9; If you are happy enough to be able to use C`+`+11, you can also
|
||||
assign C`+`+ lambda to Callback using operator << (see bellow).&]
|
||||
[s9; There are several basic callback types, depending on number
|
||||
of parameters passed and return value. In order to keep description
|
||||
of callbacks short, all these types are described in a single
|
||||
`"parametrized`" description, with parameters [*/@(128.0.255) highlighted].&]
|
||||
[s9; Generally, callbacks are now defined for up to 5 parameters
|
||||
of target (function, method, another callback).&]
|
||||
[s0; &]
|
||||
[s0; Callback types:&]
|
||||
[s3; &]
|
||||
[ {{1514:5185:1933:1368h1;t/17b/17@(204) [s0;%- [*/@(128.0.255)1 CallbackType]]
|
||||
:: [s0;%- [*/@(128.0.255)1 parameters]]
|
||||
:: [s0;%- [*/@(128.0.255)1 arguments]]
|
||||
:: [s0;%- [*/@(128.0.255)1 return`_type]]
|
||||
::@2 [s0;:Callback`:`:class:%- [*C+75 Callback]]
|
||||
:: [s0;%- [*/C@(0.0.255)+75 none]]
|
||||
:: [s0;%- [*/C@(0.0.255)+75 none]]
|
||||
:: [s0;%- [*/C+75 void]]
|
||||
:: [s0;:Callback1`:`:class:%- [*C+75 Callback1]]
|
||||
:: [s0;%- [*/C+75 class P1]]
|
||||
:: [s0;%- [*/C+75 P1]]
|
||||
:: [s0;%- [*/C+75 void]]
|
||||
:: [s0;:Callback2`:`:class: [*C+75 Callback2]]
|
||||
:: [s0; [*/C+75 class P1, class P2]]
|
||||
:: [s0; [*/C+75 P1, P2]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback3`:`:class: [*C+75 Callback3]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3]]
|
||||
:: [s0; [*/C+75 P1, P2, P3]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback4`:`:class: [*C+75 Callback4]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3, class P4]]
|
||||
:: [s0; [*/C+75 P1, P2, P3, P4]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback5`:`:class: [*C+75 Callback5]]
|
||||
:: [s0; [*/C+75 class P1, ... , class P5]]
|
||||
:: [s0; [*/C+75 P1, ... , P5]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Gate`:`:class: [*C+75 Gate]]
|
||||
:: [s0; [*/C@(0.0.255)+75 none]]
|
||||
:: [s0; [*/C@(0.0.255)+75 none]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate1`:`:class: [*C+75 Gate1]]
|
||||
:: [s0; [*/C+75 class P1]]
|
||||
:: [s0; [*/C+75 P1]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate2`:`:class: [*C+75 Gate2]]
|
||||
:: [s0; [*/C+75 class P1, class P2]]
|
||||
:: [s0; [*/C+75 P1, P2]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate3`:`:class: [*C+75 Gate3]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3]]
|
||||
:: [s0; [*/C+75 P1, P2, P3]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate4`:`:class: [*C+75 Gate4]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3, class P4]]
|
||||
:: [s0; [*/C+75 P1, P2, P3, P4]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate5`:`:class: [*C+75 Gate5]]
|
||||
:: [s0; [*/C+75 class P1, ... , class P5]]
|
||||
:: [s0; [*/C+75 P1, ... , P5]]
|
||||
:: [s0; [*/C+75 bool]]}}&]
|
||||
[s0; &]
|
||||
[s0; `[ template_<[*/@(128.0.255) parameters]> `]&]
|
||||
[s0; [%- class_][*/@(128.0.255) CallbackType]&]
|
||||
[s2; &]
|
||||
[s2; Callback type. Callbacks are moveable types with fast deep copy
|
||||
(using reference counting).&]
|
||||
[s2; &]
|
||||
[s0; &]
|
||||
[s0;%- explicit_[%%*/@(128.0.255) CallbackType]([%%*/@(128.0.255) CallbackType]Action<[%%*/@(128.0.255) a
|
||||
rguments>]_`*[*@3 newaction])&]
|
||||
[s2; Constructs callback based from new action.&]
|
||||
[s7; [%-*C@3 newaction]-|Action. Must be created using [* new] operator.
|
||||
Callback takes over its ownership.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1`:`:Callback1`(`):%- [%%*/@(128.0.255) CallbackType]()&]
|
||||
[s2; Creates an empty callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1`:`:Callback1`(const Callback1`&`):%- [%%*/@(128.0.255) CallbackType](con
|
||||
st_[%%*/@(128.0.255) CallbackType]`&_[*@3 c])&]
|
||||
[s2; Copy constructor. &]
|
||||
[s7; [%-*C@3 c]-|Source callback.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Callback`:`:Callback`(Upp`:`:AnyLambda`<T`>`):%- [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 T]>_[%%*/@(128.0.255) CallbackType]([_^Upp`:`:AnyLambda^ AnyLambda]<[*@4 T]>_[*@3 l
|
||||
])&]
|
||||
[s2; Constructor from C`+`+11 lambda. Note that AnyLambda intermediate
|
||||
type is necessarry as std`::function appears to have `"catch all`"
|
||||
templated constructor, which creates overloading problems. Use
|
||||
`'lambda`' helper function to convert lambda to AnyLambda (or
|
||||
use operator<<).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:`~Callback1`(`):%- `~[%%*/@(128.0.255) CallbackType]()&]
|
||||
[s2; Destructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:Clear`(`):%- void_[* Clear]()&]
|
||||
[s2; Empties the callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Gate`:`:ClearTrue`(`):%- void_[* ClearTrue]()&]
|
||||
[s6; Only in Gate callbacks.&]
|
||||
[s2; Clears Gate. After this method is invoked, the Gate performs
|
||||
no actions but returns true.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Gate`:`:ClearFalse`(`):%- void_[* ClearFalse]()&]
|
||||
[s6; Only in Gate callbacks.&]
|
||||
[s2; Clears Gate. After this method is invoked, the Gate performs
|
||||
no actions and returns false. This is the same as Clear.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:operator bool`(`)const:%- [* operator_bool]()_const&]
|
||||
[s7; [*/ Return value]-|True if the callback is valid. Invoking a valid
|
||||
callback invokes an action.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:Execute`(P1`)const:%- [*/@(128.0.255) return`_type]_[* Execute]([%%*/@(128.0.255) a
|
||||
rguments])_const&]
|
||||
[s2; Executes the callback with given set of arguments.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:operator`(`)`(P1`)const:%- [%%*/@(128.0.255) return`_type]_[* opera
|
||||
tor()]([%%*/@(128.0.255) arguments])_const&]
|
||||
[s2; Same as the Execute method.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1Action`:`:struct:%- `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- struct_[*/@(128.0.255) CallbackType][* Action]&]
|
||||
[s2; This is the abstract base class for callback action implementations.
|
||||
Callback holds reference counted pointer to instance of class
|
||||
derived from this class.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1Action`:`:Callback1Action`(`):%- [*/@(128.0.255) CallbackType][* Action]()&]
|
||||
[s2; Constructor. Assigns 1 to the reference count.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:`~Callback1Action`(`):%- `~[*/@(128.0.255) CallbackType][* Action
|
||||
]()&]
|
||||
[s2; Virtual destructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:Execute`(P1`):%- virtual [%%*/@(128.0.255) return`_type]_[* Execu
|
||||
te]([*/@(128.0.255) arguments])_`=_[@3 0]&]
|
||||
[s2; Performs the action with specified set of arguments.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:IsValid`(`)const:%- virtual bool_[* IsValid]()_const&]
|
||||
[s7; [*/ Return value]-|true if the Action is valid. Default implementation
|
||||
returns true.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:count:%- Atomic_[* count]&]
|
||||
[s2; Member variable used as reference count.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Common Callback/Gate functions]]}}&]
|
||||
[s3; &]
|
||||
[s0;:`:`:callback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): template_<class
|
||||
[*@4 OBJECT], class [*@4 METHOD][*@(128.0.255) ,][*@4 ][*/@(128.0.255) parameters]>&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType]<[*/@(128.0.255) arguments]> [* callback]([*@4 OBJECT]_`*
|
||||
[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) arguments]))&]
|
||||
[s2; Creates a callback that invokes the specified method of the
|
||||
specified object.&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the method.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:callback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): template_<class
|
||||
[*@4 OBJECT], class [*@4 METHOD][*@(128.0.255) ,][*@4 ][*/@(128.0.255) parameters]>&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType]<[*/@(128.0.255) arguments]> [* callback](const
|
||||
[*@4 OBJECT]_`*[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) argument
|
||||
s]) const)&]
|
||||
[s2; Constant variant of callback. The created Callback object invokes
|
||||
a constant method of the object.&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the constant method to invoke.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:pteback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* pteback]([*@4 OBJECT]_`*[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) a
|
||||
rguments]))&]
|
||||
[s2; Creates a Callback object which is similar to the one created
|
||||
by callback, but which can be safely invoked even after destruction
|
||||
of [@3 object] (results in no operation).&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object. Must be an ancestor of
|
||||
the [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:Pte`:`:template `<class T`> class Pte^ P
|
||||
te] class.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the method.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:callback`(void`(`*`)`(P1 p1`)`): `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* callback](void_(`*[*@3 fn])([%%*/@(128.0.255) arguments]))&]
|
||||
[s2; Creates a Callback object that invokes a non`-member function.&]
|
||||
[s7; [%-*C@3 fn]-|Pointer to the function.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Proxy`(Callback1`<P1`>`&`): `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]
|
||||
[* Proxy]([*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[*@3 cb])&]
|
||||
[s2; Creates a Callback object that invokes another Callback object.
|
||||
Useful for callback routing (e.g. when some parent Ctrl wants
|
||||
to reroute some of its child callbacks via its interface). Note
|
||||
that this function stores a reference to the target callback
|
||||
in the created callback `- storing callbacks that are used as
|
||||
Proxy targets in Vector flavor of containers is not a good idea.&]
|
||||
[s7; [%-*C@3 cb]-|Target callback.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:callback`(Callback1`<P1`>`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) paramet
|
||||
ers]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* callback]([%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]_[*@3 cb1], [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]_[*@3 cb2])&]
|
||||
[s2; Creates a Callback object that invokes two other callbacks.
|
||||
Note that this function stores a reference to the target callbacks
|
||||
in the created callback `- storing callbacks that are used as
|
||||
targets here in Vector flavor of containers is not a good idea.
|
||||
For Gate callbacks, the result of this operation is the boolean
|
||||
value returned by [*@3 cb2].&]
|
||||
[s7; [%-*C@3 cb1]-|First target callback.&]
|
||||
[s7; [%-*C@3 cb2]-|Second target callback.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:operator`<`<`(Callback1`<P1`>`&`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[* operator<<](
|
||||
[%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]`&_[*@3 a], [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]_[*@3 b])
|
||||
&]
|
||||
[s2; Operator variant of the previous function. Allows chaining thus
|
||||
imitating callback insertion.&]
|
||||
[s7; [%-*C@3 a]-|First callback. Its value is replaced by a callback
|
||||
that calls both the first and the second callback.&]
|
||||
[s7; [%-*C@3 b]-|Second callback.&]
|
||||
[s7; [*/ Return value]-|Reference to the first callback.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s0;:operator`<`<`(Callback1`<P1`>`&`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[* operator<<](
|
||||
[%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]`&_[*@3 a], [%%*/@(128.0.255) C`+`+11Lambda]_[*@3 b])&]
|
||||
[s2; Variant of merging callbacks that can be used for C`+`+11 lambdas.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Storing arguments in callback]]}}&]
|
||||
[s0; &]
|
||||
[s0; It is possible to store some arguments that are passed to target
|
||||
(function or method) as parameters when creating. If simultaneously
|
||||
passing other parameters in callback call, those passed on call
|
||||
represent beginning arguments and those defined in callback creation
|
||||
fill the rest of arguments.&]
|
||||
[s0; &]
|
||||
[s0; Again, all this is defined for up to 5 target parameters:&]
|
||||
[s0; &]
|
||||
[s0;:`:`:callback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- template_<class_[*@4 Object],
|
||||
class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackTy
|
||||
pe][%% <][%%*/@(128.0.255) arguments][%% >]_[* callback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...), [*@4 T1]_[*@3 arg1], ...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:callback1`(const Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- template_<class
|
||||
_[*@4 Object], class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(const Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- [%%*/@(128.0.255) C
|
||||
allbackType][%% <][%%*/@(128.0.255) arguments][%% >]_[* callback1]([*@4 Object]_`*[*@3 object
|
||||
], void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...) const, [*@4 T1]_[*@3 arg1],
|
||||
...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- template_<class_[*@4 Object],
|
||||
class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackTyp
|
||||
e][%% <][%%*/@(128.0.255) arguments][%% >]_[* pteback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...), [*@4 T1]_[*@3 arg1], ...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- template_<class_[*@4 Obj
|
||||
ect], class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- [%%*/@(128.0.255) Callba
|
||||
ckType][%% <][%%*/@(128.0.255) arguments][%% >]_[* pteback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...) const, [*@4 T1]_[*@3 arg1],
|
||||
...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:callback1`(void`(`*`)`(P`)`,T`):%- template_<class_[*@4 P1],
|
||||
..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(void`(`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) a
|
||||
rguments][%% >]_[* callback1](void_(`*[*@3 fn])([*@4 P1], ...), [*@4 T1]_[*@3 arg],
|
||||
...)&]
|
||||
[s0;%- &]
|
||||
[s2; [%-*@4 P1] ([%-*@4 P2, P3 ][%- ...]) are arguments passed on method
|
||||
invocation, [%-*@4 T1] ([%-*@4 T2, T3 ][%- ...]) are parameters stored
|
||||
in Callback object.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Callback macros]]}}&]
|
||||
[s9; Callback macros reduce verbosity of instance method callbacks.
|
||||
They expect CLASSNAME to be typedef`-ed as the type of current
|
||||
class and return method callbacks bound to the [*@(0.0.255) this]
|
||||
pointer.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:`:`:THISBACK`(x`):%- [* THISBACK]([*@3 x])&]
|
||||
[s2; Expands to callback(this, `&CLASSNAME`::[@3 m]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:THISBACK1`(x`, arg`):%- [* THISBACK1]([*@3 x], [*@3 arg])&]
|
||||
[s2; Expands to callback1(this, `&CLASSNAME`::[@3 m], [@3 arg]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 arg]-|Additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:THISBACK2`(m`, a`, b`):%- [* THISBACK2]([*@3 m], [*@3 a], [*@3 b])&]
|
||||
[s2; Expands to callback2(this, `&CLASSNAME`::[@3 m], [@3 a],[@3 b]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 a]-|First additional parameter.&]
|
||||
[s7; [%-*C@3 b]-|Second additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK`(x`):%- [* PTEBACK]([*@3 x])&]
|
||||
[s2; Expands to pteback(this, `&CLASSNAME`::[@3 m]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK1`(x`, arg`):%- [* PTEBACK1]([*@3 x], [*@3 arg])&]
|
||||
[s2; Expands to pteback1(this, `&CLASSNAME`::[@3 m], [@3 arg]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 arg]-|Additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK2`(m`, a`, b`):%- [* PTEBACK2]([*@3 m], [*@3 a], [*@3 b])&]
|
||||
[s2; Expands to pteback2(this, `&CLASSNAME`::[@3 m], [@3 a],[@3 b]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 a]-|First additional parameter.&]
|
||||
[s7; [%-*C@3 b]-|Second additional parameter.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 EventArgTarget]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][3 >]&]
|
||||
[s1;:EventArgTarget`:`:class:%- [@(0.0.255) class]_[* CallbackArgTarget]&]
|
||||
[s9; This helper class is useful in a situation when a set of callbacks
|
||||
define some output value. Example is pop`-up menu that provides
|
||||
selection of one character `- in that case, CallbackArgTarget
|
||||
can be used instead of dedicated method to obtain result of user
|
||||
selection.&]
|
||||
[s8; [%-*@4 T]-|Type of output value. Must be able to be assigned Null.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:EventArgTarget`:`:EventArgTarget`(`):%- [* CallbackArgTarget]()&]
|
||||
[s2; Assigns Null to the output value.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:EventArgTarget`:`:operator const T`&`(`)const:%- [* operator_const_T`&]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|The result. If no CallbackArgTarget was invoked,
|
||||
returns Null.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:EventArgTarget`:`:IsNullInstance`(`)const:%- [@(0.0.255) bool]_[* IsNullInstance]()_
|
||||
[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|True if there is not Null in output value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:EventArgTarget`:`:operator`[`]`(const T`&`):%- [_^Callback^ Callback]_[* operator`[`]
|
||||
]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 value])&]
|
||||
[s2; Returns a Callback that, when invoked, assigns [@3 value] to the
|
||||
output value.&]
|
||||
[s7; [%-*C@3 value]-|Value.&]
|
||||
[s7; [*/ Return value]-|Callback.&]
|
||||
[s3; &]
|
||||
topic "Callbacks";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,2#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Callbacks]]}}&]
|
||||
[s9; [/ Note: Callbacks are now deprecated. Use Function/Event/Gate
|
||||
instead!]&]
|
||||
[s9; Callbacks can be described as a very generalized form of function
|
||||
pointers. Each Callback represents some kind of action (usually
|
||||
calling a certain function or a certain object method) that can
|
||||
be invoked at any time.&]
|
||||
[s9; If you are happy enough to be able to use C`+`+11, you can also
|
||||
assign C`+`+ lambda to Callback using operator << (see bellow).&]
|
||||
[s9; There are several basic callback types, depending on number
|
||||
of parameters passed and return value. In order to keep description
|
||||
of callbacks short, all these types are described in a single
|
||||
`"parametrized`" description, with parameters [*/@(128.0.255) highlighted].&]
|
||||
[s9; Generally, callbacks are now defined for up to 5 parameters
|
||||
of target (function, method, another callback).&]
|
||||
[s0; &]
|
||||
[s0; Callback types:&]
|
||||
[s3; &]
|
||||
[ {{1514:5185:1933:1368h1;t/17b/17@(204) [s0;%- [*/@(128.0.255)1 CallbackType]]
|
||||
:: [s0;%- [*/@(128.0.255)1 parameters]]
|
||||
:: [s0;%- [*/@(128.0.255)1 arguments]]
|
||||
:: [s0;%- [*/@(128.0.255)1 return`_type]]
|
||||
::@2 [s0;:Callback`:`:class:%- [*C+75 Callback]]
|
||||
:: [s0;%- [*/C@(0.0.255)+75 none]]
|
||||
:: [s0;%- [*/C@(0.0.255)+75 none]]
|
||||
:: [s0;%- [*/C+75 void]]
|
||||
:: [s0;:Callback1`:`:class:%- [*C+75 Callback1]]
|
||||
:: [s0;%- [*/C+75 class P1]]
|
||||
:: [s0;%- [*/C+75 P1]]
|
||||
:: [s0;%- [*/C+75 void]]
|
||||
:: [s0;:Callback2`:`:class: [*C+75 Callback2]]
|
||||
:: [s0; [*/C+75 class P1, class P2]]
|
||||
:: [s0; [*/C+75 P1, P2]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback3`:`:class: [*C+75 Callback3]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3]]
|
||||
:: [s0; [*/C+75 P1, P2, P3]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback4`:`:class: [*C+75 Callback4]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3, class P4]]
|
||||
:: [s0; [*/C+75 P1, P2, P3, P4]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Callback5`:`:class: [*C+75 Callback5]]
|
||||
:: [s0; [*/C+75 class P1, ... , class P5]]
|
||||
:: [s0; [*/C+75 P1, ... , P5]]
|
||||
:: [s0; [*/C+75 void]]
|
||||
:: [s0;:Gate`:`:class: [*C+75 Gate]]
|
||||
:: [s0; [*/C@(0.0.255)+75 none]]
|
||||
:: [s0; [*/C@(0.0.255)+75 none]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate1`:`:class: [*C+75 Gate1]]
|
||||
:: [s0; [*/C+75 class P1]]
|
||||
:: [s0; [*/C+75 P1]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate2`:`:class: [*C+75 Gate2]]
|
||||
:: [s0; [*/C+75 class P1, class P2]]
|
||||
:: [s0; [*/C+75 P1, P2]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate3`:`:class: [*C+75 Gate3]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3]]
|
||||
:: [s0; [*/C+75 P1, P2, P3]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate4`:`:class: [*C+75 Gate4]]
|
||||
:: [s0; [*/C+75 class P1, class P2, class P3, class P4]]
|
||||
:: [s0; [*/C+75 P1, P2, P3, P4]]
|
||||
:: [s0; [*/C+75 bool]]
|
||||
:: [s0;:Gate5`:`:class: [*C+75 Gate5]]
|
||||
:: [s0; [*/C+75 class P1, ... , class P5]]
|
||||
:: [s0; [*/C+75 P1, ... , P5]]
|
||||
:: [s0; [*/C+75 bool]]}}&]
|
||||
[s0; &]
|
||||
[s0; `[ template_<[*/@(128.0.255) parameters]> `]&]
|
||||
[s0; [%- class_][*/@(128.0.255) CallbackType]&]
|
||||
[s2; &]
|
||||
[s2; Callback type. Callbacks are moveable types with fast deep copy
|
||||
(using reference counting).&]
|
||||
[s2; &]
|
||||
[s0; &]
|
||||
[s0;%- explicit_[%%*/@(128.0.255) CallbackType]([%%*/@(128.0.255) CallbackType]Action<[%%*/@(128.0.255) a
|
||||
rguments>]_`*[*@3 newaction])&]
|
||||
[s2; Constructs callback based from new action.&]
|
||||
[s7; [%-*C@3 newaction]-|Action. Must be created using [* new] operator.
|
||||
Callback takes over its ownership.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1`:`:Callback1`(`):%- [%%*/@(128.0.255) CallbackType]()&]
|
||||
[s2; Creates an empty callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1`:`:Callback1`(const Callback1`&`):%- [%%*/@(128.0.255) CallbackType](con
|
||||
st_[%%*/@(128.0.255) CallbackType]`&_[*@3 c])&]
|
||||
[s2; Copy constructor. &]
|
||||
[s7; [%-*C@3 c]-|Source callback.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Callback`:`:Callback`(Upp`:`:AnyLambda`<T`>`):%- [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 T]>_[%%*/@(128.0.255) CallbackType]([_^Upp`:`:AnyLambda^ AnyLambda]<[*@4 T]>_[*@3 l
|
||||
])&]
|
||||
[s2; Constructor from C`+`+11 lambda. Note that AnyLambda intermediate
|
||||
type is necessarry as std`::function appears to have `"catch all`"
|
||||
templated constructor, which creates overloading problems. Use
|
||||
`'lambda`' helper function to convert lambda to AnyLambda (or
|
||||
use operator<<).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:`~Callback1`(`):%- `~[%%*/@(128.0.255) CallbackType]()&]
|
||||
[s2; Destructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:Clear`(`):%- void_[* Clear]()&]
|
||||
[s2; Empties the callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Gate`:`:ClearTrue`(`):%- void_[* ClearTrue]()&]
|
||||
[s6; Only in Gate callbacks.&]
|
||||
[s2; Clears Gate. After this method is invoked, the Gate performs
|
||||
no actions but returns true.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Gate`:`:ClearFalse`(`):%- void_[* ClearFalse]()&]
|
||||
[s6; Only in Gate callbacks.&]
|
||||
[s2; Clears Gate. After this method is invoked, the Gate performs
|
||||
no actions and returns false. This is the same as Clear.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:operator bool`(`)const:%- [* operator_bool]()_const&]
|
||||
[s7; [*/ Return value]-|True if the callback is valid. Invoking a valid
|
||||
callback invokes an action.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:Execute`(P1`)const:%- [*/@(128.0.255) return`_type]_[* Execute]([%%*/@(128.0.255) a
|
||||
rguments])_const&]
|
||||
[s2; Executes the callback with given set of arguments.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:Callback1`:`:operator`(`)`(P1`)const:%- [%%*/@(128.0.255) return`_type]_[* opera
|
||||
tor()]([%%*/@(128.0.255) arguments])_const&]
|
||||
[s2; Same as the Execute method.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1Action`:`:struct:%- `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- struct_[*/@(128.0.255) CallbackType][* Action]&]
|
||||
[s2; This is the abstract base class for callback action implementations.
|
||||
Callback holds reference counted pointer to instance of class
|
||||
derived from this class.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:Callback1Action`:`:Callback1Action`(`):%- [*/@(128.0.255) CallbackType][* Action]()&]
|
||||
[s2; Constructor. Assigns 1 to the reference count.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:`~Callback1Action`(`):%- `~[*/@(128.0.255) CallbackType][* Action
|
||||
]()&]
|
||||
[s2; Virtual destructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:Execute`(P1`):%- virtual [%%*/@(128.0.255) return`_type]_[* Execu
|
||||
te]([*/@(128.0.255) arguments])_`=_[@3 0]&]
|
||||
[s2; Performs the action with specified set of arguments.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:IsValid`(`)const:%- virtual bool_[* IsValid]()_const&]
|
||||
[s7; [*/ Return value]-|true if the Action is valid. Default implementation
|
||||
returns true.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Callback1Action`:`:count:%- Atomic_[* count]&]
|
||||
[s2; Member variable used as reference count.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Common Callback/Gate functions]]}}&]
|
||||
[s3; &]
|
||||
[s0;:`:`:callback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): template_<class
|
||||
[*@4 OBJECT], class [*@4 METHOD][*@(128.0.255) ,][*@4 ][*/@(128.0.255) parameters]>&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType]<[*/@(128.0.255) arguments]> [* callback]([*@4 OBJECT]_`*
|
||||
[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) arguments]))&]
|
||||
[s2; Creates a callback that invokes the specified method of the
|
||||
specified object.&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the method.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:callback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): template_<class
|
||||
[*@4 OBJECT], class [*@4 METHOD][*@(128.0.255) ,][*@4 ][*/@(128.0.255) parameters]>&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType]<[*/@(128.0.255) arguments]> [* callback](const
|
||||
[*@4 OBJECT]_`*[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) argument
|
||||
s]) const)&]
|
||||
[s2; Constant variant of callback. The created Callback object invokes
|
||||
a constant method of the object.&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the constant method to invoke.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:pteback`(OBJECT`*`,void`(METHOD`:`:`*`)`(P1 p1`)`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* pteback]([*@4 OBJECT]_`*[*@3 object], void_([*@4 METHOD]`::`*[*@3 method])([%%*/@(128.0.255) a
|
||||
rguments]))&]
|
||||
[s2; Creates a Callback object which is similar to the one created
|
||||
by callback, but which can be safely invoked even after destruction
|
||||
of [@3 object] (results in no operation).&]
|
||||
[s7; [%-*C@3 object]-|Pointer to the object. Must be an ancestor of
|
||||
the [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:Pte`:`:template `<class T`> class Pte^ P
|
||||
te] class.&]
|
||||
[s7; [%-*C@3 method]-|Pointer to the method.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:callback`(void`(`*`)`(P1 p1`)`): `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* callback](void_(`*[*@3 fn])([%%*/@(128.0.255) arguments]))&]
|
||||
[s2; Creates a Callback object that invokes a non`-member function.&]
|
||||
[s7; [%-*C@3 fn]-|Pointer to the function.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:Proxy`(Callback1`<P1`>`&`): `[ template_<[*/@(128.0.255) parameters]>
|
||||
`]&]
|
||||
[s0;%- [*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]
|
||||
[* Proxy]([*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[*@3 cb])&]
|
||||
[s2; Creates a Callback object that invokes another Callback object.
|
||||
Useful for callback routing (e.g. when some parent Ctrl wants
|
||||
to reroute some of its child callbacks via its interface). Note
|
||||
that this function stores a reference to the target callback
|
||||
in the created callback `- storing callbacks that are used as
|
||||
Proxy targets in Vector flavor of containers is not a good idea.&]
|
||||
[s7; [%-*C@3 cb]-|Target callback.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:callback`(Callback1`<P1`>`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) paramet
|
||||
ers]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
][* callback]([%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]_[*@3 cb1], [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]_[*@3 cb2])&]
|
||||
[s2; Creates a Callback object that invokes two other callbacks.
|
||||
Note that this function stores a reference to the target callbacks
|
||||
in the created callback `- storing callbacks that are used as
|
||||
targets here in Vector flavor of containers is not a good idea.
|
||||
For Gate callbacks, the result of this operation is the boolean
|
||||
value returned by [*@3 cb2].&]
|
||||
[s7; [%-*C@3 cb1]-|First target callback.&]
|
||||
[s7; [%-*C@3 cb2]-|Second target callback.&]
|
||||
[s7; [*/ Return value]-|Created callback.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:operator`<`<`(Callback1`<P1`>`&`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[* operator<<](
|
||||
[%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]`&_[*@3 a], [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]_[*@3 b])
|
||||
&]
|
||||
[s2; Operator variant of the previous function. Allows chaining thus
|
||||
imitating callback insertion.&]
|
||||
[s7; [%-*C@3 a]-|First callback. Its value is replaced by a callback
|
||||
that calls both the first and the second callback.&]
|
||||
[s7; [%-*C@3 b]-|Second callback.&]
|
||||
[s7; [*/ Return value]-|Reference to the first callback.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s0;:operator`<`<`(Callback1`<P1`>`&`,Callback1`<P1`>`): `[ template_<[*/@(128.0.255) p
|
||||
arameters]> `]&]
|
||||
[s0;%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >]`&_[* operator<<](
|
||||
[%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) arguments][%% >
|
||||
]`&_[*@3 a], [%%*/@(128.0.255) C`+`+11Lambda]_[*@3 b])&]
|
||||
[s2; Variant of merging callbacks that can be used for C`+`+11 lambdas.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Storing arguments in callback]]}}&]
|
||||
[s0; &]
|
||||
[s0; It is possible to store some arguments that are passed to target
|
||||
(function or method) as parameters when creating. If simultaneously
|
||||
passing other parameters in callback call, those passed on call
|
||||
represent beginning arguments and those defined in callback creation
|
||||
fill the rest of arguments.&]
|
||||
[s0; &]
|
||||
[s0; Again, all this is defined for up to 5 target parameters:&]
|
||||
[s0; &]
|
||||
[s0;:`:`:callback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- template_<class_[*@4 Object],
|
||||
class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackTy
|
||||
pe][%% <][%%*/@(128.0.255) arguments][%% >]_[* callback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...), [*@4 T1]_[*@3 arg1], ...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:callback1`(const Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- template_<class
|
||||
_[*@4 Object], class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(const Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- [%%*/@(128.0.255) C
|
||||
allbackType][%% <][%%*/@(128.0.255) arguments][%% >]_[* callback1]([*@4 Object]_`*[*@3 object
|
||||
], void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...) const, [*@4 T1]_[*@3 arg1],
|
||||
...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- template_<class_[*@4 Object],
|
||||
class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackTyp
|
||||
e][%% <][%%*/@(128.0.255) arguments][%% >]_[* pteback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...), [*@4 T1]_[*@3 arg1], ...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- template_<class_[*@4 Obj
|
||||
ect], class_[*@4 M], class_[*@4 P1], ..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:pteback1`(Object`*`,void`(M`:`:`*`)`(P`)const`,T`):%- [%%*/@(128.0.255) Callba
|
||||
ckType][%% <][%%*/@(128.0.255) arguments][%% >]_[* pteback1]([*@4 Object]_`*[*@3 object],
|
||||
void_([*@4 M]`::`*[*@3 method])([*@4 P1], ...) const, [*@4 T1]_[*@3 arg1],
|
||||
...)&]
|
||||
[s3;%- &]
|
||||
[s0;:`:`:callback1`(void`(`*`)`(P`)`,T`):%- template_<class_[*@4 P1],
|
||||
..., class_[*@4 T1], ...>&]
|
||||
[s0;:`:`:callback1`(void`(`*`)`(P`)`,T`):%- [%%*/@(128.0.255) CallbackType][%% <][%%*/@(128.0.255) a
|
||||
rguments][%% >]_[* callback1](void_(`*[*@3 fn])([*@4 P1], ...), [*@4 T1]_[*@3 arg],
|
||||
...)&]
|
||||
[s0;%- &]
|
||||
[s2; [%-*@4 P1] ([%-*@4 P2, P3 ][%- ...]) are arguments passed on method
|
||||
invocation, [%-*@4 T1] ([%-*@4 T2, T3 ][%- ...]) are parameters stored
|
||||
in Callback object.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Callback macros]]}}&]
|
||||
[s9; Callback macros reduce verbosity of instance method callbacks.
|
||||
They expect CLASSNAME to be typedef`-ed as the type of current
|
||||
class and return method callbacks bound to the [*@(0.0.255) this]
|
||||
pointer.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;:`:`:THISBACK`(x`):%- [* THISBACK]([*@3 x])&]
|
||||
[s2; Expands to callback(this, `&CLASSNAME`::[@3 m]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:THISBACK1`(x`, arg`):%- [* THISBACK1]([*@3 x], [*@3 arg])&]
|
||||
[s2; Expands to callback1(this, `&CLASSNAME`::[@3 m], [@3 arg]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 arg]-|Additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:THISBACK2`(m`, a`, b`):%- [* THISBACK2]([*@3 m], [*@3 a], [*@3 b])&]
|
||||
[s2; Expands to callback2(this, `&CLASSNAME`::[@3 m], [@3 a],[@3 b]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 a]-|First additional parameter.&]
|
||||
[s7; [%-*C@3 b]-|Second additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK`(x`):%- [* PTEBACK]([*@3 x])&]
|
||||
[s2; Expands to pteback(this, `&CLASSNAME`::[@3 m]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK1`(x`, arg`):%- [* PTEBACK1]([*@3 x], [*@3 arg])&]
|
||||
[s2; Expands to pteback1(this, `&CLASSNAME`::[@3 m], [@3 arg]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 arg]-|Additional parameter.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s0;:`:`:PTEBACK2`(m`, a`, b`):%- [* PTEBACK2]([*@3 m], [*@3 a], [*@3 b])&]
|
||||
[s2; Expands to pteback2(this, `&CLASSNAME`::[@3 m], [@3 a],[@3 b]).&]
|
||||
[s7; [%-*C@3 m]-|Name of method.&]
|
||||
[s7; [%-*C@3 a]-|First additional parameter.&]
|
||||
[s7; [%-*C@3 b]-|Second additional parameter.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 EventArgTarget]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][3 >]&]
|
||||
[s1;:EventArgTarget`:`:class:%- [@(0.0.255) class]_[* CallbackArgTarget]&]
|
||||
[s9; This helper class is useful in a situation when a set of callbacks
|
||||
define some output value. Example is pop`-up menu that provides
|
||||
selection of one character `- in that case, CallbackArgTarget
|
||||
can be used instead of dedicated method to obtain result of user
|
||||
selection.&]
|
||||
[s8; [%-*@4 T]-|Type of output value. Must be able to be assigned Null.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:EventArgTarget`:`:EventArgTarget`(`):%- [* CallbackArgTarget]()&]
|
||||
[s2; Assigns Null to the output value.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:EventArgTarget`:`:operator const T`&`(`)const:%- [* operator_const_T`&]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|The result. If no CallbackArgTarget was invoked,
|
||||
returns Null.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:EventArgTarget`:`:IsNullInstance`(`)const:%- [@(0.0.255) bool]_[* IsNullInstance]()_
|
||||
[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|True if there is not Null in output value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:EventArgTarget`:`:operator`[`]`(const T`&`):%- [_^Callback^ Callback]_[* operator`[`]
|
||||
]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 value])&]
|
||||
[s2; Returns a Callback that, when invoked, assigns [@3 value] to the
|
||||
output value.&]
|
||||
[s7; [%-*C@3 value]-|Value.&]
|
||||
[s7; [*/ Return value]-|Callback.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,405 +1,405 @@
|
|||
topic "Color";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Color]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:Color`:`:class:%- [@(0.0.255)3 class][3 _][*3 Color][3 _:_][@(0.0.255)3 private][3 _][*@3;3 Ass
|
||||
ignValueTypeNo][@(0.0.255)3 <][*3 Color][3 , COLOR`_V, ][_^Moveable^3 Moveable][@(0.0.255)3 <
|
||||
][*3 Color][@(0.0.255)3 >][3 _>_]&]
|
||||
[s9; [* Color] type representing RGB color. All components are in the
|
||||
range 0 through 255. Null value is defined for Color. Color is
|
||||
Value compatible as a Rich`-Value type (supports Value comparison,
|
||||
serialization etc.).&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Color`:`:Color`(`):%- [* Color]()&]
|
||||
[s2; Default constructor. Leaves component values uninitialized.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(int`,int`,int`):%- [* Color]([@(0.0.255) int]_[*@3 r],
|
||||
[@(0.0.255) int]_[*@3 g], [@(0.0.255) int]_[*@3 b])&]
|
||||
[s2; Constructor.&]
|
||||
[s7; [%-*C@3 r]-|Red channel.&]
|
||||
[s7; [%-*C@3 g]-|Green channel.&]
|
||||
[s7; [%-*C@3 b]-|Blue channel.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(const Nuller`&`):%- [* Color]([@(0.0.255) const]_[_^Nuller^ Nuller][@(0.0.255) `&
|
||||
])&]
|
||||
[s2; Null constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(const Value`&`):%- [* Color]([@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&
|
||||
]_[*@3 q])&]
|
||||
[s2; Conversion from Value.&]
|
||||
[s7; [%-*@3 q]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(Color`(`*`)`(`)`):%- [* Color]([* Color]_(`*[*@3 fn])())&]
|
||||
[s2; This constructor allows using a pointer to a function returning
|
||||
Colors instead of Colors in many places. Global functions returning
|
||||
Color are needed instead of global Color constants on many platforms,
|
||||
because often global variables are not allowed when using dynamic
|
||||
libraries.&]
|
||||
[s7; [%-*@3 fn]-|Pointer to a function returning Color.&]
|
||||
[s0; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(RGBA`):%- [* Color]([_^RGBA^ RGBA]_[*@3 rgba])&]
|
||||
[s2; Conversion from a RGBA structure [%-*@3 rgba].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(int`,int`):%- [* Color]([@(0.0.255) int]_[*@3 n],
|
||||
[@(0.0.255) int])&]
|
||||
[s2; Constructs a Color from an integer representation of that colors
|
||||
RGB code.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Color`:`:operator Value`(`)const:%- [* operator_Value]()_[@(0.0.255) const]&]
|
||||
[s2; Conversion to Value.&]
|
||||
[s7; [*/ Return value]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetRaw`(`)const:%- [_^dword^ dword]_[* GetRaw]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|Platform specific dword representing the color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetR`(`)const:%- [@(0.0.255) int]_[* GetR]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The red component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetG`(`)const:%- [@(0.0.255) int]_[* GetG]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The green component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetB`(`)const:%- [@(0.0.255) int]_[* GetB]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The blue component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:SetNull`(`):%- [@(0.0.255) void]_[* SetNull]()&]
|
||||
[s2; Sets the Color to Null.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:IsNullInstance`(`)const:%- [@(0.0.255) bool]_[* IsNullInstance]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|True if Color is Null. Used to implement IsNull
|
||||
for Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetHashValue`(`)const:%- [@(0.0.255) unsigned]_[* GetHashValue]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|Hash`-value for Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator`=`=`(Color`)const:%- [@(0.0.255) bool]_[* operator`=`=]([_^Color^ Co
|
||||
lor]_[*@3 c])_[@(0.0.255) const]&]
|
||||
[s7; [%-*C@3 c]-|Color to compare with.&]
|
||||
[s7; [*/ Return value]-|True if Color is equal to [@3 c].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator`!`=`(Color`)const:%- [@(0.0.255) bool]_[* operator!`=]([_^Color^ Col
|
||||
or]_[*@3 c])_[@(0.0.255) const]&]
|
||||
[s7; [%-*C@3 c]-|Color to compare with.&]
|
||||
[s7; [*/ Return value]-|True if Color is not equal to [@3 c].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Serialize`(Stream`&`):%- [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2; Serializes the color to the [^topic`:`/`/Core`/src`/Stream`$en`-us`#Stream`:`:class^ S
|
||||
tream] [%-*@3 s].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:FromRaw`(dword`):%- [@(0.0.255) static] [_^Color^ Color]_[* FromRaw]([_^dword^ d
|
||||
word]_[*@3 co])&]
|
||||
[s2; Creates a Color based on a platform specific raw dword value.&]
|
||||
[s7; [%-*C@3 co]-|Raw dword value.&]
|
||||
[s7; [*/ Return value]-|Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator COLORREF`(`)const:%- [* operator_COLORREF]()_[@(0.0.255) const]&]
|
||||
[s6;%- Win32 specific.&]
|
||||
[s2; Return COLORREF for Color.&]
|
||||
[s7; [*/ Return value]-|COLORREF.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:FromCR`(COLORREF`):%- [@(0.0.255) static] [_^Color^ Color]_[* FromCR](COLORRE
|
||||
F_[*@3 cr])&]
|
||||
[s6; Win32 specific.&]
|
||||
[s2; Creates Color from COLORREF.&]
|
||||
[s7; [%-*C@3 cr]-|COLORREF.&]
|
||||
[s7; [*/ Return value]-|Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator dword`(`)const:%- [* operator_dword]()_[@(0.0.255) const]&]
|
||||
[s6;%- Not available on Win32&]
|
||||
[s7; [*/ Return value]-|[^topic`:`/`/Core`/src`/Color`$en`-us`#Color`:`:GetRaw`(`)const^ G
|
||||
etRaw]().&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator RGBA`(`)const:%- [* operator_RGBA]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a RGBA structure containing the color information.&]
|
||||
[s3;%- &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Utility functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:GetRValue`(dword`):%- [@(0.0.255) int]_[* GetRValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns red component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Red component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetGValue`(dword`):%- [@(0.0.255) int]_[* GetGValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns green component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Green component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetBValue`(dword`):%- [@(0.0.255) int]_[* GetBValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns blue component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Blue component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RGB`(byte`,byte`,byte`):%- [_^dword^ dword]_[* RGB]([_^byte^ byte]_[*@3 r],
|
||||
[_^byte^ byte]_[*@3 g], [_^byte^ byte]_[*@3 b])&]
|
||||
[s2; Calculates platform specific value from components.&]
|
||||
[s7; [%-*C@3 r]-|Red component.&]
|
||||
[s7; [%-*C@3 g]-|Green component.&]
|
||||
[s7; [%-*C@3 b]-|Blue component.&]
|
||||
[s7; [*/ Return value]-|Platform specific value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetHashValue`(Color`):%- [@(0.0.255) unsigned]_[* GetHashValue]([_^Color^ Color]_[*@3 c])
|
||||
&]
|
||||
[s2; Returns a hash value for the color.&]
|
||||
[s7; [%-*C@3 c]-|Color.&]
|
||||
[s7; [*/ Return value]-|Hash value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Nvl`(Color`,Color`):%- [_^Color^ Color]_[* Nvl]([_^Color^ Color]_[*@3 a],
|
||||
[_^Color^ Color]_[*@3 b])&]
|
||||
[s2; Returns first parameter if it is not Null, second otherwise.&]
|
||||
[s7; [%-*C@3 a]-|Color.&]
|
||||
[s7; [%-*C@3 b]-|Color.&]
|
||||
[s7; [*/ Return value]-|a if not Null, b otherwise.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:AsString`(const Color`&`):%- [@(0.0.255) template]_<>_[_^String^ String]_[* AsString](
|
||||
[@(0.0.255) const]_[_^Color^ Color][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2; Converts Color to textual form.&]
|
||||
[s7; [%-*C@3 c]-|Color.&]
|
||||
[s7; [*/ Return value]-|Textual form.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RGBtoHSV`(double`,double`,double`,double`&`,double`&`,double`&`):%- [@(0.0.255) vo
|
||||
id]_[* RGBtoHSV]([@(0.0.255) double]_[*@3 r], [@(0.0.255) double]_[*@3 g],
|
||||
[@(0.0.255) double]_[*@3 b], [@(0.0.255) double`&]_[*@3 h], [@(0.0.255) double`&]_[*@3 s],
|
||||
[@(0.0.255) double`&]_[*@3 v])&]
|
||||
[s2; Transforms an `[R,G,B`] color triplet (each of the components
|
||||
is supposed to be in the range `[0..1`]) into an `[H,S,V`] triplet
|
||||
(again all components are in the range `[0..1`]). This effectively
|
||||
transforms the RGB cube to a cone in which color selection more
|
||||
intuitively matches our our visual perception ([/ hue] corresponds
|
||||
to the tint of the color, [/ saturation] to the richness of the
|
||||
color hue and [/ value] corresponds to luminance or brightness).
|
||||
&]
|
||||
[s2; &]
|
||||
[s2; The mathematical formula used to convert between the two color
|
||||
spaces are:&]
|
||||
[s2; &]
|
||||
[s2; v `= max(r, g, b)&]
|
||||
[s2; s `= 1 `- min(r, g, b) / v&]
|
||||
[s2; h `= (x `- min(r, g, b)) / (max(r, g, b) `- min(r, g, b))&]
|
||||
[s2; &]
|
||||
[s2; where [/ x] is the color component which is neither minimum nor
|
||||
maximum. There are six combinations for this, in every even h
|
||||
is taken, in every odd 1`-h. The six combinations correspond
|
||||
to six points on the color wheel forming the base of the HSV
|
||||
cone `- pure red, yellow, green, cyan, blue, and magenta. The
|
||||
color component ranges along the circumference are the following
|
||||
(capital letters denote maximum component value, minuscule letters
|
||||
minimum): Rgb `-> RGb `-> rGb `-> rGB `-> rgB `-> RgB.&]
|
||||
[s2; &]
|
||||
[s2; An easy way to visualize the HSV transform based on the RGB
|
||||
cube is: imagine a slight deformation of the cube where the tip
|
||||
of the cone corresponds to the black RBG cube vertex, the opposite
|
||||
(white) RGB cube vertex corresponds to the center of the base
|
||||
circle of the HSV cone and the remaining six RGB cube vertices
|
||||
get projected on the circumference of the cone base as explained
|
||||
in the preceding paragraph.&]
|
||||
[s2; &]
|
||||
[s7; [%-*C@3 r]-|input red component `[0..1`]&]
|
||||
[s7; [%-*C@3 g]-|input green component `[0..1`]&]
|
||||
[s7; [%-*C@3 b]-|input blue component `[0..1`]&]
|
||||
[s7; [%-*C@3 h]-|output hue `[0..1`], i.e. color tint&]
|
||||
[s7; [%-*C@3 s]-|output saturation `[0..1`]. Maximum saturation (1)
|
||||
corresponds to the `"purest`" basic color (one of the six), whereas
|
||||
minimum saturation (0) is gray or white.&]
|
||||
[s7; [%-*C@3 v]-|output brightness `[0..1`].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:HSVtoRGB`(double`,double`,double`,double`&`,double`&`,double`&`):%- [@(0.0.255) vo
|
||||
id]_[* HSVtoRGB]([@(0.0.255) double]_[*@3 h], [@(0.0.255) double]_[*@3 s],
|
||||
[@(0.0.255) double]_[*@3 v], [@(0.0.255) double`&]_[*@3 r], [@(0.0.255) double`&]_[*@3 g],
|
||||
[@(0.0.255) double`&]_[*@3 b])&]
|
||||
[s2; Transformes an HSV triplet (each of the components is supposed
|
||||
to lie in the interval `[0..1`]) into an RGB triplet (again with
|
||||
component ranges `[0..1`]). This projects the HSV cone (as explained
|
||||
in the preceding section) back onto the RGB cube.&]
|
||||
[s7; [%-*C@3 h]-|input hue, i.e. color tint `[0..1`]&]
|
||||
[s7; [%-*C@3 s]-|input saturation, i.e. color `"purity`" `[0..1`]&]
|
||||
[s7; [%-*C@3 v]-|value `- luminance or brightness `[0..1`]&]
|
||||
[s7; [%-*C@3 r]-|output red component `[0..1`]&]
|
||||
[s7; [%-*C@3 g]-|output green component `[0..1`]&]
|
||||
[s7; [%-*C@3 b]-|output blue component `[0..1`]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:HsvColorf`(double`,double`,double`):%- [_^Color^ Color]_[* HsvColorf]([@(0.0.255) doub
|
||||
le]_[*@3 h], [@(0.0.255) double]_[*@3 s], [@(0.0.255) double]_[*@3 v])&]
|
||||
[s2; Converts an HSV color triplet into a [* Color] object. The H,
|
||||
S, and V components are supposed to be in the range `[0..1`].&]
|
||||
[s7; [%-*C@3 h]-|input hue `[0..1`]&]
|
||||
[s7; [%-*C@3 s]-|input saturation `[0..1`]&]
|
||||
[s7; [%-*C@3 v]-|input value aka brightness `[0..1`]&]
|
||||
[s7; [*/ Return value]-|the [* Color] object with the given HSV components&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Blend`(Color`,Color`,int`):%- [_^Color^ Color]_[* Blend]([_^Color^ Color]_[*@3 c1],
|
||||
[_^Color^ Color]_[*@3 c2], [@(0.0.255) int]_[*@3 alpha]_`=_[@3 128])&]
|
||||
[s2; Blends two colors.&]
|
||||
[s7; [%-*C@3 c1]-|First color.&]
|
||||
[s7; [%-*C@3 c2]-|Second color.&]
|
||||
[s7; [%-*C@3 alpha]-|Blending factor in the range 0..255.&]
|
||||
[s7; [*/ Return value]-|Blended color `- (255 `- alpha) / 255.0 `* c1
|
||||
`+ alpha / 255.0 `* c2.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ColorToHtml`(Color`):%- [_^String^ String]_[* ColorToHtml]([_^Color^ Color]_[*@3 color])
|
||||
&]
|
||||
[s2; Converts Color to the textual format used in HTML (into hexadecimal
|
||||
form like #ffffff for white).&]
|
||||
[s7; [%-*C@3 color]-|Color.&]
|
||||
[s7; [*/ Return value]-|HTML text.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ColorFromText`(const char`*`):%- [_^Upp`:`:Color^ Color]_[* ColorFromText]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 s])&]
|
||||
[s2; Converts text to Color. Allowed formats are 3 decimal numbers
|
||||
in range 0`-255, representing r, g, b colors and separated by
|
||||
`',`' or `';`' or `'.`' or `' `', or the text must exactly contain
|
||||
6 hexadecimal digits representing RRGGBB values.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GrayColor`(int`):%- [_^Color^ Color]_[* GrayColor]([@(0.0.255) int]_[*@3 a]_`=_[@3 128])&]
|
||||
[s2; Returns a gray color of intensity [%-*@3 a].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Grayscale`(const Color`&`):%- [@(0.0.255) int]_[* Grayscale]([@(0.0.255) const]_[_^Color^ C
|
||||
olor][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2; Converts a color [%-*@3 c][%- to grayscale].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:IsDark`(Color`):%- [@(0.0.255) bool]_[* IsDark]([_^Color^ Color]_[*@3 c])&]
|
||||
[s2; True if [%-*@3 c] grayscale level is lower than 80.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:IsLight`(Color`):%- [@(0.0.255) bool]_[* IsLight]([_^Color^ Color]_[*@3 c])&]
|
||||
[s2; True if [%-*@3 c] grayscale is higher than 175 (255 `- 80).&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StraightColor`(RGBA`):%- [_^Color^ Color]_[* StraightColor]([_^RGBA^ RGBA]_[*@3 rgba])&]
|
||||
[s2; Converts a RGBA structure [%-*@3 rgba] to a [* Color].&]
|
||||
[s3; &]
|
||||
[s0;3 &]
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Color constants]]}}&]
|
||||
[s3; &]
|
||||
[s9; Predefined colors are represented by functions that return the
|
||||
predefined color value.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s5;:Black`(`):%- [_^Color^ Color]_[* Black]()&]
|
||||
[s2; Black.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Gray`(`):%- [_^Color^ Color]_[* Gray]()&]
|
||||
[s2; Gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtGray`(`):%- [_^Color^ Color]_[* LtGray]()&]
|
||||
[s2; Light gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:WhiteGray`(`):%- [_^Color^ Color]_[* WhiteGray]()&]
|
||||
[s2; White gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:White`(`):%- [_^Color^ Color]_[* White]()&]
|
||||
[s2; White.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Red`(`):%- [_^Color^ Color]_[* Red]()&]
|
||||
[s2; Red.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Green`(`):%- [_^Color^ Color]_[* Green]()&]
|
||||
[s2; Green.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Brown`(`):%- [_^Color^ Color]_[* Brown]()&]
|
||||
[s2; Brown.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Blue`(`):%- [_^Color^ Color]_[* Blue]()&]
|
||||
[s2; Blue.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Magenta`(`):%- [_^Color^ Color]_[* Magenta]()&]
|
||||
[s2; Magenta.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Cyan`(`):%- [_^Color^ Color]_[* Cyan]()&]
|
||||
[s2; Cyan.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Yellow`(`):%- [_^Color^ Color]_[* Yellow]()&]
|
||||
[s2; Yellow.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LtRed`(`):%- [_^Color^ Color]_[* LtRed]()&]
|
||||
[s2; Light red.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtGreen`(`):%- [_^Color^ Color]_[* LtGreen]()&]
|
||||
[s2; Light green.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtYellow`(`):%- [_^Color^ Color]_[* LtYellow]()&]
|
||||
[s2; Light yellow.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtBlue`(`):%- [_^Color^ Color]_[* LtBlue]()&]
|
||||
[s2; Light blue.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtMagenta`(`):%- [_^Color^ Color]_[* LtMagenta]()&]
|
||||
[s2; Light magenta.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtCyan`(`):%- [_^Color^ Color]_[* LtCyan]()&]
|
||||
[s2; Light cyan.&]
|
||||
[s3;%- &]
|
||||
topic "Color";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Color]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:Color`:`:class:%- [@(0.0.255)3 class][3 _][*3 Color][3 _:_][@(0.0.255)3 private][3 _][*@3;3 Ass
|
||||
ignValueTypeNo][@(0.0.255)3 <][*3 Color][3 , COLOR`_V, ][_^Moveable^3 Moveable][@(0.0.255)3 <
|
||||
][*3 Color][@(0.0.255)3 >][3 _>_]&]
|
||||
[s9; [* Color] type representing RGB color. All components are in the
|
||||
range 0 through 255. Null value is defined for Color. Color is
|
||||
Value compatible as a Rich`-Value type (supports Value comparison,
|
||||
serialization etc.).&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Color`:`:Color`(`):%- [* Color]()&]
|
||||
[s2; Default constructor. Leaves component values uninitialized.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(int`,int`,int`):%- [* Color]([@(0.0.255) int]_[*@3 r],
|
||||
[@(0.0.255) int]_[*@3 g], [@(0.0.255) int]_[*@3 b])&]
|
||||
[s2; Constructor.&]
|
||||
[s7; [%-*C@3 r]-|Red channel.&]
|
||||
[s7; [%-*C@3 g]-|Green channel.&]
|
||||
[s7; [%-*C@3 b]-|Blue channel.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(const Nuller`&`):%- [* Color]([@(0.0.255) const]_[_^Nuller^ Nuller][@(0.0.255) `&
|
||||
])&]
|
||||
[s2; Null constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(const Value`&`):%- [* Color]([@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&
|
||||
]_[*@3 q])&]
|
||||
[s2; Conversion from Value.&]
|
||||
[s7; [%-*@3 q]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(Color`(`*`)`(`)`):%- [* Color]([* Color]_(`*[*@3 fn])())&]
|
||||
[s2; This constructor allows using a pointer to a function returning
|
||||
Colors instead of Colors in many places. Global functions returning
|
||||
Color are needed instead of global Color constants on many platforms,
|
||||
because often global variables are not allowed when using dynamic
|
||||
libraries.&]
|
||||
[s7; [%-*@3 fn]-|Pointer to a function returning Color.&]
|
||||
[s0; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(RGBA`):%- [* Color]([_^RGBA^ RGBA]_[*@3 rgba])&]
|
||||
[s2; Conversion from a RGBA structure [%-*@3 rgba].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Color`(int`,int`):%- [* Color]([@(0.0.255) int]_[*@3 n],
|
||||
[@(0.0.255) int])&]
|
||||
[s2; Constructs a Color from an integer representation of that colors
|
||||
RGB code.&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Color`:`:operator Value`(`)const:%- [* operator_Value]()_[@(0.0.255) const]&]
|
||||
[s2; Conversion to Value.&]
|
||||
[s7; [*/ Return value]-|Value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetRaw`(`)const:%- [_^dword^ dword]_[* GetRaw]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|Platform specific dword representing the color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetR`(`)const:%- [@(0.0.255) int]_[* GetR]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The red component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetG`(`)const:%- [@(0.0.255) int]_[* GetG]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The green component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetB`(`)const:%- [@(0.0.255) int]_[* GetB]()_[@(0.0.255) const]&]
|
||||
[s7; [*/ Return value]-|The blue component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:SetNull`(`):%- [@(0.0.255) void]_[* SetNull]()&]
|
||||
[s2; Sets the Color to Null.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:IsNullInstance`(`)const:%- [@(0.0.255) bool]_[* IsNullInstance]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|True if Color is Null. Used to implement IsNull
|
||||
for Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:GetHashValue`(`)const:%- [@(0.0.255) unsigned]_[* GetHashValue]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s7; [*/ Return value]-|Hash`-value for Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator`=`=`(Color`)const:%- [@(0.0.255) bool]_[* operator`=`=]([_^Color^ Co
|
||||
lor]_[*@3 c])_[@(0.0.255) const]&]
|
||||
[s7; [%-*C@3 c]-|Color to compare with.&]
|
||||
[s7; [*/ Return value]-|True if Color is equal to [@3 c].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator`!`=`(Color`)const:%- [@(0.0.255) bool]_[* operator!`=]([_^Color^ Col
|
||||
or]_[*@3 c])_[@(0.0.255) const]&]
|
||||
[s7; [%-*C@3 c]-|Color to compare with.&]
|
||||
[s7; [*/ Return value]-|True if Color is not equal to [@3 c].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:Serialize`(Stream`&`):%- [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2; Serializes the color to the [^topic`:`/`/Core`/src`/Stream`$en`-us`#Stream`:`:class^ S
|
||||
tream] [%-*@3 s].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:FromRaw`(dword`):%- [@(0.0.255) static] [_^Color^ Color]_[* FromRaw]([_^dword^ d
|
||||
word]_[*@3 co])&]
|
||||
[s2; Creates a Color based on a platform specific raw dword value.&]
|
||||
[s7; [%-*C@3 co]-|Raw dword value.&]
|
||||
[s7; [*/ Return value]-|Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator COLORREF`(`)const:%- [* operator_COLORREF]()_[@(0.0.255) const]&]
|
||||
[s6;%- Win32 specific.&]
|
||||
[s2; Return COLORREF for Color.&]
|
||||
[s7; [*/ Return value]-|COLORREF.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:FromCR`(COLORREF`):%- [@(0.0.255) static] [_^Color^ Color]_[* FromCR](COLORRE
|
||||
F_[*@3 cr])&]
|
||||
[s6; Win32 specific.&]
|
||||
[s2; Creates Color from COLORREF.&]
|
||||
[s7; [%-*C@3 cr]-|COLORREF.&]
|
||||
[s7; [*/ Return value]-|Color.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator dword`(`)const:%- [* operator_dword]()_[@(0.0.255) const]&]
|
||||
[s6;%- Not available on Win32&]
|
||||
[s7; [*/ Return value]-|[^topic`:`/`/Core`/src`/Color`$en`-us`#Color`:`:GetRaw`(`)const^ G
|
||||
etRaw]().&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Color`:`:operator RGBA`(`)const:%- [* operator_RGBA]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a RGBA structure containing the color information.&]
|
||||
[s3;%- &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Utility functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:GetRValue`(dword`):%- [@(0.0.255) int]_[* GetRValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns red component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Red component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetGValue`(dword`):%- [@(0.0.255) int]_[* GetGValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns green component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Green component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetBValue`(dword`):%- [@(0.0.255) int]_[* GetBValue]([_^dword^ dword]_[*@3 c])&]
|
||||
[s2; Returns blue component from a platform specific value.&]
|
||||
[s7; [%-*C@3 c]-|Platform specific value.&]
|
||||
[s7; [*/ Return value]-|Blue component.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RGB`(byte`,byte`,byte`):%- [_^dword^ dword]_[* RGB]([_^byte^ byte]_[*@3 r],
|
||||
[_^byte^ byte]_[*@3 g], [_^byte^ byte]_[*@3 b])&]
|
||||
[s2; Calculates platform specific value from components.&]
|
||||
[s7; [%-*C@3 r]-|Red component.&]
|
||||
[s7; [%-*C@3 g]-|Green component.&]
|
||||
[s7; [%-*C@3 b]-|Blue component.&]
|
||||
[s7; [*/ Return value]-|Platform specific value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GetHashValue`(Color`):%- [@(0.0.255) unsigned]_[* GetHashValue]([_^Color^ Color]_[*@3 c])
|
||||
&]
|
||||
[s2; Returns a hash value for the color.&]
|
||||
[s7; [%-*C@3 c]-|Color.&]
|
||||
[s7; [*/ Return value]-|Hash value.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Nvl`(Color`,Color`):%- [_^Color^ Color]_[* Nvl]([_^Color^ Color]_[*@3 a],
|
||||
[_^Color^ Color]_[*@3 b])&]
|
||||
[s2; Returns first parameter if it is not Null, second otherwise.&]
|
||||
[s7; [%-*C@3 a]-|Color.&]
|
||||
[s7; [%-*C@3 b]-|Color.&]
|
||||
[s7; [*/ Return value]-|a if not Null, b otherwise.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:AsString`(const Color`&`):%- [@(0.0.255) template]_<>_[_^String^ String]_[* AsString](
|
||||
[@(0.0.255) const]_[_^Color^ Color][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2; Converts Color to textual form.&]
|
||||
[s7; [%-*C@3 c]-|Color.&]
|
||||
[s7; [*/ Return value]-|Textual form.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RGBtoHSV`(double`,double`,double`,double`&`,double`&`,double`&`):%- [@(0.0.255) vo
|
||||
id]_[* RGBtoHSV]([@(0.0.255) double]_[*@3 r], [@(0.0.255) double]_[*@3 g],
|
||||
[@(0.0.255) double]_[*@3 b], [@(0.0.255) double`&]_[*@3 h], [@(0.0.255) double`&]_[*@3 s],
|
||||
[@(0.0.255) double`&]_[*@3 v])&]
|
||||
[s2; Transforms an `[R,G,B`] color triplet (each of the components
|
||||
is supposed to be in the range `[0..1`]) into an `[H,S,V`] triplet
|
||||
(again all components are in the range `[0..1`]). This effectively
|
||||
transforms the RGB cube to a cone in which color selection more
|
||||
intuitively matches our our visual perception ([/ hue] corresponds
|
||||
to the tint of the color, [/ saturation] to the richness of the
|
||||
color hue and [/ value] corresponds to luminance or brightness).
|
||||
&]
|
||||
[s2; &]
|
||||
[s2; The mathematical formula used to convert between the two color
|
||||
spaces are:&]
|
||||
[s2; &]
|
||||
[s2; v `= max(r, g, b)&]
|
||||
[s2; s `= 1 `- min(r, g, b) / v&]
|
||||
[s2; h `= (x `- min(r, g, b)) / (max(r, g, b) `- min(r, g, b))&]
|
||||
[s2; &]
|
||||
[s2; where [/ x] is the color component which is neither minimum nor
|
||||
maximum. There are six combinations for this, in every even h
|
||||
is taken, in every odd 1`-h. The six combinations correspond
|
||||
to six points on the color wheel forming the base of the HSV
|
||||
cone `- pure red, yellow, green, cyan, blue, and magenta. The
|
||||
color component ranges along the circumference are the following
|
||||
(capital letters denote maximum component value, minuscule letters
|
||||
minimum): Rgb `-> RGb `-> rGb `-> rGB `-> rgB `-> RgB.&]
|
||||
[s2; &]
|
||||
[s2; An easy way to visualize the HSV transform based on the RGB
|
||||
cube is: imagine a slight deformation of the cube where the tip
|
||||
of the cone corresponds to the black RBG cube vertex, the opposite
|
||||
(white) RGB cube vertex corresponds to the center of the base
|
||||
circle of the HSV cone and the remaining six RGB cube vertices
|
||||
get projected on the circumference of the cone base as explained
|
||||
in the preceding paragraph.&]
|
||||
[s2; &]
|
||||
[s7; [%-*C@3 r]-|input red component `[0..1`]&]
|
||||
[s7; [%-*C@3 g]-|input green component `[0..1`]&]
|
||||
[s7; [%-*C@3 b]-|input blue component `[0..1`]&]
|
||||
[s7; [%-*C@3 h]-|output hue `[0..1`], i.e. color tint&]
|
||||
[s7; [%-*C@3 s]-|output saturation `[0..1`]. Maximum saturation (1)
|
||||
corresponds to the `"purest`" basic color (one of the six), whereas
|
||||
minimum saturation (0) is gray or white.&]
|
||||
[s7; [%-*C@3 v]-|output brightness `[0..1`].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:HSVtoRGB`(double`,double`,double`,double`&`,double`&`,double`&`):%- [@(0.0.255) vo
|
||||
id]_[* HSVtoRGB]([@(0.0.255) double]_[*@3 h], [@(0.0.255) double]_[*@3 s],
|
||||
[@(0.0.255) double]_[*@3 v], [@(0.0.255) double`&]_[*@3 r], [@(0.0.255) double`&]_[*@3 g],
|
||||
[@(0.0.255) double`&]_[*@3 b])&]
|
||||
[s2; Transformes an HSV triplet (each of the components is supposed
|
||||
to lie in the interval `[0..1`]) into an RGB triplet (again with
|
||||
component ranges `[0..1`]). This projects the HSV cone (as explained
|
||||
in the preceding section) back onto the RGB cube.&]
|
||||
[s7; [%-*C@3 h]-|input hue, i.e. color tint `[0..1`]&]
|
||||
[s7; [%-*C@3 s]-|input saturation, i.e. color `"purity`" `[0..1`]&]
|
||||
[s7; [%-*C@3 v]-|value `- luminance or brightness `[0..1`]&]
|
||||
[s7; [%-*C@3 r]-|output red component `[0..1`]&]
|
||||
[s7; [%-*C@3 g]-|output green component `[0..1`]&]
|
||||
[s7; [%-*C@3 b]-|output blue component `[0..1`]&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:HsvColorf`(double`,double`,double`):%- [_^Color^ Color]_[* HsvColorf]([@(0.0.255) doub
|
||||
le]_[*@3 h], [@(0.0.255) double]_[*@3 s], [@(0.0.255) double]_[*@3 v])&]
|
||||
[s2; Converts an HSV color triplet into a [* Color] object. The H,
|
||||
S, and V components are supposed to be in the range `[0..1`].&]
|
||||
[s7; [%-*C@3 h]-|input hue `[0..1`]&]
|
||||
[s7; [%-*C@3 s]-|input saturation `[0..1`]&]
|
||||
[s7; [%-*C@3 v]-|input value aka brightness `[0..1`]&]
|
||||
[s7; [*/ Return value]-|the [* Color] object with the given HSV components&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Blend`(Color`,Color`,int`):%- [_^Color^ Color]_[* Blend]([_^Color^ Color]_[*@3 c1],
|
||||
[_^Color^ Color]_[*@3 c2], [@(0.0.255) int]_[*@3 alpha]_`=_[@3 128])&]
|
||||
[s2; Blends two colors.&]
|
||||
[s7; [%-*C@3 c1]-|First color.&]
|
||||
[s7; [%-*C@3 c2]-|Second color.&]
|
||||
[s7; [%-*C@3 alpha]-|Blending factor in the range 0..255.&]
|
||||
[s7; [*/ Return value]-|Blended color `- (255 `- alpha) / 255.0 `* c1
|
||||
`+ alpha / 255.0 `* c2.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ColorToHtml`(Color`):%- [_^String^ String]_[* ColorToHtml]([_^Color^ Color]_[*@3 color])
|
||||
&]
|
||||
[s2; Converts Color to the textual format used in HTML (into hexadecimal
|
||||
form like #ffffff for white).&]
|
||||
[s7; [%-*C@3 color]-|Color.&]
|
||||
[s7; [*/ Return value]-|HTML text.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:ColorFromText`(const char`*`):%- [_^Upp`:`:Color^ Color]_[* ColorFromText]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 s])&]
|
||||
[s2; Converts text to Color. Allowed formats are 3 decimal numbers
|
||||
in range 0`-255, representing r, g, b colors and separated by
|
||||
`',`' or `';`' or `'.`' or `' `', or the text must exactly contain
|
||||
6 hexadecimal digits representing RRGGBB values.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:GrayColor`(int`):%- [_^Color^ Color]_[* GrayColor]([@(0.0.255) int]_[*@3 a]_`=_[@3 128])&]
|
||||
[s2; Returns a gray color of intensity [%-*@3 a].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Grayscale`(const Color`&`):%- [@(0.0.255) int]_[* Grayscale]([@(0.0.255) const]_[_^Color^ C
|
||||
olor][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2; Converts a color [%-*@3 c][%- to grayscale].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:IsDark`(Color`):%- [@(0.0.255) bool]_[* IsDark]([_^Color^ Color]_[*@3 c])&]
|
||||
[s2; True if [%-*@3 c] grayscale level is lower than 80.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:IsLight`(Color`):%- [@(0.0.255) bool]_[* IsLight]([_^Color^ Color]_[*@3 c])&]
|
||||
[s2; True if [%-*@3 c] grayscale is higher than 175 (255 `- 80).&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StraightColor`(RGBA`):%- [_^Color^ Color]_[* StraightColor]([_^RGBA^ RGBA]_[*@3 rgba])&]
|
||||
[s2; Converts a RGBA structure [%-*@3 rgba] to a [* Color].&]
|
||||
[s3; &]
|
||||
[s0;3 &]
|
||||
[ {{10000@(113.42.0) [s0; [*@(229)4 Color constants]]}}&]
|
||||
[s3; &]
|
||||
[s9; Predefined colors are represented by functions that return the
|
||||
predefined color value.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s5;:Black`(`):%- [_^Color^ Color]_[* Black]()&]
|
||||
[s2; Black.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Gray`(`):%- [_^Color^ Color]_[* Gray]()&]
|
||||
[s2; Gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtGray`(`):%- [_^Color^ Color]_[* LtGray]()&]
|
||||
[s2; Light gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:WhiteGray`(`):%- [_^Color^ Color]_[* WhiteGray]()&]
|
||||
[s2; White gray.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:White`(`):%- [_^Color^ Color]_[* White]()&]
|
||||
[s2; White.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Red`(`):%- [_^Color^ Color]_[* Red]()&]
|
||||
[s2; Red.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Green`(`):%- [_^Color^ Color]_[* Green]()&]
|
||||
[s2; Green.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Brown`(`):%- [_^Color^ Color]_[* Brown]()&]
|
||||
[s2; Brown.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Blue`(`):%- [_^Color^ Color]_[* Blue]()&]
|
||||
[s2; Blue.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Magenta`(`):%- [_^Color^ Color]_[* Magenta]()&]
|
||||
[s2; Magenta.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Cyan`(`):%- [_^Color^ Color]_[* Cyan]()&]
|
||||
[s2; Cyan.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Yellow`(`):%- [_^Color^ Color]_[* Yellow]()&]
|
||||
[s2; Yellow.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LtRed`(`):%- [_^Color^ Color]_[* LtRed]()&]
|
||||
[s2; Light red.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtGreen`(`):%- [_^Color^ Color]_[* LtGreen]()&]
|
||||
[s2; Light green.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtYellow`(`):%- [_^Color^ Color]_[* LtYellow]()&]
|
||||
[s2; Light yellow.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtBlue`(`):%- [_^Color^ Color]_[* LtBlue]()&]
|
||||
[s2; Light blue.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtMagenta`(`):%- [_^Color^ Color]_[* LtMagenta]()&]
|
||||
[s2; Light magenta.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:LtCyan`(`):%- [_^Color^ Color]_[* LtCyan]()&]
|
||||
[s2; Light cyan.&]
|
||||
[s3;%- &]
|
||||
[s0; ]]
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,82 +1,82 @@
|
|||
topic "Date formatting and scanning";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0;%- [*@7;4 Date formatting and scanning]]}}&]
|
||||
[s0;*@3;4%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:StrToDate`(Date`&`,const char`*`):%- [@(0.0.255) const]_[@(0.0.255) char]_`*[* StrToDa
|
||||
te]([_^Date^ Date][@(0.0.255) `&]_[*@3 d], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 s])&]
|
||||
[s2; Scans a string for a Date. Order of day, month and year is specified
|
||||
using SetDateScan. In place of month both number and text is
|
||||
accepted `- text must match abbreviated or full name of month.&]
|
||||
[s7; [%-*C@3 d]-|Found date.&]
|
||||
[s7; [%-*C@3 s]-|String to scan.&]
|
||||
[s7; [*/ Return value]-|NULL if no date is found in s or pointer to
|
||||
character right after the date.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Format`(Date`):%- [_^String^ String]_[* Format]([_^Date^ Date]_[*@3 date])&]
|
||||
[s2; Formats date. Date is formated using the standard [^topic`:`/`/Core`/src`/Format`$en`-us^ F
|
||||
ormat] function, where the string set by SetDateFormat is used
|
||||
as formating string, and the three supplied integer value arguments
|
||||
are year, month and day.&]
|
||||
[s7; [%-*C@3 date]-|Date to format.&]
|
||||
[s7; [*/ Return value]-|Formatted date.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:CharFilterDate`(int`):%- [@(0.0.255) int]_[* CharFilterDate]([@(0.0.255) int]_[*@3 c])&]
|
||||
[s2; Character filter for dates. Its behaviour is specified by SetDateFilter
|
||||
function.&]
|
||||
[s7; [%-*C@3 c]-|Character to filter.&]
|
||||
[s7; [*/ Return value]-|Filtered character.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateFormat`(const char`*`):%- [@(0.0.255) void]_[* SetDateFormat]([@(0.0.255) const
|
||||
]_[@(0.0.255) char]_`*[*@3 fmt])&]
|
||||
[s2; Sets formating string for dates. When used for formatting, there
|
||||
are 3 integer arguments passed to [^topic`:`/`/Core`/src`/Format`$en`-us^ Format]
|
||||
with this string. First is year, second is month and third is
|
||||
day. This is per`-thread setting with threads inheriting the
|
||||
setting of main thread.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateScan`(const char`*`):%- [@(0.0.255) void]_[* SetDateScan]([@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 scan])&]
|
||||
[s2; Sets date scan string `- this string represents order of [* d]ay,
|
||||
[* m]onth and [* y]ear for StrToDate function. Letters `'[* d]`', `'[* m]`'
|
||||
and `'[* y]`' are used in [%-*@3 scan] to designate the order. This
|
||||
is per`-thread setting with threads inheriting the setting of
|
||||
main thread.&]
|
||||
[s2; Example:&]
|
||||
[s2; [*C@3 ][*C `"mdy`"]&]
|
||||
[s7; The month is first, day second and year third.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateFilter`(const char`*`):%- [@(0.0.255) void]_[* SetDateFilter]([@(0.0.255) const
|
||||
]_[@(0.0.255) char]_`*[*@3 seps])&]
|
||||
[s2; Specifies CharFilterDate behaviour. Digits are always allowed
|
||||
in CharFilterDate. If there is `"a`" at the beginning of seps
|
||||
string, letters are allowed. If there is `"A`", letters are allowed
|
||||
and converted to upper`-case. After this optional character,
|
||||
list of characters allowed as separator follows. `"`\r`" after
|
||||
character designates `"replace`" character `- if used, all characters
|
||||
up to next `"amend`" character or `'`\0`' are replaced by it.
|
||||
This is per`-thread setting with threads inheriting the setting
|
||||
of main thread.&]
|
||||
[s2; Example:&]
|
||||
[s2; [*C@3 ][*C `"a.][*C@3 `\r][*C@5 ,][*C@3 `\r][*C /][*C@3 `\r][*C@5 :;][*C `"]&]
|
||||
[s2; CharFilterDate would allow letters but not convert them to uppercase,
|
||||
it will allow characters `'[* .]`' and `'/`' and it will convert
|
||||
`'[*@5 ,]`' to `'[* .]`' and `'[*@5 :]`' or `'[*@5 ;]`' to `'[* /]`'.&]
|
||||
[s3; &]
|
||||
topic "Date formatting and scanning";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0;%- [*@7;4 Date formatting and scanning]]}}&]
|
||||
[s0;*@3;4%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:StrToDate`(Date`&`,const char`*`):%- [@(0.0.255) const]_[@(0.0.255) char]_`*[* StrToDa
|
||||
te]([_^Date^ Date][@(0.0.255) `&]_[*@3 d], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 s])&]
|
||||
[s2; Scans a string for a Date. Order of day, month and year is specified
|
||||
using SetDateScan. In place of month both number and text is
|
||||
accepted `- text must match abbreviated or full name of month.&]
|
||||
[s7; [%-*C@3 d]-|Found date.&]
|
||||
[s7; [%-*C@3 s]-|String to scan.&]
|
||||
[s7; [*/ Return value]-|NULL if no date is found in s or pointer to
|
||||
character right after the date.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Format`(Date`):%- [_^String^ String]_[* Format]([_^Date^ Date]_[*@3 date])&]
|
||||
[s2; Formats date. Date is formated using the standard [^topic`:`/`/Core`/src`/Format`$en`-us^ F
|
||||
ormat] function, where the string set by SetDateFormat is used
|
||||
as formating string, and the three supplied integer value arguments
|
||||
are year, month and day.&]
|
||||
[s7; [%-*C@3 date]-|Date to format.&]
|
||||
[s7; [*/ Return value]-|Formatted date.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:CharFilterDate`(int`):%- [@(0.0.255) int]_[* CharFilterDate]([@(0.0.255) int]_[*@3 c])&]
|
||||
[s2; Character filter for dates. Its behaviour is specified by SetDateFilter
|
||||
function.&]
|
||||
[s7; [%-*C@3 c]-|Character to filter.&]
|
||||
[s7; [*/ Return value]-|Filtered character.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateFormat`(const char`*`):%- [@(0.0.255) void]_[* SetDateFormat]([@(0.0.255) const
|
||||
]_[@(0.0.255) char]_`*[*@3 fmt])&]
|
||||
[s2; Sets formating string for dates. When used for formatting, there
|
||||
are 3 integer arguments passed to [^topic`:`/`/Core`/src`/Format`$en`-us^ Format]
|
||||
with this string. First is year, second is month and third is
|
||||
day. This is per`-thread setting with threads inheriting the
|
||||
setting of main thread.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateScan`(const char`*`):%- [@(0.0.255) void]_[* SetDateScan]([@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 scan])&]
|
||||
[s2; Sets date scan string `- this string represents order of [* d]ay,
|
||||
[* m]onth and [* y]ear for StrToDate function. Letters `'[* d]`', `'[* m]`'
|
||||
and `'[* y]`' are used in [%-*@3 scan] to designate the order. This
|
||||
is per`-thread setting with threads inheriting the setting of
|
||||
main thread.&]
|
||||
[s2; Example:&]
|
||||
[s2; [*C@3 ][*C `"mdy`"]&]
|
||||
[s7; The month is first, day second and year third.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SetDateFilter`(const char`*`):%- [@(0.0.255) void]_[* SetDateFilter]([@(0.0.255) const
|
||||
]_[@(0.0.255) char]_`*[*@3 seps])&]
|
||||
[s2; Specifies CharFilterDate behaviour. Digits are always allowed
|
||||
in CharFilterDate. If there is `"a`" at the beginning of seps
|
||||
string, letters are allowed. If there is `"A`", letters are allowed
|
||||
and converted to upper`-case. After this optional character,
|
||||
list of characters allowed as separator follows. `"`\r`" after
|
||||
character designates `"replace`" character `- if used, all characters
|
||||
up to next `"amend`" character or `'`\0`' are replaced by it.
|
||||
This is per`-thread setting with threads inheriting the setting
|
||||
of main thread.&]
|
||||
[s2; Example:&]
|
||||
[s2; [*C@3 ][*C `"a.][*C@3 `\r][*C@5 ,][*C@3 `\r][*C /][*C@3 `\r][*C@5 :;][*C `"]&]
|
||||
[s2; CharFilterDate would allow letters but not convert them to uppercase,
|
||||
it will allow characters `'[* .]`' and `'/`' and it will convert
|
||||
`'[*@5 ,]`' to `'[* .]`' and `'[*@5 :]`' or `'[*@5 ;]`' to `'[* /]`'.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,432 +1,432 @@
|
|||
topic "Format - text formatting";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@2;4 Format `- text formatting]]}}&]
|
||||
[s0;*@3;4 &]
|
||||
[s5;:`:`:Format`(const char`*`,const`:`:Vector`<`:`:Value`>`&`):%- [^`:`:String^ String
|
||||
]_[* Format][@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][*@3 format][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][^`:`:Vector^@(64) Vector][@(64) <][^`:`:Value^@(64) Value][@(64) >
|
||||
`&_][*@3 args][@(64) )]&]
|
||||
[s5;%- [^`:`:String^ String]_[* Format][@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _
|
||||
`*][*@3 format][@(64) , ][^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 1][*@3
|
||||
][@4 `[], [^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 n][@4 `]...] [@(64) )]&]
|
||||
[s5;:Format`(int`,const char`*`,const Vector`<Value`>`&`):%- [^String^ String]_[* Format](
|
||||
[@(0.0.255) int]_[*@3 language], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 s],
|
||||
[@(0.0.255) const]_Vector[@(0.0.255) <]Value[@(0.0.255) >`&]_[*@3 v])&]
|
||||
[s5;%- [^`:`:String^ String]_[* Format][@(64) (][@(0.0.255) int][@(64) _][*@3 language][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][*@3 format][@(64) ,
|
||||
][^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 1][*@3 ][@4 `[], [^`:`:Value^@(64) Value][@(64) _
|
||||
][*@3 arg][*,@3 n][@4 `]...] [@(64) )]&]
|
||||
[s2; &]
|
||||
[s0; Format forms output text based on [*@3 format], inserting actual
|
||||
arguments to placeholders. Argument values are converted to text
|
||||
using formatters. U`+`+ specifies set of standard formatters;
|
||||
application can freely register their own formatters for specific
|
||||
Value types too.&]
|
||||
[s0; &]
|
||||
[s0; Note that the variable number of Value arguments is implemented
|
||||
by overloading the Format up to 20 parameters.&]
|
||||
[s0; &]
|
||||
[s0; Placeholders start with [* %] and have format:&]
|
||||
[s0; &]
|
||||
[s0; [* %][*@4 `[][*@(0.0.255) commands][*@4 `]`[][*@(0.0.255) options][*@4 `]`[][*@(0.0.255) forma
|
||||
tter`-id][*@4 `]`[][*@(0.0.255) ``][*@4 `]]&]
|
||||
[s0; &]
|
||||
[s0; [*@(0.0.255) commands] are interpreted by Format routine (not
|
||||
specific formatter). Each command sequence ends with character
|
||||
specifying the kind of command, this delimits it from options
|
||||
and/or formatter.&]
|
||||
[s0; &]
|
||||
[s0; Available commands:&]
|
||||
[s0; &]
|
||||
[ {{1785:8215^ [s0; [*/@(0.0.255) position][* :]]
|
||||
::= [s0; Seeks to an argument at [*/@(0.0.255) position]. Allows to `"reorganize`"
|
||||
ordering of arguments, useful with translations.]
|
||||
::^ [s0; [*/@(0.0.255) width][* <]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns left.]
|
||||
::^ [s0; [*/@(0.0.255) width][* >]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns right.]
|
||||
::^ [s0; [*/@(0.0.255) width][* `=]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns to center.]
|
||||
::^ [s0; [* `[][*/@(0.0.255) text][* `]`~]]
|
||||
::= [s0; If argument is [* Null], uses [*/@(0.0.255) text] instead of formatter
|
||||
result.]}}&]
|
||||
[s0; &]
|
||||
[s0; [*@(0.0.255) formatter`-id][* ]must consist of alpha characters
|
||||
only, unlike C identifiers, digits or `'`_`' are not allowed.
|
||||
Everything between [*@(0.0.255) commands] and [*@(0.0.255) formatter`-id]
|
||||
is considered to be [*@(0.0.255) options] and passed to formatter.
|
||||
Note that [*@(0.0.255) formatter`-id] is Value type specific `-
|
||||
the same name can specify different formatter depending on Value
|
||||
type. [*@(0.0.255) formatter`-id] is case`-sensitive.&]
|
||||
[s0; &]
|
||||
[s0; Character [* `*] in [*@(0.0.255) options] section is replaced by
|
||||
an argument converted using AsString.&]
|
||||
[s0; &]
|
||||
[s0; If [*@(0.0.255) options] are to contain alpha characters, they
|
||||
need to be escaped using [* `[ `]] to distinguish options from
|
||||
formatter`-id.&]
|
||||
[s0; &]
|
||||
[s0; Placeholder can end either by non`-alpha character or by [* ``].
|
||||
formatter`-id can be left empty; in that case Format uses AsString
|
||||
to convert Value to text (defined in RichValue interface) `-
|
||||
the most trivial placeholder is therefore [* %``].&]
|
||||
[s0; &]
|
||||
[s0; While Format implements all of classic printf formatter, please
|
||||
notice two incompatibilities:&]
|
||||
[s0; &]
|
||||
[s0;i150;O0; All arguments of Format must be convertible (and are
|
||||
converted) to Value. On the positive side, Value performs natural
|
||||
conversions like double `-> int, so it is possible to e.g. use
|
||||
%d for double value.&]
|
||||
[s0; &]
|
||||
[s0;i150;O0; formatter`-id `"eats`" all alpha characters. This is
|
||||
a problem when non`-placeholder alpha character is to follow
|
||||
placeholder, e.g. %dpt `- this has to be written as %d``pt (``
|
||||
delimits the formatter`-id).&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [*/ Standard formatters]&]
|
||||
[s0; &]
|
||||
[s0; [* Default formatter]&]
|
||||
[s0; &]
|
||||
[s0; If formatter`-id is empty, Value is converted using AsString
|
||||
(implemented in RichValue interface).&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* printf formatters]&]
|
||||
[s0; &]
|
||||
[s0; Most printf formatters are supported:&]
|
||||
[s0; &]
|
||||
[s0; [* c d i o x X ld li lo lx lX lld lli llo llx llX e E f g G s]&]
|
||||
[s0; &]
|
||||
[s0; Please refer to printf documentation for the description.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Switch formatter]&]
|
||||
[s0; &]
|
||||
[s0; This is special number formatter (registered for double, int
|
||||
and int64 values). [*@(0.0.255) options] of switch formatter contain
|
||||
a list of values and respective texts `- a text for actual argument
|
||||
is printed. [*@(0.0.255) formatter`-id] is [* s].&]
|
||||
[s0; &]
|
||||
[s0; The format of switch [*@(0.0.255) options] is&]
|
||||
[s0; &]
|
||||
[s0; [*@4 `[][*@(0.0.255) modulo][* %][*@4 `]`[][*@(0.0.255) case][* :][*@(0.0.255) text];[*@4 `]...`[
|
||||
][*@(0.0.255) default][*@4 `]]&]
|
||||
[s0; &]
|
||||
[ {{1395:8605 [s0; [*@(0.0.255) modulo]]
|
||||
:: [s0; If this optional part is present, modulo of argument is used
|
||||
for switch cases.]
|
||||
:: [s0; [*@(0.0.255) case]]
|
||||
:: [s0; Numeric case.]
|
||||
:: [s0; [*@(0.0.255) text]]
|
||||
:: [s0; Text for given numeric case.]
|
||||
:: [s0; [*@(0.0.255) default]]
|
||||
:: [s0; Default text when no case is matched.]}}&]
|
||||
[s0; &]
|
||||
[s0; Note that as text usually contains letters, whole switch options
|
||||
section is almost always escaped using [* `[] [* `]].&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Simple integer formatters]&]
|
||||
[s0; &]
|
||||
[s0; These formatters are registered for double, int and int64 values.&]
|
||||
[s0; &]
|
||||
[ {{1426:8574h1;@(204) [s0; [*@(0.0.255) formatter`-id]]
|
||||
:: [s0; Description]
|
||||
::@2 [s0;%- [* month]]
|
||||
:: [s0; Lower`-case month name.]
|
||||
:: [s0;%- [* Month]]
|
||||
:: [s0; Month name with first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* MONTH]]
|
||||
:: [s0; Upper`-case month name.]
|
||||
:: [s0;%- [* mon]]
|
||||
:: [s0; Abbreviated lower`-case month name.]
|
||||
:: [s0;%- [* Mon]]
|
||||
:: [s0; Abbreviated month name, first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* MON]]
|
||||
:: [s0; Abbreviated upper`-case month name.]
|
||||
:: [s0;%- [* day]]
|
||||
:: [s0; Lower`-case day name.]
|
||||
:: [s0;%- [* Day]]
|
||||
:: [s0; Day name with first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* DAY]]
|
||||
:: [s0; Upper`-case day name.]
|
||||
:: [s0;%- [* dy]]
|
||||
:: [s0; Abbreviated lower`-case day name.]
|
||||
:: [s0;%- [* Dy]]
|
||||
:: [s0; Abbreviated day name, first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* DY]]
|
||||
:: [s0; Abbreviated upper`-case day name.]
|
||||
:: [s0;%- [* tw]]
|
||||
:: [s0; 12`-hour modulo format.]
|
||||
:: [s0;%- [* a]]
|
||||
:: [s0; Letter format, 1: a, 2: b, ... 26: z, 27: aa, ...]
|
||||
:: [s0;%- [* A]]
|
||||
:: [s0; Letter format, 1: a, 2: b, ... 26: z, 27: aa, ...]
|
||||
:: [s0;%- [* r]]
|
||||
:: [s0; Lower`-case roman numbers.]
|
||||
:: [s0;%- [* R]]
|
||||
:: [s0; Upper`-case roman numbers.]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Alternative real number formatters]&]
|
||||
[s0; &]
|
||||
[ {{1426:8574 [s0; [* n]]
|
||||
:: [s0; fixed decimals]
|
||||
:: [s0; [* v]]
|
||||
:: [s0; valid decimals]
|
||||
:: [s0; [* ne], [* ve]]
|
||||
:: [s0; force exponential notation]
|
||||
:: [s0; [* nf], [* vf]]
|
||||
:: [s0; force fixed notation]
|
||||
:: [s0; [* nl], [* vl]]
|
||||
:: [s0; locale/language`-based formatting (can use `',`' instead of
|
||||
`'.`' and add thousands separators)]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; The format of [*@(0.0.255) options] of alternative real number
|
||||
formatters is&]
|
||||
[s0; &]
|
||||
[s0; [*@4 `[][* `+][*@4 `]`[`[][* `-][*@4 `]][*@(0.0.255) digits][*@4 `]`[][* `@][*@4 `]`[][* ,][*@4 `]`[][* !
|
||||
][*@4 `]`[][* `^][*@4 `[][* `+][*@4 `]][*@(0.0.255) expdig][*@4 `]]&]
|
||||
[s0; &]
|
||||
[ {{1426:8574 [s0; `+]
|
||||
:: [s0; always prepend sign (even if positive number)]
|
||||
:: [s0; [*@4 `[][* `-][*@4 `]][*@(0.0.255) digits]]
|
||||
:: [s0; number of decimals to print (negative `= left of decimal point,
|
||||
default `= 6)]
|
||||
:: [s0; `@]
|
||||
:: [s0; do not use thousands separators (in internationalized formatting
|
||||
[* nl] or [* vl])]
|
||||
:: [s0; [* ,]]
|
||||
:: [s0; use `',`' instead of `'.`' for decimal point]
|
||||
:: [s0; [* !]]
|
||||
:: [s0; keep insignificant zeros]
|
||||
:: [s0; [* `^]]
|
||||
:: [s0; exponent options:&]
|
||||
[ {{5000:5000 [s0; [* `+]]
|
||||
:: [s0; always prepend sign to exponent]
|
||||
:: [s0; [*@(0.0.255) expdig]]
|
||||
:: [s0; exponent padding width]}}]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- [*/ Examples of standard formatters]&]
|
||||
[s0; &]
|
||||
[s0;3%- &]
|
||||
[ {{5073:4927 [s0;%- Format(`"[* %d, %s]`", 123, `"TEXT`")]
|
||||
:: [s0;%- 123, TEXT]
|
||||
:: [s0;%- Format(`"[* %2:s, %1:d]`", 123, `"TEXT`")]
|
||||
:: [s0;%- TEXT, 123]
|
||||
:: [s0;%- Format(`"[* %010d]`", 123)]
|
||||
:: [s0;%- 0000000123]
|
||||
:: [s0;%- Format(`"[* %0`*d]`", 11, 123)]
|
||||
:: [s0;%- 00000000123]
|
||||
:: [s0;%- Format(`"[* `|%20<d`|]`", 123)]
|
||||
:: [s0;%- `|123 `|]
|
||||
:: [s0;%- Format(`"[* `|%20>d`|]`", 123)]
|
||||
:: [s0;%- `| 123`|]
|
||||
:: [s0;%- Format(`"[* `|%20`=d`|]`", 123)]
|
||||
:: [s0;%- `| 123 `|]
|
||||
:: [s0;%- Format(`"[* %dpt]`", 123)]
|
||||
:: [s0;%- 123pt]
|
||||
:: [s0;%- Format(`"[* %`[empty`]`~d, %`[empty`]`~d]`", 123, Null)]
|
||||
:: [s0;%- 123, empty]
|
||||
:: [s0;%- Format(`"[* %]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %c]`", 65)]
|
||||
:: [s0;%- A]
|
||||
:: [s0;%- Format(`"[* %d]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %i]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %o]`", 123)]
|
||||
:: [s0;%- 173]
|
||||
:: [s0;%- Format(`"[* %x]`", 123)]
|
||||
:: [s0;%- 7b]
|
||||
:: [s0;%- Format(`"[* %X]`", 123)]
|
||||
:: [s0;%- 7B]
|
||||
:: [s0;%- Format(`"[* %e]`", 1234567.89)]
|
||||
:: [s0;%- 1.234568e`+006]
|
||||
:: [s0;%- Format(`"[* %E]`", 1234567.89)]
|
||||
:: [s0;%- 1.234568E`+006]
|
||||
:: [s0;%- Format(`"[* %f]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.890000]
|
||||
:: [s0;%- Format(`"[* %g]`", 1234567.89)]
|
||||
:: [s0;%- 1.23457e`+006]
|
||||
:: [s0;%- Format(`"[* %G]`", 1234567.89)]
|
||||
:: [s0;%- 1.23457E`+006]
|
||||
:: [s0;%- Format(`"[* %n]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %,n]`", 1234567.89)]
|
||||
:: [s0;%- 1234567,89]
|
||||
:: [s0;%- Format(`"[* %`+n]`", 1234567.89)]
|
||||
:: [s0;%- `+1234567.89]
|
||||
:: [s0;%- Format(`"[* %2,n]`", 123.456)]
|
||||
:: [s0;%- 123,46]
|
||||
:: [s0;%- Format(`"[* %2,n]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %2!,n]`", 123)]
|
||||
:: [s0;%- 123.00]
|
||||
:: [s0;%- Format(`"[* %ne]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %nf]`", 1234567.89e30)]
|
||||
:: [s0;%- 1234567890000000000000000000000000000]
|
||||
:: [s0;%- Format(`"[* %nl]`", 1234567.89)]
|
||||
:: [s0;%- 1,234,567.89]
|
||||
:: [s0;%- Format(`"[* %`@nl]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %`@,nl]`", 1234567.89)]
|
||||
:: [s0;%- 1234567,89]
|
||||
:: [s0;%- Format(`"[* %v]`", 1234567.89)]
|
||||
:: [s0;%- 1234570]
|
||||
:: [s0;%- Format(`"[* %ve]`", 1234567.89)]
|
||||
:: [s0;%- 1234570]
|
||||
:: [s0;%- Format(`"[* %vf]`", 1234567.89e30)]
|
||||
:: [s0;%- 1234570000000000000000000000000000000]
|
||||
:: [s0;%- Format(`"[* %vl]`", 1234567.89)]
|
||||
:: [s0;%- 1,234,570]
|
||||
:: [s0;%- Format(`"[* %`[1:one;2:two;3:three;another`]s]`", 2)]
|
||||
:: [s0;%- two]
|
||||
:: [s0;%- Format(`"[* %`[1:one;2:two;3:three;another`]s]`", 20)]
|
||||
:: [s0;%- another]
|
||||
:: [s0;%- Format(`"[* %`[3%1:one;2:two;3:three;another`]s]`", 20)]
|
||||
:: [s0;%- two]
|
||||
:: [s0;%- Format(`"[* %month]`", 6)]
|
||||
:: [s0;%- june]
|
||||
:: [s0;%- Format(`"[* %Month]`", 6)]
|
||||
:: [s0;%- June]
|
||||
:: [s0;%- Format(`"[* %MONTH]`", 6)]
|
||||
:: [s0;%- JUNE]
|
||||
:: [s0;%- Format(`"[* %mon]`", 6)]
|
||||
:: [s0;%- jun]
|
||||
:: [s0;%- Format(`"[* %Mon]`", 6)]
|
||||
:: [s0;%- Jun]
|
||||
:: [s0;%- Format(`"[* %MON]`", 6)]
|
||||
:: [s0;%- JUN]
|
||||
:: [s0;%- Format(`"[* %day]`", 6)]
|
||||
:: [s0;%- saturday]
|
||||
:: [s0;%- Format(`"[* %Day]`", 6)]
|
||||
:: [s0;%- Saturday]
|
||||
:: [s0;%- Format(`"[* %DAY]`", 6)]
|
||||
:: [s0;%- SATURDAY]
|
||||
:: [s0;%- Format(`"[* %dy]`", 6)]
|
||||
:: [s0;%- sa]
|
||||
:: [s0;%- Format(`"[* %Dy]`", 6)]
|
||||
:: [s0;%- Sa]
|
||||
:: [s0;%- Format(`"[* %DY]`", 6)]
|
||||
:: [s0;%- SA]
|
||||
:: [s0;%- Format(`"[* %tw]`", 0)]
|
||||
:: [s0;%- 12]
|
||||
:: [s0;%- Format(`"[* %tw]`", 5)]
|
||||
:: [s0;%- 5]
|
||||
:: [s0;%- Format(`"[* %tw]`", 15)]
|
||||
:: [s0;%- 3]
|
||||
:: [s0;%- Format(`"[* %0tw]`", 15)]
|
||||
:: [s0;%- 03]
|
||||
:: [s0;%- Format(`"[* %a]`", 1)]
|
||||
:: [s0;%- a]
|
||||
:: [s0;%- Format(`"[* %a]`", 123)]
|
||||
:: [s0;%- es]
|
||||
:: [s0;%- Format(`"[* %A]`", 1)]
|
||||
:: [s0;%- A]
|
||||
:: [s0;%- Format(`"[* %A]`", 123)]
|
||||
:: [s0;%- ES]
|
||||
:: [s0;%- Format(`"[* %r]`", 8)]
|
||||
:: [s0;%- viii]
|
||||
:: [s0;%- Format(`"[* %R]`", 1231)]
|
||||
:: [s0;%- MCCXXXI]
|
||||
:: [s0;%- Format(`"[* %]`", GetSysDate())]
|
||||
:: [s0;%- 11/11/2011]
|
||||
:: [s0;%- Format(`"[* %]`", GetSysTime())]
|
||||
:: [s0;%- 11/11/2011 14:44:11]
|
||||
:: [s0;%- Format(`"[* %]`", `"text`")]
|
||||
:: [s0;%- text]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- [*@3+117 Registering custom formatters]&]
|
||||
[s0; &]
|
||||
[s5;:Formatter`:`:typedef:%- typedef_[^String^ String]_(`*Formatter)([@(0.0.255) const][@(64) _
|
||||
][^Formatting^@(64) Formatting][@(64) `&_fmt)]&]
|
||||
[s2; Formatter has to have form of function with single [^Formatting^ Formatting]
|
||||
argument.&]
|
||||
[s1; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Formatting]]}}&]
|
||||
[s0;%- &]
|
||||
[s1;:Formatting`:`:struct:%- [@(0.0.255) struct]_[* Formatting]&]
|
||||
[s2; This structure passes all informations to format Value argument
|
||||
to the formatter.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:language:%- [@(0.0.255) int]_[* language]&]
|
||||
[s2; Language of resulting text.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:arg:%- Value_[* arg]&]
|
||||
[s2; Actual argument.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:format:%- String_[* format]&]
|
||||
[s2; Formatting [*@(0.0.255) options].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:id:%- String_[* id]&]
|
||||
[s2; Formatter`-id.&]
|
||||
[s1; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Format registration functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:RegisterFormatter`(int`,const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regi
|
||||
sterFormatter]([@(0.0.255) int]_[*@3 type], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for specific Value [%-*@3 type]. If [%-*@3 type]
|
||||
is VALUE`_V, formatter is applied to all Value types if no formatter
|
||||
for specific type is specified.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterNumberFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Reg
|
||||
isterNumberFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for bool, int, double and int64 types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterStringFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Reg
|
||||
isterStringFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for String and WString types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterDateTimeFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* R
|
||||
egisterDateTimeFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for Date and Time types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterValueFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regi
|
||||
sterValueFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter to be applied when no formatter for specific
|
||||
type is specified.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterNullFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regis
|
||||
terNullFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter [%-*@3 id] to be applied when the Value argument
|
||||
is Void (Value()) or ErrorValue.&]
|
||||
[s3; &]
|
||||
topic "Format - text formatting";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@2;4 Format `- text formatting]]}}&]
|
||||
[s0;*@3;4 &]
|
||||
[s5;:`:`:Format`(const char`*`,const`:`:Vector`<`:`:Value`>`&`):%- [^`:`:String^ String
|
||||
]_[* Format][@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][*@3 format][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][^`:`:Vector^@(64) Vector][@(64) <][^`:`:Value^@(64) Value][@(64) >
|
||||
`&_][*@3 args][@(64) )]&]
|
||||
[s5;%- [^`:`:String^ String]_[* Format][@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _
|
||||
`*][*@3 format][@(64) , ][^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 1][*@3
|
||||
][@4 `[], [^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 n][@4 `]...] [@(64) )]&]
|
||||
[s5;:Format`(int`,const char`*`,const Vector`<Value`>`&`):%- [^String^ String]_[* Format](
|
||||
[@(0.0.255) int]_[*@3 language], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 s],
|
||||
[@(0.0.255) const]_Vector[@(0.0.255) <]Value[@(0.0.255) >`&]_[*@3 v])&]
|
||||
[s5;%- [^`:`:String^ String]_[* Format][@(64) (][@(0.0.255) int][@(64) _][*@3 language][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][*@3 format][@(64) ,
|
||||
][^`:`:Value^@(64) Value][@(64) _][*@3 arg][*,@3 1][*@3 ][@4 `[], [^`:`:Value^@(64) Value][@(64) _
|
||||
][*@3 arg][*,@3 n][@4 `]...] [@(64) )]&]
|
||||
[s2; &]
|
||||
[s0; Format forms output text based on [*@3 format], inserting actual
|
||||
arguments to placeholders. Argument values are converted to text
|
||||
using formatters. U`+`+ specifies set of standard formatters;
|
||||
application can freely register their own formatters for specific
|
||||
Value types too.&]
|
||||
[s0; &]
|
||||
[s0; Note that the variable number of Value arguments is implemented
|
||||
by overloading the Format up to 20 parameters.&]
|
||||
[s0; &]
|
||||
[s0; Placeholders start with [* %] and have format:&]
|
||||
[s0; &]
|
||||
[s0; [* %][*@4 `[][*@(0.0.255) commands][*@4 `]`[][*@(0.0.255) options][*@4 `]`[][*@(0.0.255) forma
|
||||
tter`-id][*@4 `]`[][*@(0.0.255) ``][*@4 `]]&]
|
||||
[s0; &]
|
||||
[s0; [*@(0.0.255) commands] are interpreted by Format routine (not
|
||||
specific formatter). Each command sequence ends with character
|
||||
specifying the kind of command, this delimits it from options
|
||||
and/or formatter.&]
|
||||
[s0; &]
|
||||
[s0; Available commands:&]
|
||||
[s0; &]
|
||||
[ {{1785:8215^ [s0; [*/@(0.0.255) position][* :]]
|
||||
::= [s0; Seeks to an argument at [*/@(0.0.255) position]. Allows to `"reorganize`"
|
||||
ordering of arguments, useful with translations.]
|
||||
::^ [s0; [*/@(0.0.255) width][* <]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns left.]
|
||||
::^ [s0; [*/@(0.0.255) width][* >]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns right.]
|
||||
::^ [s0; [*/@(0.0.255) width][* `=]]
|
||||
::= [s0; Places formatter result into field with [*/@(0.0.255) width] characters,
|
||||
aligns to center.]
|
||||
::^ [s0; [* `[][*/@(0.0.255) text][* `]`~]]
|
||||
::= [s0; If argument is [* Null], uses [*/@(0.0.255) text] instead of formatter
|
||||
result.]}}&]
|
||||
[s0; &]
|
||||
[s0; [*@(0.0.255) formatter`-id][* ]must consist of alpha characters
|
||||
only, unlike C identifiers, digits or `'`_`' are not allowed.
|
||||
Everything between [*@(0.0.255) commands] and [*@(0.0.255) formatter`-id]
|
||||
is considered to be [*@(0.0.255) options] and passed to formatter.
|
||||
Note that [*@(0.0.255) formatter`-id] is Value type specific `-
|
||||
the same name can specify different formatter depending on Value
|
||||
type. [*@(0.0.255) formatter`-id] is case`-sensitive.&]
|
||||
[s0; &]
|
||||
[s0; Character [* `*] in [*@(0.0.255) options] section is replaced by
|
||||
an argument converted using AsString.&]
|
||||
[s0; &]
|
||||
[s0; If [*@(0.0.255) options] are to contain alpha characters, they
|
||||
need to be escaped using [* `[ `]] to distinguish options from
|
||||
formatter`-id.&]
|
||||
[s0; &]
|
||||
[s0; Placeholder can end either by non`-alpha character or by [* ``].
|
||||
formatter`-id can be left empty; in that case Format uses AsString
|
||||
to convert Value to text (defined in RichValue interface) `-
|
||||
the most trivial placeholder is therefore [* %``].&]
|
||||
[s0; &]
|
||||
[s0; While Format implements all of classic printf formatter, please
|
||||
notice two incompatibilities:&]
|
||||
[s0; &]
|
||||
[s0;i150;O0; All arguments of Format must be convertible (and are
|
||||
converted) to Value. On the positive side, Value performs natural
|
||||
conversions like double `-> int, so it is possible to e.g. use
|
||||
%d for double value.&]
|
||||
[s0; &]
|
||||
[s0;i150;O0; formatter`-id `"eats`" all alpha characters. This is
|
||||
a problem when non`-placeholder alpha character is to follow
|
||||
placeholder, e.g. %dpt `- this has to be written as %d``pt (``
|
||||
delimits the formatter`-id).&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [*/ Standard formatters]&]
|
||||
[s0; &]
|
||||
[s0; [* Default formatter]&]
|
||||
[s0; &]
|
||||
[s0; If formatter`-id is empty, Value is converted using AsString
|
||||
(implemented in RichValue interface).&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* printf formatters]&]
|
||||
[s0; &]
|
||||
[s0; Most printf formatters are supported:&]
|
||||
[s0; &]
|
||||
[s0; [* c d i o x X ld li lo lx lX lld lli llo llx llX e E f g G s]&]
|
||||
[s0; &]
|
||||
[s0; Please refer to printf documentation for the description.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Switch formatter]&]
|
||||
[s0; &]
|
||||
[s0; This is special number formatter (registered for double, int
|
||||
and int64 values). [*@(0.0.255) options] of switch formatter contain
|
||||
a list of values and respective texts `- a text for actual argument
|
||||
is printed. [*@(0.0.255) formatter`-id] is [* s].&]
|
||||
[s0; &]
|
||||
[s0; The format of switch [*@(0.0.255) options] is&]
|
||||
[s0; &]
|
||||
[s0; [*@4 `[][*@(0.0.255) modulo][* %][*@4 `]`[][*@(0.0.255) case][* :][*@(0.0.255) text];[*@4 `]...`[
|
||||
][*@(0.0.255) default][*@4 `]]&]
|
||||
[s0; &]
|
||||
[ {{1395:8605 [s0; [*@(0.0.255) modulo]]
|
||||
:: [s0; If this optional part is present, modulo of argument is used
|
||||
for switch cases.]
|
||||
:: [s0; [*@(0.0.255) case]]
|
||||
:: [s0; Numeric case.]
|
||||
:: [s0; [*@(0.0.255) text]]
|
||||
:: [s0; Text for given numeric case.]
|
||||
:: [s0; [*@(0.0.255) default]]
|
||||
:: [s0; Default text when no case is matched.]}}&]
|
||||
[s0; &]
|
||||
[s0; Note that as text usually contains letters, whole switch options
|
||||
section is almost always escaped using [* `[] [* `]].&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Simple integer formatters]&]
|
||||
[s0; &]
|
||||
[s0; These formatters are registered for double, int and int64 values.&]
|
||||
[s0; &]
|
||||
[ {{1426:8574h1;@(204) [s0; [*@(0.0.255) formatter`-id]]
|
||||
:: [s0; Description]
|
||||
::@2 [s0;%- [* month]]
|
||||
:: [s0; Lower`-case month name.]
|
||||
:: [s0;%- [* Month]]
|
||||
:: [s0; Month name with first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* MONTH]]
|
||||
:: [s0; Upper`-case month name.]
|
||||
:: [s0;%- [* mon]]
|
||||
:: [s0; Abbreviated lower`-case month name.]
|
||||
:: [s0;%- [* Mon]]
|
||||
:: [s0; Abbreviated month name, first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* MON]]
|
||||
:: [s0; Abbreviated upper`-case month name.]
|
||||
:: [s0;%- [* day]]
|
||||
:: [s0; Lower`-case day name.]
|
||||
:: [s0;%- [* Day]]
|
||||
:: [s0; Day name with first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* DAY]]
|
||||
:: [s0; Upper`-case day name.]
|
||||
:: [s0;%- [* dy]]
|
||||
:: [s0; Abbreviated lower`-case day name.]
|
||||
:: [s0;%- [* Dy]]
|
||||
:: [s0; Abbreviated day name, first letter upper`-case, rest lower`-case.]
|
||||
:: [s0;%- [* DY]]
|
||||
:: [s0; Abbreviated upper`-case day name.]
|
||||
:: [s0;%- [* tw]]
|
||||
:: [s0; 12`-hour modulo format.]
|
||||
:: [s0;%- [* a]]
|
||||
:: [s0; Letter format, 1: a, 2: b, ... 26: z, 27: aa, ...]
|
||||
:: [s0;%- [* A]]
|
||||
:: [s0; Letter format, 1: a, 2: b, ... 26: z, 27: aa, ...]
|
||||
:: [s0;%- [* r]]
|
||||
:: [s0; Lower`-case roman numbers.]
|
||||
:: [s0;%- [* R]]
|
||||
:: [s0; Upper`-case roman numbers.]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [* Alternative real number formatters]&]
|
||||
[s0; &]
|
||||
[ {{1426:8574 [s0; [* n]]
|
||||
:: [s0; fixed decimals]
|
||||
:: [s0; [* v]]
|
||||
:: [s0; valid decimals]
|
||||
:: [s0; [* ne], [* ve]]
|
||||
:: [s0; force exponential notation]
|
||||
:: [s0; [* nf], [* vf]]
|
||||
:: [s0; force fixed notation]
|
||||
:: [s0; [* nl], [* vl]]
|
||||
:: [s0; locale/language`-based formatting (can use `',`' instead of
|
||||
`'.`' and add thousands separators)]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; The format of [*@(0.0.255) options] of alternative real number
|
||||
formatters is&]
|
||||
[s0; &]
|
||||
[s0; [*@4 `[][* `+][*@4 `]`[`[][* `-][*@4 `]][*@(0.0.255) digits][*@4 `]`[][* `@][*@4 `]`[][* ,][*@4 `]`[][* !
|
||||
][*@4 `]`[][* `^][*@4 `[][* `+][*@4 `]][*@(0.0.255) expdig][*@4 `]]&]
|
||||
[s0; &]
|
||||
[ {{1426:8574 [s0; `+]
|
||||
:: [s0; always prepend sign (even if positive number)]
|
||||
:: [s0; [*@4 `[][* `-][*@4 `]][*@(0.0.255) digits]]
|
||||
:: [s0; number of decimals to print (negative `= left of decimal point,
|
||||
default `= 6)]
|
||||
:: [s0; `@]
|
||||
:: [s0; do not use thousands separators (in internationalized formatting
|
||||
[* nl] or [* vl])]
|
||||
:: [s0; [* ,]]
|
||||
:: [s0; use `',`' instead of `'.`' for decimal point]
|
||||
:: [s0; [* !]]
|
||||
:: [s0; keep insignificant zeros]
|
||||
:: [s0; [* `^]]
|
||||
:: [s0; exponent options:&]
|
||||
[ {{5000:5000 [s0; [* `+]]
|
||||
:: [s0; always prepend sign to exponent]
|
||||
:: [s0; [*@(0.0.255) expdig]]
|
||||
:: [s0; exponent padding width]}}]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- [*/ Examples of standard formatters]&]
|
||||
[s0; &]
|
||||
[s0;3%- &]
|
||||
[ {{5073:4927 [s0;%- Format(`"[* %d, %s]`", 123, `"TEXT`")]
|
||||
:: [s0;%- 123, TEXT]
|
||||
:: [s0;%- Format(`"[* %2:s, %1:d]`", 123, `"TEXT`")]
|
||||
:: [s0;%- TEXT, 123]
|
||||
:: [s0;%- Format(`"[* %010d]`", 123)]
|
||||
:: [s0;%- 0000000123]
|
||||
:: [s0;%- Format(`"[* %0`*d]`", 11, 123)]
|
||||
:: [s0;%- 00000000123]
|
||||
:: [s0;%- Format(`"[* `|%20<d`|]`", 123)]
|
||||
:: [s0;%- `|123 `|]
|
||||
:: [s0;%- Format(`"[* `|%20>d`|]`", 123)]
|
||||
:: [s0;%- `| 123`|]
|
||||
:: [s0;%- Format(`"[* `|%20`=d`|]`", 123)]
|
||||
:: [s0;%- `| 123 `|]
|
||||
:: [s0;%- Format(`"[* %dpt]`", 123)]
|
||||
:: [s0;%- 123pt]
|
||||
:: [s0;%- Format(`"[* %`[empty`]`~d, %`[empty`]`~d]`", 123, Null)]
|
||||
:: [s0;%- 123, empty]
|
||||
:: [s0;%- Format(`"[* %]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %c]`", 65)]
|
||||
:: [s0;%- A]
|
||||
:: [s0;%- Format(`"[* %d]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %i]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %o]`", 123)]
|
||||
:: [s0;%- 173]
|
||||
:: [s0;%- Format(`"[* %x]`", 123)]
|
||||
:: [s0;%- 7b]
|
||||
:: [s0;%- Format(`"[* %X]`", 123)]
|
||||
:: [s0;%- 7B]
|
||||
:: [s0;%- Format(`"[* %e]`", 1234567.89)]
|
||||
:: [s0;%- 1.234568e`+006]
|
||||
:: [s0;%- Format(`"[* %E]`", 1234567.89)]
|
||||
:: [s0;%- 1.234568E`+006]
|
||||
:: [s0;%- Format(`"[* %f]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.890000]
|
||||
:: [s0;%- Format(`"[* %g]`", 1234567.89)]
|
||||
:: [s0;%- 1.23457e`+006]
|
||||
:: [s0;%- Format(`"[* %G]`", 1234567.89)]
|
||||
:: [s0;%- 1.23457E`+006]
|
||||
:: [s0;%- Format(`"[* %n]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %,n]`", 1234567.89)]
|
||||
:: [s0;%- 1234567,89]
|
||||
:: [s0;%- Format(`"[* %`+n]`", 1234567.89)]
|
||||
:: [s0;%- `+1234567.89]
|
||||
:: [s0;%- Format(`"[* %2,n]`", 123.456)]
|
||||
:: [s0;%- 123,46]
|
||||
:: [s0;%- Format(`"[* %2,n]`", 123)]
|
||||
:: [s0;%- 123]
|
||||
:: [s0;%- Format(`"[* %2!,n]`", 123)]
|
||||
:: [s0;%- 123.00]
|
||||
:: [s0;%- Format(`"[* %ne]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %nf]`", 1234567.89e30)]
|
||||
:: [s0;%- 1234567890000000000000000000000000000]
|
||||
:: [s0;%- Format(`"[* %nl]`", 1234567.89)]
|
||||
:: [s0;%- 1,234,567.89]
|
||||
:: [s0;%- Format(`"[* %`@nl]`", 1234567.89)]
|
||||
:: [s0;%- 1234567.89]
|
||||
:: [s0;%- Format(`"[* %`@,nl]`", 1234567.89)]
|
||||
:: [s0;%- 1234567,89]
|
||||
:: [s0;%- Format(`"[* %v]`", 1234567.89)]
|
||||
:: [s0;%- 1234570]
|
||||
:: [s0;%- Format(`"[* %ve]`", 1234567.89)]
|
||||
:: [s0;%- 1234570]
|
||||
:: [s0;%- Format(`"[* %vf]`", 1234567.89e30)]
|
||||
:: [s0;%- 1234570000000000000000000000000000000]
|
||||
:: [s0;%- Format(`"[* %vl]`", 1234567.89)]
|
||||
:: [s0;%- 1,234,570]
|
||||
:: [s0;%- Format(`"[* %`[1:one;2:two;3:three;another`]s]`", 2)]
|
||||
:: [s0;%- two]
|
||||
:: [s0;%- Format(`"[* %`[1:one;2:two;3:three;another`]s]`", 20)]
|
||||
:: [s0;%- another]
|
||||
:: [s0;%- Format(`"[* %`[3%1:one;2:two;3:three;another`]s]`", 20)]
|
||||
:: [s0;%- two]
|
||||
:: [s0;%- Format(`"[* %month]`", 6)]
|
||||
:: [s0;%- june]
|
||||
:: [s0;%- Format(`"[* %Month]`", 6)]
|
||||
:: [s0;%- June]
|
||||
:: [s0;%- Format(`"[* %MONTH]`", 6)]
|
||||
:: [s0;%- JUNE]
|
||||
:: [s0;%- Format(`"[* %mon]`", 6)]
|
||||
:: [s0;%- jun]
|
||||
:: [s0;%- Format(`"[* %Mon]`", 6)]
|
||||
:: [s0;%- Jun]
|
||||
:: [s0;%- Format(`"[* %MON]`", 6)]
|
||||
:: [s0;%- JUN]
|
||||
:: [s0;%- Format(`"[* %day]`", 6)]
|
||||
:: [s0;%- saturday]
|
||||
:: [s0;%- Format(`"[* %Day]`", 6)]
|
||||
:: [s0;%- Saturday]
|
||||
:: [s0;%- Format(`"[* %DAY]`", 6)]
|
||||
:: [s0;%- SATURDAY]
|
||||
:: [s0;%- Format(`"[* %dy]`", 6)]
|
||||
:: [s0;%- sa]
|
||||
:: [s0;%- Format(`"[* %Dy]`", 6)]
|
||||
:: [s0;%- Sa]
|
||||
:: [s0;%- Format(`"[* %DY]`", 6)]
|
||||
:: [s0;%- SA]
|
||||
:: [s0;%- Format(`"[* %tw]`", 0)]
|
||||
:: [s0;%- 12]
|
||||
:: [s0;%- Format(`"[* %tw]`", 5)]
|
||||
:: [s0;%- 5]
|
||||
:: [s0;%- Format(`"[* %tw]`", 15)]
|
||||
:: [s0;%- 3]
|
||||
:: [s0;%- Format(`"[* %0tw]`", 15)]
|
||||
:: [s0;%- 03]
|
||||
:: [s0;%- Format(`"[* %a]`", 1)]
|
||||
:: [s0;%- a]
|
||||
:: [s0;%- Format(`"[* %a]`", 123)]
|
||||
:: [s0;%- es]
|
||||
:: [s0;%- Format(`"[* %A]`", 1)]
|
||||
:: [s0;%- A]
|
||||
:: [s0;%- Format(`"[* %A]`", 123)]
|
||||
:: [s0;%- ES]
|
||||
:: [s0;%- Format(`"[* %r]`", 8)]
|
||||
:: [s0;%- viii]
|
||||
:: [s0;%- Format(`"[* %R]`", 1231)]
|
||||
:: [s0;%- MCCXXXI]
|
||||
:: [s0;%- Format(`"[* %]`", GetSysDate())]
|
||||
:: [s0;%- 11/11/2011]
|
||||
:: [s0;%- Format(`"[* %]`", GetSysTime())]
|
||||
:: [s0;%- 11/11/2011 14:44:11]
|
||||
:: [s0;%- Format(`"[* %]`", `"text`")]
|
||||
:: [s0;%- text]}}&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0;%- [*@3+117 Registering custom formatters]&]
|
||||
[s0; &]
|
||||
[s5;:Formatter`:`:typedef:%- typedef_[^String^ String]_(`*Formatter)([@(0.0.255) const][@(64) _
|
||||
][^Formatting^@(64) Formatting][@(64) `&_fmt)]&]
|
||||
[s2; Formatter has to have form of function with single [^Formatting^ Formatting]
|
||||
argument.&]
|
||||
[s1; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Formatting]]}}&]
|
||||
[s0;%- &]
|
||||
[s1;:Formatting`:`:struct:%- [@(0.0.255) struct]_[* Formatting]&]
|
||||
[s2; This structure passes all informations to format Value argument
|
||||
to the formatter.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:language:%- [@(0.0.255) int]_[* language]&]
|
||||
[s2; Language of resulting text.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:arg:%- Value_[* arg]&]
|
||||
[s2; Actual argument.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:format:%- String_[* format]&]
|
||||
[s2; Formatting [*@(0.0.255) options].&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Formatting`:`:id:%- String_[* id]&]
|
||||
[s2; Formatter`-id.&]
|
||||
[s1; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Format registration functions]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:RegisterFormatter`(int`,const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regi
|
||||
sterFormatter]([@(0.0.255) int]_[*@3 type], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for specific Value [%-*@3 type]. If [%-*@3 type]
|
||||
is VALUE`_V, formatter is applied to all Value types if no formatter
|
||||
for specific type is specified.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterNumberFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Reg
|
||||
isterNumberFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for bool, int, double and int64 types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterStringFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Reg
|
||||
isterStringFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for String and WString types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterDateTimeFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* R
|
||||
egisterDateTimeFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter for Date and Time types.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterValueFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regi
|
||||
sterValueFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter to be applied when no formatter for specific
|
||||
type is specified.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:RegisterNullFormatter`(const char`*`,Formatter`)init`_:%- [@(0.0.255) void]_[* Regis
|
||||
terNullFormatter]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 id],
|
||||
Formatter_[*@3 f])&]
|
||||
[s2; Registers formatter [%-*@3 id] to be applied when the Value argument
|
||||
is Void (Value()) or ErrorValue.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,66 +1,66 @@
|
|||
topic "NetNode";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 NetNode]]}}&]
|
||||
[s3; &]
|
||||
[s1;:NetNode`:`:class: [@(0.0.255)3 class][3 _][*3 NetNode][3 _:_][@(0.0.255)3 private][3 _][*@3;3 M
|
||||
oveable][@(0.0.255)3 <][*3 NetNode][@(0.0.255)3 >][3 _]&]
|
||||
[s6;l0;%% WIN32 specific&]
|
||||
[s9;%% This class represents single network node (network resource).
|
||||
It is [^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable] and
|
||||
has deep copy.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:NetNode`:`:NetNode`(`): [* NetNode]()&]
|
||||
[s2;%% Default constructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:NetNode`(const NetNode`&`): [* NetNode]([@(0.0.255) const]_[* NetNode][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2;%% Deep copy constructor.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:NetNode`:`:GetName`(`)const: [_^String^ String]_[* GetName]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns the name of network node (e.g. for displaying in GUI).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:GetPath`(`)const: [_^String^ String]_[* GetPath]()_[@(0.0.255) const]&]
|
||||
[s2;%% If node represents a disk share, it returns a path to this
|
||||
share (like `\`\SERVER`\DATA). FindFile can be used to retrieve
|
||||
the list of files on this path (you have to add a file mask).
|
||||
If this method returns empty String, node is not a disk share.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:Enum`(`)const: [_^Array^ Array][@(0.0.255) <][_^NetNode^ NetNode][@(0.0.255) >
|
||||
]_[* Enum]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns the array of subnodes.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:Serialize`(Stream`&`): [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2;%% Serializes the Node.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:EnumRoot`(`): [@(0.0.255) static] [_^Array^ Array][@(0.0.255) <][_^NetNode^ N
|
||||
etNode][@(0.0.255) >]_[* EnumRoot]()&]
|
||||
[s2;%% Enumerates root nodes.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:operator`=`(const NetNode`&`): [_^NetNode^ NetNode][@(0.0.255) `&]_[* opera
|
||||
tor`=]([@(0.0.255) const]_[_^NetNode^ NetNode][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2;%% Deep copy assignment.&]
|
||||
[s3; &]
|
||||
topic "NetNode";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 NetNode]]}}&]
|
||||
[s3; &]
|
||||
[s1;:NetNode`:`:class: [@(0.0.255)3 class][3 _][*3 NetNode][3 _:_][@(0.0.255)3 private][3 _][*@3;3 M
|
||||
oveable][@(0.0.255)3 <][*3 NetNode][@(0.0.255)3 >][3 _]&]
|
||||
[s6;l0;%% WIN32 specific&]
|
||||
[s9;%% This class represents single network node (network resource).
|
||||
It is [^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable] and
|
||||
has deep copy.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:NetNode`:`:NetNode`(`): [* NetNode]()&]
|
||||
[s2;%% Default constructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:NetNode`(const NetNode`&`): [* NetNode]([@(0.0.255) const]_[* NetNode][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2;%% Deep copy constructor.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:NetNode`:`:GetName`(`)const: [_^String^ String]_[* GetName]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns the name of network node (e.g. for displaying in GUI).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:GetPath`(`)const: [_^String^ String]_[* GetPath]()_[@(0.0.255) const]&]
|
||||
[s2;%% If node represents a disk share, it returns a path to this
|
||||
share (like `\`\SERVER`\DATA). FindFile can be used to retrieve
|
||||
the list of files on this path (you have to add a file mask).
|
||||
If this method returns empty String, node is not a disk share.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:Enum`(`)const: [_^Array^ Array][@(0.0.255) <][_^NetNode^ NetNode][@(0.0.255) >
|
||||
]_[* Enum]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns the array of subnodes.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:Serialize`(Stream`&`): [@(0.0.255) void]_[* Serialize]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 s])&]
|
||||
[s2;%% Serializes the Node.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:EnumRoot`(`): [@(0.0.255) static] [_^Array^ Array][@(0.0.255) <][_^NetNode^ N
|
||||
etNode][@(0.0.255) >]_[* EnumRoot]()&]
|
||||
[s2;%% Enumerates root nodes.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NetNode`:`:operator`=`(const NetNode`&`): [_^NetNode^ NetNode][@(0.0.255) `&]_[* opera
|
||||
tor`=]([@(0.0.255) const]_[_^NetNode^ NetNode][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2;%% Deep copy assignment.&]
|
||||
[s3; &]
|
||||
[s0; ]
|
||||
|
|
@ -1,176 +1,176 @@
|
|||
topic "One";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 One]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref: [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][@(0.0.255)3 >]&]
|
||||
[s1;:One`:`:class: [@(0.0.255) class]_[* One]_:_[@(0.0.255) private]_[*@3 MoveableAndDeepCopyO
|
||||
ption][@(0.0.255) <]_[* One][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s8;%% [%-*C@4 T]-|Type or base class of element stored in One.&]
|
||||
[s0;%% &]
|
||||
[s9;%% One is a container capable of containing none or single element
|
||||
of type specified as template argument or derived from it.&]
|
||||
[s9;%% The container is similar to [^http`:`/`/en`.cppreference`.com`/w`/cpp`/memory`/unique`_ptr^ s
|
||||
td`::unique`_ptr]., but unlike it, it is treated more like container
|
||||
than smart pointer. For example, it propagates constantness of
|
||||
One to contained element.&]
|
||||
[s9;%% One is [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/
|
||||
]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick and
|
||||
optional clone] transfer semantics.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor List]]}}&]
|
||||
[s0;0 &]
|
||||
[s5;:One`:`:One`(`): [* One]()&]
|
||||
[s2;%% Default constructor. Constructs empty One.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:One`(T`*`): [* One]([*@4 T]_`*[*@3 newt])&]
|
||||
[s2;%% Constructs One with content [%-*@3 newt]. Content is specified
|
||||
by pointer to object created using operator new. One takes over
|
||||
ownership of this this object.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:One`(Upp`:`:One`<TT`>`&`&`): [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 TT]>_[* One]([* One]<[*@4 TT]>`&`&_[*@3 p])&]
|
||||
[s2;%% Pick constructor. [%-*@4 TT] must be the same as [%-*@4 T] or
|
||||
derived from [%-*@4 T].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:One`(const One`<T`>`&`,int`): [* One]([@(0.0.255) const]_[* One][@(0.0.255) <][*@4 T
|
||||
][@(0.0.255) >`&]_[*@3 p], [@(0.0.255) int])&]
|
||||
[s6;%% Optional deep copy constructor.&]
|
||||
[s2;%% Requires T to have deep copy constructor or optional deep
|
||||
copy constructor.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:`~One`(`): [@(0.0.255) `~][* One]()&]
|
||||
[s2;%% Default destructor.&]
|
||||
[s3; &]
|
||||
[s1;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Method List]]}}&]
|
||||
[s0;0 &]
|
||||
[s5;:One`:`:Clear`(`): [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes the element stored in [* One].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:IsPicked`(`)const: [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if [* One] has been picked.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:Attach`(T`*`): [@(0.0.255) void]_[* Attach]([*@4 T]_`*[*@3 data])&]
|
||||
[s2;%% Assigns element to One. (Note: if there is content in One while
|
||||
calling this function, it is destroyed). [%-*C@3 data] must be
|
||||
pointer to the new content created using operator new.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Detach`(`): [*@4 T]_`*[* Detach]()&]
|
||||
[s2;%% Removes content giving up ownership. Client is responsible
|
||||
for deletion of content. If One is empty, return value is NULL,
|
||||
otherwise the return value is pointer to the content allocated
|
||||
on the heap.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`=`(T`*`): [@(0.0.255) void]_[* operator`=]([*@4 T]_`*[*@3 data])&]
|
||||
[s7;%% Same as Attach([%-*@3 data]) (operator version).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:operator`=`(Upp`:`:One`<TT`>`&`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 TT]>_[@(0.0.255) void]_[* operator`=]([_^Upp`:`:One^ One]<[*@4 TT]>`&`&_[*@3 d])&]
|
||||
[s2;%% Pick assignment. [%-*@4 TT] must be the same as [%-*@4 T] or derived
|
||||
from [%-*@4 T].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`-`>`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`->]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Constant content access operator. Illegal if there is no content.
|
||||
Returns constant pointer to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`-`>`(`): [*@4 T]_`*[* operator`->]()&]
|
||||
[s2;%% Content access operator. Illegal if there is no content. Returns
|
||||
pointer to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`~`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) co
|
||||
nst]&]
|
||||
[s5;:Upp`:`:One`:`:Get`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* Get]()_[@(0.0.255) const]&]
|
||||
[s2;%% Constant content pointer access. Returns constant pointer
|
||||
to content or NULL when there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`~`(`): [*@4 T]_`*[* operator`~]()&]
|
||||
[s5;:Upp`:`:One`:`:Get`(`): [*@4 T]_`*[* Get]()&]
|
||||
[s2;%% Content pointer access. Returns pointer to content or NULL
|
||||
when there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`*`(`)const: [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* operator`*]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Content constant reference access. Illegal if there is no
|
||||
content. Returns constant reference to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`*`(`): [*@4 T][@(0.0.255) `&]_[* operator`*]()&]
|
||||
[s2;%% Content reference access. Illegal if there is no content.
|
||||
Returns reference to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Create`(Args`.`.`.args`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
T], [@(0.0.255) class...]_[*@4 Args]>_[*@4 TT][@(0.0.255) `&]_[* Create]([*@4 Args][@(0.0.255) .
|
||||
..]_args)&]
|
||||
[s2;%% Creates [%-*@4 TT] content in One. If there is content in One
|
||||
while calling this function, it is destroyed. Additional arguments
|
||||
can be specified for [%-*@4 TT ]constructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Create`(`): [*@4 T][@(0.0.255) `&]_[* Create]()&]
|
||||
[s2;%% Creates [%-*@4 T] content in One (default constructed).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:Is`(`)const: [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>_[@(0.0.255) bool
|
||||
]_[* Is]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns true if One contains object of type [%-*@4 TT] or derived
|
||||
from [%-*@4 TT]. [%-*@4 T] must be polymorphic.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:IsEmpty`(`)const: [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator bool`(`)const: [* operator_bool]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if there is content.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 MakeOne]]}}&]
|
||||
[s0; &]
|
||||
[s3; &]
|
||||
[s1;:noref: [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][3 >]&]
|
||||
[s1;:Upp`:`:MakeOne`:`:struct: [@(0.0.255) struct]_[* MakeOne]_:_[@(0.0.255) public]_[*@3 One]<
|
||||
[*@4 T]>_&]
|
||||
[s2;%% [%-*C@4 T]-|Type or base class of element stored in One.&]
|
||||
[s0; &]
|
||||
[s0; This is a simple helper class `- constructors of MakeOne call
|
||||
One`::Create method to actually create contained object.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Upp`:`:MakeOne`:`:MakeOne`(Args`.`.`.args`): [@(0.0.255) template]_<[@(0.0.255) clas
|
||||
s...]_[*@4 Args]>_[* MakeOne]([*@4 Args][@(0.0.255) ...]_args)&]
|
||||
[s2;%% Creates contained object with variable number of parameters.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:MakeOne`:`:MakeOne`(`): [* MakeOne]()&]
|
||||
[s2;%% Creates contained object with no parameters (GCC bug workaround).&]
|
||||
[s3; &]
|
||||
topic "One";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 One]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref: [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][@(0.0.255)3 >]&]
|
||||
[s1;:One`:`:class: [@(0.0.255) class]_[* One]_:_[@(0.0.255) private]_[*@3 MoveableAndDeepCopyO
|
||||
ption][@(0.0.255) <]_[* One][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&]
|
||||
[s8;%% [%-*C@4 T]-|Type or base class of element stored in One.&]
|
||||
[s0;%% &]
|
||||
[s9;%% One is a container capable of containing none or single element
|
||||
of type specified as template argument or derived from it.&]
|
||||
[s9;%% The container is similar to [^http`:`/`/en`.cppreference`.com`/w`/cpp`/memory`/unique`_ptr^ s
|
||||
td`::unique`_ptr]., but unlike it, it is treated more like container
|
||||
than smart pointer. For example, it propagates constantness of
|
||||
One to contained element.&]
|
||||
[s9;%% One is [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/
|
||||
]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick and
|
||||
optional clone] transfer semantics.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor List]]}}&]
|
||||
[s0;0 &]
|
||||
[s5;:One`:`:One`(`): [* One]()&]
|
||||
[s2;%% Default constructor. Constructs empty One.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:One`(T`*`): [* One]([*@4 T]_`*[*@3 newt])&]
|
||||
[s2;%% Constructs One with content [%-*@3 newt]. Content is specified
|
||||
by pointer to object created using operator new. One takes over
|
||||
ownership of this this object.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:One`(Upp`:`:One`<TT`>`&`&`): [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 TT]>_[* One]([* One]<[*@4 TT]>`&`&_[*@3 p])&]
|
||||
[s2;%% Pick constructor. [%-*@4 TT] must be the same as [%-*@4 T] or
|
||||
derived from [%-*@4 T].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:One`(const One`<T`>`&`,int`): [* One]([@(0.0.255) const]_[* One][@(0.0.255) <][*@4 T
|
||||
][@(0.0.255) >`&]_[*@3 p], [@(0.0.255) int])&]
|
||||
[s6;%% Optional deep copy constructor.&]
|
||||
[s2;%% Requires T to have deep copy constructor or optional deep
|
||||
copy constructor.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:`~One`(`): [@(0.0.255) `~][* One]()&]
|
||||
[s2;%% Default destructor.&]
|
||||
[s3; &]
|
||||
[s1;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Method List]]}}&]
|
||||
[s0;0 &]
|
||||
[s5;:One`:`:Clear`(`): [@(0.0.255) void]_[* Clear]()&]
|
||||
[s2; Removes the element stored in [* One].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:IsPicked`(`)const: [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if [* One] has been picked.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:Attach`(T`*`): [@(0.0.255) void]_[* Attach]([*@4 T]_`*[*@3 data])&]
|
||||
[s2;%% Assigns element to One. (Note: if there is content in One while
|
||||
calling this function, it is destroyed). [%-*C@3 data] must be
|
||||
pointer to the new content created using operator new.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Detach`(`): [*@4 T]_`*[* Detach]()&]
|
||||
[s2;%% Removes content giving up ownership. Client is responsible
|
||||
for deletion of content. If One is empty, return value is NULL,
|
||||
otherwise the return value is pointer to the content allocated
|
||||
on the heap.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`=`(T`*`): [@(0.0.255) void]_[* operator`=]([*@4 T]_`*[*@3 data])&]
|
||||
[s7;%% Same as Attach([%-*@3 data]) (operator version).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:operator`=`(Upp`:`:One`<TT`>`&`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 TT]>_[@(0.0.255) void]_[* operator`=]([_^Upp`:`:One^ One]<[*@4 TT]>`&`&_[*@3 d])&]
|
||||
[s2;%% Pick assignment. [%-*@4 TT] must be the same as [%-*@4 T] or derived
|
||||
from [%-*@4 T].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`-`>`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`->]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Constant content access operator. Illegal if there is no content.
|
||||
Returns constant pointer to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`-`>`(`): [*@4 T]_`*[* operator`->]()&]
|
||||
[s2;%% Content access operator. Illegal if there is no content. Returns
|
||||
pointer to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`~`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) co
|
||||
nst]&]
|
||||
[s5;:Upp`:`:One`:`:Get`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* Get]()_[@(0.0.255) const]&]
|
||||
[s2;%% Constant content pointer access. Returns constant pointer
|
||||
to content or NULL when there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`~`(`): [*@4 T]_`*[* operator`~]()&]
|
||||
[s5;:Upp`:`:One`:`:Get`(`): [*@4 T]_`*[* Get]()&]
|
||||
[s2;%% Content pointer access. Returns pointer to content or NULL
|
||||
when there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`*`(`)const: [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* operator`*]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Content constant reference access. Illegal if there is no
|
||||
content. Returns constant reference to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator`*`(`): [*@4 T][@(0.0.255) `&]_[* operator`*]()&]
|
||||
[s2;%% Content reference access. Illegal if there is no content.
|
||||
Returns reference to content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Create`(Args`.`.`.args`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
T], [@(0.0.255) class...]_[*@4 Args]>_[*@4 TT][@(0.0.255) `&]_[* Create]([*@4 Args][@(0.0.255) .
|
||||
..]_args)&]
|
||||
[s2;%% Creates [%-*@4 TT] content in One. If there is content in One
|
||||
while calling this function, it is destroyed. Additional arguments
|
||||
can be specified for [%-*@4 TT ]constructor.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:One`:`:Create`(`): [*@4 T][@(0.0.255) `&]_[* Create]()&]
|
||||
[s2;%% Creates [%-*@4 T] content in One (default constructed).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:Is`(`)const: [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT]>_[@(0.0.255) bool
|
||||
]_[* Is]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns true if One contains object of type [%-*@4 TT] or derived
|
||||
from [%-*@4 TT]. [%-*@4 T] must be polymorphic.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:IsEmpty`(`)const: [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if there is no content.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:One`:`:operator bool`(`)const: [* operator_bool]()_[@(0.0.255) const]&]
|
||||
[s2;%% Returns [* true] if there is content.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 MakeOne]]}}&]
|
||||
[s0; &]
|
||||
[s3; &]
|
||||
[s1;:noref: [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 T][3 >]&]
|
||||
[s1;:Upp`:`:MakeOne`:`:struct: [@(0.0.255) struct]_[* MakeOne]_:_[@(0.0.255) public]_[*@3 One]<
|
||||
[*@4 T]>_&]
|
||||
[s2;%% [%-*C@4 T]-|Type or base class of element stored in One.&]
|
||||
[s0; &]
|
||||
[s0; This is a simple helper class `- constructors of MakeOne call
|
||||
One`::Create method to actually create contained object.&]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Upp`:`:MakeOne`:`:MakeOne`(Args`.`.`.args`): [@(0.0.255) template]_<[@(0.0.255) clas
|
||||
s...]_[*@4 Args]>_[* MakeOne]([*@4 Args][@(0.0.255) ...]_args)&]
|
||||
[s2;%% Creates contained object with variable number of parameters.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:MakeOne`:`:MakeOne`(`): [* MakeOne]()&]
|
||||
[s2;%% Creates contained object with no parameters (GCC bug workaround).&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,121 +1,121 @@
|
|||
topic "Ptr and Pte";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Ptr and Pte]]}}&]
|
||||
[s9; Ptr and Pte class templates provide a smart pointer system that
|
||||
cleared (assigned NULL) when pointed object is destructed. That
|
||||
makes it useful in situations where life`-time of object cannot
|
||||
be precisely determined.&]
|
||||
[s9; While [* Ptr ]class template provides smart pointers, [* Pte ]is
|
||||
the class which adds necessary functionality to pointed objects.
|
||||
[* Ptr ]could only point to objects of [* Pte]`-derived type. So
|
||||
to make a class `"[* Ptr]`-able`" you should add [* Pte ]as one of
|
||||
class bases, with the derived class as its parameter, e.g.:&]
|
||||
[s0; [C+75 struct Foo : Pte<Foo> `{....]&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Pte]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Pte`:`:class:%- [@(0.0.255) class]_[* Pte]_:_[@(0.0.255) public]_[*@3 PteBase]&]
|
||||
[s0; &]
|
||||
[s0; This template class implements the functionality needed in the
|
||||
pointed object. &]
|
||||
[s0; [*C@4 T]-|Type of pointed object.&]
|
||||
[s0; &]
|
||||
[s0; [/ Derived from] [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:PteBase`:`:class PteBase^ P
|
||||
teBase]&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Ptr and Pte]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Ptr`:`:class:%- [@(0.0.255) class]_[* Ptr]_:_[@(0.0.255) public]_[*@3 PtrBase],
|
||||
[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <]_[* Ptr][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_
|
||||
&]
|
||||
[s0;%- &]
|
||||
[s0; Type specific pointer.&]
|
||||
[s0; [*C@4 T]-|Type of pointed object. T class must be derived from
|
||||
Pte<T>.&]
|
||||
[s0; &]
|
||||
[s0; [/ Derived from] [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:PtrBase`:`:PtrBase`(`)^ P
|
||||
trBase]&]
|
||||
[s3; &]
|
||||
[s1;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(`):%- [* Ptr]()&]
|
||||
[s2; Default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(T`*`):%- [* Ptr]([*@4 T]_`*[*@3 ptr])&]
|
||||
[s2; Constructs Ptr pointing to specified object [%-*@3 ptr].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(const Ptr`&`):%- [* Ptr]([@(0.0.255) const]_[* Ptr][@(0.0.255) `&]_[*@3 ptr])&]
|
||||
[s2; Constructs Ptr pointing to the same object as other Ptr [%-*@3 ptr].&]
|
||||
[s3; &]
|
||||
[s1;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Ptr`:`:operator`-`>`(`)const:%- [*@4 T]_`*[* operator`->]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`~`(`)const:%- [*@4 T]_`*[* operator`~]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator T`*`(`)const:%- [* operator_T`*]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`=`(T`*`):%- [_^Ptr^ Ptr][@(0.0.255) `&]_[* operator`=]([*@4 T]_`*[*@3 ptr])
|
||||
&]
|
||||
[s2; Assigns new pointer. Returns `*this.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`=`(const Ptr`&`):%- [_^Ptr^ Ptr][@(0.0.255) `&]_[* operator`=]([@(0.0.255) c
|
||||
onst]_[_^Ptr^ Ptr][@(0.0.255) `&]_[*@3 ptr])&]
|
||||
[s2; Assigns other Ptr. Returns `*this.-|&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:ToString`(`)const:%- [_^String^ String]_[* ToString]()_[@(0.0.255) const]&]
|
||||
[s2; Converts all information to string for diagnostic purposes&]
|
||||
[s3; &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global Operators]]}}&]
|
||||
[s3; &]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _T_`*][@3 a
|
||||
][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )
|
||||
]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (T_`*][@3 a][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _T_`*][@3 a
|
||||
][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )
|
||||
]&]
|
||||
[s2; Comparison operators.&]
|
||||
[s3; &]
|
||||
topic "Ptr and Pte";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Ptr and Pte]]}}&]
|
||||
[s9; Ptr and Pte class templates provide a smart pointer system that
|
||||
cleared (assigned NULL) when pointed object is destructed. That
|
||||
makes it useful in situations where life`-time of object cannot
|
||||
be precisely determined.&]
|
||||
[s9; While [* Ptr ]class template provides smart pointers, [* Pte ]is
|
||||
the class which adds necessary functionality to pointed objects.
|
||||
[* Ptr ]could only point to objects of [* Pte]`-derived type. So
|
||||
to make a class `"[* Ptr]`-able`" you should add [* Pte ]as one of
|
||||
class bases, with the derived class as its parameter, e.g.:&]
|
||||
[s0; [C+75 struct Foo : Pte<Foo> `{....]&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Pte]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Pte`:`:class:%- [@(0.0.255) class]_[* Pte]_:_[@(0.0.255) public]_[*@3 PteBase]&]
|
||||
[s0; &]
|
||||
[s0; This template class implements the functionality needed in the
|
||||
pointed object. &]
|
||||
[s0; [*C@4 T]-|Type of pointed object.&]
|
||||
[s0; &]
|
||||
[s0; [/ Derived from] [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:PteBase`:`:class PteBase^ P
|
||||
teBase]&]
|
||||
[s3; &]
|
||||
[s0;%- &]
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 Ptr and Pte]]}}&]
|
||||
[s3;%- &]
|
||||
[s1;:noref:%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&]
|
||||
[s1;:Ptr`:`:class:%- [@(0.0.255) class]_[* Ptr]_:_[@(0.0.255) public]_[*@3 PtrBase],
|
||||
[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) <]_[* Ptr][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_
|
||||
&]
|
||||
[s0;%- &]
|
||||
[s0; Type specific pointer.&]
|
||||
[s0; [*C@4 T]-|Type of pointed object. T class must be derived from
|
||||
Pte<T>.&]
|
||||
[s0; &]
|
||||
[s0; [/ Derived from] [^topic`:`/`/Core`/src`/PtePtr`$en`-us`#`:`:PtrBase`:`:PtrBase`(`)^ P
|
||||
trBase]&]
|
||||
[s3; &]
|
||||
[s1;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(`):%- [* Ptr]()&]
|
||||
[s2; Default constructor.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(T`*`):%- [* Ptr]([*@4 T]_`*[*@3 ptr])&]
|
||||
[s2; Constructs Ptr pointing to specified object [%-*@3 ptr].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:Ptr`(const Ptr`&`):%- [* Ptr]([@(0.0.255) const]_[* Ptr][@(0.0.255) `&]_[*@3 ptr])&]
|
||||
[s2; Constructs Ptr pointing to the same object as other Ptr [%-*@3 ptr].&]
|
||||
[s3; &]
|
||||
[s1;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Ptr`:`:operator`-`>`(`)const:%- [*@4 T]_`*[* operator`->]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`~`(`)const:%- [*@4 T]_`*[* operator`~]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator T`*`(`)const:%- [* operator_T`*]()_[@(0.0.255) const]&]
|
||||
[s2; Returns a C`+`+ pointer to pointed object or NULL if Ptr does
|
||||
not point to any object.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`=`(T`*`):%- [_^Ptr^ Ptr][@(0.0.255) `&]_[* operator`=]([*@4 T]_`*[*@3 ptr])
|
||||
&]
|
||||
[s2; Assigns new pointer. Returns `*this.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:operator`=`(const Ptr`&`):%- [_^Ptr^ Ptr][@(0.0.255) `&]_[* operator`=]([@(0.0.255) c
|
||||
onst]_[_^Ptr^ Ptr][@(0.0.255) `&]_[*@3 ptr])&]
|
||||
[s2; Assigns other Ptr. Returns `*this.-|&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Ptr`:`:ToString`(`)const:%- [_^String^ String]_[* ToString]()_[@(0.0.255) const]&]
|
||||
[s2; Converts all information to string for diagnostic purposes&]
|
||||
[s3; &]
|
||||
[s0;i448;a25;kKO9;@(0.0.255)%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Global Operators]]}}&]
|
||||
[s3; &]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _T_`*][@3 a
|
||||
][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )
|
||||
]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator`=`=[@(64) (T_`*][@3 a][@(64) ,
|
||||
][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _T_`*][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _T_`*][@3 a
|
||||
][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )]&]
|
||||
[s5;K%- friend_[@(0.0.255) bool][@(64) _]operator!`=[@(64) (][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) P
|
||||
tr][@(64) `&_][@3 a][@(64) , ][@(0.0.255) const][@(64) _][^`:`:Ptr^@(64) Ptr][@(64) `&_][@3 b][@(64) )
|
||||
]&]
|
||||
[s2; Comparison operators.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,222 +1,222 @@
|
|||
topic "Serialization utilities";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@2;4 Serialization utilities]]}}&]
|
||||
[s0;*@3;4 &]
|
||||
[ {{10000t/25b/25@1 [s0;%- [* Function List]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:Pack16`(Stream`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16]([_^Stream^ Str
|
||||
eam][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i])&]
|
||||
[s2; Serializes 32`-bit data, optimizing it for 16`-bit values. If
|
||||
value is in `-32767`-32767 range, it is serialized as 2 bytes,
|
||||
otherwise 6 bytes are used.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [%-*C@3 i]-|Data to serialize.&]
|
||||
[s7; [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1], [@(0.0.255) int`&]_[*@3 i2])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16
|
||||
]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_
|
||||
[* Pack16]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3], [@(0.0.255) int`&]_[*@3 i4])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[* Pack16]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3], [@(0.0.255) int`&]_[*@3 i4],
|
||||
[@(0.0.255) int`&]_[*@3 i5])&]
|
||||
[s2; Calls Pack16 for each of individual 32`-bit integer parameters.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Load`(Callback1`<Stream`&`>`,Stream`&`):%- [@(0.0.255) bool]_[* Load]([_^Callback1^ Ca
|
||||
llback1][@(0.0.255) <][_^Stream^ Stream][@(0.0.255) `&>]_[*@3 serialize],
|
||||
[_^Stream^ Stream][@(0.0.255) `&]_[*@3 stream])&]
|
||||
[s2; Smart serialization restore. Data to serialize are represented
|
||||
by Callback. First, backup of current state of data is performed
|
||||
and stored in memory. Then data are loaded from the specified
|
||||
stream. If restoring of data is successful (no LoadingError exception
|
||||
is thrown), Load returns true. If LoadingError is thrown, it
|
||||
is caught by Load, data are restored from backup copy and Load
|
||||
returns false.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 stream]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Store`(Callback1`<Stream`&`>`,Stream`&`):%- [@(0.0.255) bool]_[* Store]([_^Callback1^ C
|
||||
allback1][@(0.0.255) <][_^Stream^ Stream][@(0.0.255) `&>]_[*@3 serialize],
|
||||
[_^Stream^ Stream][@(0.0.255) `&]_[*@3 stream])&]
|
||||
[s2; Serialization save. Data to serialize are represented by Callback.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 stream]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true if data were properly stored to the stream.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromFile`(Callback1`<Stream`&`>`,const char`*`):%- [@(0.0.255) bool]_[* LoadFrom
|
||||
File]([_^Callback1^ Callback1][@(0.0.255) <]Stream[@(0.0.255) `&>]_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 file]_`=_NULL)&]
|
||||
[s2; Using [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Load`(Callback1`<Stream`&`>`,Stream`&`)^ L
|
||||
oad], data are restored from the file.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 file]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToFile`(Callback1`<Stream`&`>`,const char`*`):%- [@(0.0.255) bool]_[* StoreToFi
|
||||
le]([_^Callback1^ Callback1][@(0.0.255) <]Stream[@(0.0.255) `&>]_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 file]_`=_NULL)&]
|
||||
[s2; Using [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Store`(Callback1`<Stream`&`>`,Stream`&`)^ S
|
||||
tore] data are saved to the file.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 file]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Load`(T`&`,Stream`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_
|
||||
[@(0.0.255) bool]_[* Load]([*@4 T][@(0.0.255) `&]_[*@3 x], [_^Stream^ Stream][@(0.0.255) `&]_[*@3 s
|
||||
])&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Load`(Callback1`<Stream`&`>`,Stream`&`)^ L
|
||||
oad] with callback(`&[@3 x], `&T`::Serialize) as serialization callback.
|
||||
In other words, [@3 x] is restored using its Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Store`(T`&`,Stream`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* Store]([*@4 T][@(0.0.255) `&]_[*@3 x], [_^Stream^ Stream][@(0.0.255) `&]_
|
||||
[*@3 s])&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Store`(T`&`,Stream`&`)^ S
|
||||
tore] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is stored using its Serialize
|
||||
method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromFile`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* LoadFromFile]([*@4 T][@(0.0.255) `&]_[*@3 x], [@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 name]_`=_NULL)&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:LoadFromFile`(Callback1`<Stream`&`>`,const char`*`)^ L
|
||||
oadFromFile] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is restored from the file using
|
||||
its Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 name]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToFile`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* StoreToFile]([*@4 T][@(0.0.255) `&]_[*@3 x], [@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 name]_`=_NULL)&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:StoreToFile`(Callback1`<Stream`&`>`,const char`*`)^ S
|
||||
toreToFile] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is stored to the file using its
|
||||
Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to store.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 name]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreAsString`(T`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_
|
||||
[_^String^ String]_[* StoreAsString]([*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Stores [@3 x] using its Serialize method and StringStream.&]
|
||||
[s7; [*C@4 T]-|Type of object to store.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [*/ Return value]-|String containing serialized [@3 x].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromString`(T`&`,const String`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) bool]_[* LoadFromString]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Restores serialized data from the String (e.g. previously stored
|
||||
by StoreAsString).&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to object.&]
|
||||
[s7; [%-*C@3 s]-|String containing serialized [@3 x].&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [*@3;4 Global modular serialization support]&]
|
||||
[s0;# Modular serialization is a viable option for storing configuration
|
||||
of applications consisting of many modules. It allows individual
|
||||
storing/loading data for given global configuration key and also
|
||||
serialization of all such data with single stream.&]
|
||||
[s0;3 &]
|
||||
[ {{10000t/25b/25@1 [s0;%- [* Function List]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:RegisterGlobalConfig`(const char`*`):%- [@(0.0.255) void]_[* RegisterGlobalConfig]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s7; Registers name as global configuration key.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:RegisterGlobalSerialize`(const char`*`,Upp`:`:Event`<Upp`:`:Stream`&`>`):%- [@(0.0.255) v
|
||||
oid]_[* RegisterGlobalSerialize]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name],
|
||||
[_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 WhenSerialize])&]
|
||||
[s2; Registers name as global configuration key. [%-*@3 WhenSerialize]
|
||||
is directly used to serialize data, unlike other variants of
|
||||
global config key, where data are stored / retrieved using LoadFromGlobal
|
||||
/ StoreToGlobal.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:RegisterGlobalConfig`(const char`*`,Upp`:`:Event`<`>`):%- [@(0.0.255) void]_
|
||||
[* RegisterGlobalConfig]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name],
|
||||
[_^Upp`:`:Event^ Event]<>_[*@3 WhenFlush])&]
|
||||
[s2; Registers name as global configuration key. [%-*C@3 WhenFlush]
|
||||
is called before storing of all configuration keys is performed
|
||||
by SerializeGlobalConfigs `- this is useful when StoreToGlobal
|
||||
has to be explicitly triggered before storing configuration.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromGlobal`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) bool]_[* LoadFromGlobal]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Loads [%-*@3 x] from global configuration key [%-*@3 name], using
|
||||
Serialize method of T.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToGlobal`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) void]_[* StoreToGlobal]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Stores [@3 x] to global configuration key [%-*@3 name], using Serialize
|
||||
method of T.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:LoadFromGlobal`(Upp`:`:Event`<Upp`:`:Stream`&`>`,const char`*`):%- [@(0.0.255) b
|
||||
ool]_[* LoadFromGlobal]([_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Loads [%-*@3 x] from global configuration key [%-*@3 name], using
|
||||
[%-*@3 serialize] as serialization function.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:StoreToGlobal`(Upp`:`:Event`<Upp`:`:Stream`&`>`,const char`*`):%- [@(0.0.255) v
|
||||
oid]_[* StoreToGlobal]([_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Stores [@3 x] to global configuration key [%-*@3 name], using [%-*@3 serialize]
|
||||
as serialization function.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SerializeGlobalConfigs`(Stream`&`):%- [@(0.0.255) void]_[* SerializeGlobalConfigs]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Serializes all registered global configuration data from/to
|
||||
single stream.&]
|
||||
[s3; &]
|
||||
topic "Serialization utilities";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@2;4 Serialization utilities]]}}&]
|
||||
[s0;*@3;4 &]
|
||||
[ {{10000t/25b/25@1 [s0;%- [* Function List]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:Pack16`(Stream`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16]([_^Stream^ Str
|
||||
eam][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i])&]
|
||||
[s2; Serializes 32`-bit data, optimizing it for 16`-bit values. If
|
||||
value is in `-32767`-32767 range, it is serialized as 2 bytes,
|
||||
otherwise 6 bytes are used.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [%-*C@3 i]-|Data to serialize.&]
|
||||
[s7; [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1], [@(0.0.255) int`&]_[*@3 i2])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_[* Pack16
|
||||
]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&]_
|
||||
[* Pack16]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3], [@(0.0.255) int`&]_[*@3 i4])&]
|
||||
[s5;:Pack16`(Stream`&`,int`&`,int`&`,int`&`,int`&`,int`&`):%- [_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[* Pack16]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) int`&]_[*@3 i1],
|
||||
[@(0.0.255) int`&]_[*@3 i2], [@(0.0.255) int`&]_[*@3 i3], [@(0.0.255) int`&]_[*@3 i4],
|
||||
[@(0.0.255) int`&]_[*@3 i5])&]
|
||||
[s2; Calls Pack16 for each of individual 32`-bit integer parameters.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Load`(Callback1`<Stream`&`>`,Stream`&`):%- [@(0.0.255) bool]_[* Load]([_^Callback1^ Ca
|
||||
llback1][@(0.0.255) <][_^Stream^ Stream][@(0.0.255) `&>]_[*@3 serialize],
|
||||
[_^Stream^ Stream][@(0.0.255) `&]_[*@3 stream])&]
|
||||
[s2; Smart serialization restore. Data to serialize are represented
|
||||
by Callback. First, backup of current state of data is performed
|
||||
and stored in memory. Then data are loaded from the specified
|
||||
stream. If restoring of data is successful (no LoadingError exception
|
||||
is thrown), Load returns true. If LoadingError is thrown, it
|
||||
is caught by Load, data are restored from backup copy and Load
|
||||
returns false.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 stream]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Store`(Callback1`<Stream`&`>`,Stream`&`):%- [@(0.0.255) bool]_[* Store]([_^Callback1^ C
|
||||
allback1][@(0.0.255) <][_^Stream^ Stream][@(0.0.255) `&>]_[*@3 serialize],
|
||||
[_^Stream^ Stream][@(0.0.255) `&]_[*@3 stream])&]
|
||||
[s2; Serialization save. Data to serialize are represented by Callback.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 stream]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true if data were properly stored to the stream.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromFile`(Callback1`<Stream`&`>`,const char`*`):%- [@(0.0.255) bool]_[* LoadFrom
|
||||
File]([_^Callback1^ Callback1][@(0.0.255) <]Stream[@(0.0.255) `&>]_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 file]_`=_NULL)&]
|
||||
[s2; Using [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Load`(Callback1`<Stream`&`>`,Stream`&`)^ L
|
||||
oad], data are restored from the file.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 file]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToFile`(Callback1`<Stream`&`>`,const char`*`):%- [@(0.0.255) bool]_[* StoreToFi
|
||||
le]([_^Callback1^ Callback1][@(0.0.255) <]Stream[@(0.0.255) `&>]_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 file]_`=_NULL)&]
|
||||
[s2; Using [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Store`(Callback1`<Stream`&`>`,Stream`&`)^ S
|
||||
tore] data are saved to the file.&]
|
||||
[s7; [%-*C@3 serialize]-|Callback to the serialization function.&]
|
||||
[s7; [%-*C@3 file]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Load`(T`&`,Stream`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_
|
||||
[@(0.0.255) bool]_[* Load]([*@4 T][@(0.0.255) `&]_[*@3 x], [_^Stream^ Stream][@(0.0.255) `&]_[*@3 s
|
||||
])&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Load`(Callback1`<Stream`&`>`,Stream`&`)^ L
|
||||
oad] with callback(`&[@3 x], `&T`::Serialize) as serialization callback.
|
||||
In other words, [@3 x] is restored using its Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Store`(T`&`,Stream`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* Store]([*@4 T][@(0.0.255) `&]_[*@3 x], [_^Stream^ Stream][@(0.0.255) `&]_
|
||||
[*@3 s])&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Store`(T`&`,Stream`&`)^ S
|
||||
tore] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is stored using its Serialize
|
||||
method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 s]-|Stream.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromFile`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* LoadFromFile]([*@4 T][@(0.0.255) `&]_[*@3 x], [@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 name]_`=_NULL)&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:LoadFromFile`(Callback1`<Stream`&`>`,const char`*`)^ L
|
||||
oadFromFile] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is restored from the file using
|
||||
its Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 name]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToFile`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[@(0.0.255) bool]_[* StoreToFile]([*@4 T][@(0.0.255) `&]_[*@3 x], [@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 name]_`=_NULL)&]
|
||||
[s2; Calls [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:StoreToFile`(Callback1`<Stream`&`>`,const char`*`)^ S
|
||||
toreToFile] with callback(`&[@3 x], `&T`::Serialize) as serialization
|
||||
callback. In other words, [@3 x] is stored to the file using its
|
||||
Serialize method.&]
|
||||
[s7; [*C@4 T]-|Type of object to store.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [%-*C@3 name]-|Filename.&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreAsString`(T`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_
|
||||
[_^String^ String]_[* StoreAsString]([*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2; Stores [@3 x] using its Serialize method and StringStream.&]
|
||||
[s7; [*C@4 T]-|Type of object to store.&]
|
||||
[s7; [%-*C@3 x]-|Reference to the object.&]
|
||||
[s7; [*/ Return value]-|String containing serialized [@3 x].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromString`(T`&`,const String`&`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) bool]_[* LoadFromString]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Restores serialized data from the String (e.g. previously stored
|
||||
by StoreAsString).&]
|
||||
[s7; [*C@4 T]-|Type of object to restore.&]
|
||||
[s7; [%-*C@3 x]-|Reference to object.&]
|
||||
[s7; [%-*C@3 s]-|String containing serialized [@3 x].&]
|
||||
[s7; [*/ Return value]-|true indicates success.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; &]
|
||||
[s0; [*@3;4 Global modular serialization support]&]
|
||||
[s0;# Modular serialization is a viable option for storing configuration
|
||||
of applications consisting of many modules. It allows individual
|
||||
storing/loading data for given global configuration key and also
|
||||
serialization of all such data with single stream.&]
|
||||
[s0;3 &]
|
||||
[ {{10000t/25b/25@1 [s0;%- [* Function List]]}}&]
|
||||
[s0;0%- &]
|
||||
[s5;:RegisterGlobalConfig`(const char`*`):%- [@(0.0.255) void]_[* RegisterGlobalConfig]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s7; Registers name as global configuration key.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:RegisterGlobalSerialize`(const char`*`,Upp`:`:Event`<Upp`:`:Stream`&`>`):%- [@(0.0.255) v
|
||||
oid]_[* RegisterGlobalSerialize]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name],
|
||||
[_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 WhenSerialize])&]
|
||||
[s2; Registers name as global configuration key. [%-*@3 WhenSerialize]
|
||||
is directly used to serialize data, unlike other variants of
|
||||
global config key, where data are stored / retrieved using LoadFromGlobal
|
||||
/ StoreToGlobal.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:RegisterGlobalConfig`(const char`*`,Upp`:`:Event`<`>`):%- [@(0.0.255) void]_
|
||||
[* RegisterGlobalConfig]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name],
|
||||
[_^Upp`:`:Event^ Event]<>_[*@3 WhenFlush])&]
|
||||
[s2; Registers name as global configuration key. [%-*C@3 WhenFlush]
|
||||
is called before storing of all configuration keys is performed
|
||||
by SerializeGlobalConfigs `- this is useful when StoreToGlobal
|
||||
has to be explicitly triggered before storing configuration.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:LoadFromGlobal`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) bool]_[* LoadFromGlobal]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Loads [%-*@3 x] from global configuration key [%-*@3 name], using
|
||||
Serialize method of T.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:StoreToGlobal`(T`&`,const char`*`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T
|
||||
][@(0.0.255) >]_[@(0.0.255) void]_[* StoreToGlobal]([*@4 T][@(0.0.255) `&]_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Stores [@3 x] to global configuration key [%-*@3 name], using Serialize
|
||||
method of T.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:LoadFromGlobal`(Upp`:`:Event`<Upp`:`:Stream`&`>`,const char`*`):%- [@(0.0.255) b
|
||||
ool]_[* LoadFromGlobal]([_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 serialize],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Loads [%-*@3 x] from global configuration key [%-*@3 name], using
|
||||
[%-*@3 serialize] as serialization function.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:StoreToGlobal`(Upp`:`:Event`<Upp`:`:Stream`&`>`,const char`*`):%- [@(0.0.255) v
|
||||
oid]_[* StoreToGlobal]([_^Upp`:`:Event^ Event]<Stream[@(0.0.255) `&]>_[*@3 x],
|
||||
[@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name])&]
|
||||
[s2; Stores [@3 x] to global configuration key [%-*@3 name], using [%-*@3 serialize]
|
||||
as serialization function.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:SerializeGlobalConfigs`(Stream`&`):%- [@(0.0.255) void]_[* SerializeGlobalConfigs]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s])&]
|
||||
[s2; Serializes all registered global configuration data from/to
|
||||
single stream.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
|
|
@ -1,177 +1,177 @@
|
|||
topic "Stream utilities";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@2;4 Stream helpers]]}}&]
|
||||
[s0;%% &]
|
||||
[ {{10000t/25b/25@1 [s0; [* Function List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:LoadStream`(Stream`&`): [_^String^ String]_[* LoadStream]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 in])&]
|
||||
[s2;%% Reads the stream starting with the current position till the
|
||||
end is reached and returns data in String.&]
|
||||
[s7;%% [%-*C@3 in]-|Stream.&]
|
||||
[s7;%% [*/ Return value]-|Content of stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:SaveStream`(Stream`&`,const String`&`): [@(0.0.255) bool]_[* SaveStream]([_^Stream^ St
|
||||
ream][@(0.0.255) `&]_[*@3 out], [@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 dat
|
||||
a])&]
|
||||
[s2;%% Writes data to stream.&]
|
||||
[s7;%% [%-*C@3 out]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 data]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|True if all data were successfully written
|
||||
to the stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:CopyStream`(Stream`&`,Stream`&`,int64`): [_^int64^ int64]_[* CopyStream]([_^Stream^ St
|
||||
ream][@(0.0.255) `&]_[*@3 dest], [_^Stream^ Stream][@(0.0.255) `&]_[*@3 src],
|
||||
[_^int64^ int64]_[*@3 count] `= INT64`_MAX)&]
|
||||
[s2;%% Copies at most [%-*@3 count] bytes from source to destination
|
||||
stream. Returns the actual number of bytes copied. With default
|
||||
[%-*@3 count] value it copies all data from [%-*@3 src] until EOF.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:CoutUTF8`(`): [@(0.0.255) void]_[* CoutUTF8]()&]
|
||||
[s2;%% In Win32, setups console output for UTF8. NOP in POSIX.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Cout`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* Cout]()&]
|
||||
[s2;%% Returns special output stream representing console output.
|
||||
Data written to this stream are displayed as characters in console.
|
||||
In Win32, encoding is converted to default console encoding,
|
||||
or is not convereted at all if CoutUTF8 was called.&]
|
||||
[s7;%% [*/ Return value]-|Console stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Cerr`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* Cerr]()&]
|
||||
[s2;%% Returns special output stream representing console error output.
|
||||
Data written to this stream are displayed as characters in console.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:ReadStdIn`(`): [_^String^ String]_[* ReadStdIn]()&]
|
||||
[s2;%% Reads one line of input data from the console.&]
|
||||
[s7;%% [*/ Return value]-|Console input.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:ReadSecret`(`): [_^Upp`:`:String^ String]_[* ReadSecret]()&]
|
||||
[s2;%% Reads one line of input data from the console without echoing.
|
||||
This function is useful for reading passwords, secret phrases,
|
||||
etc. from the console.&]
|
||||
[s7;%% [*/ Return value]-|Console input.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NilStream`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* NilStream]()&]
|
||||
[s2;%% Returns special stream that is always in IsEof state and simply
|
||||
discards all data written to it.&]
|
||||
[s7;%% [*/ Return value]-|`"Black hole`" stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:LoadFile`(const char`*`): [_^String^ String]_[* LoadFile]([@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 filename])&]
|
||||
[s2;%% Loads the content of specified file.&]
|
||||
[s7;%% [%-*C@3 filename]-|File name.&]
|
||||
[s7;%% [*/ Return value]-|Content of file.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:SaveFile`(const char`*`,const String`&`): [@(0.0.255) bool]_[* SaveFile]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 filename], [@(0.0.255) const]_[_^String^ String][@(0.0.255) `&
|
||||
]_[*@3 data])&]
|
||||
[s2;%% Saves data as the file (overwrites existing).&]
|
||||
[s7;%% [%-*C@3 filename]-|File name.&]
|
||||
[s7;%% [%-*C@3 data]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|true if file was successfully written.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`%`(Stream`&`,T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[_^Stream^ Stream][@(0.0.255) `&]_[* operator%]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s],
|
||||
[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2;%% Serialization operator. Simply invokes x.Serialize(s);&]
|
||||
[s7;%% [*C@4 T]-|Type of variable to be serialized.&]
|
||||
[s7;%% [%-*C@3 s]-|Stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Variable to be serialized.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const char`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<
|
||||
<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 x])
|
||||
&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,char`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) char]_`*[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const String`&`): [_^Stream^ Stream][@(0.0.255) `&]_[* operato
|
||||
r<<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[_^String^ String]_`&[*@3 x
|
||||
])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,char`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) char]_[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- it is written as single character.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const void`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<
|
||||
<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[@(0.0.255) void]_`*[*@3 x])
|
||||
&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- pointer is formatted as hexadecimal
|
||||
value.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,void`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) void]_`*[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- pointer is formatted as hexadecimal
|
||||
value.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2;%% Global stream insertion operator. Calls AsString for x and
|
||||
stores the result to the stream. Global AsString version in turn
|
||||
calls ToString method of x.&]
|
||||
[s7;%% [*C@4 T]-|Type of data to write to the stream.&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3;%% &]
|
||||
topic "Stream utilities";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@2;4 Stream helpers]]}}&]
|
||||
[s0;%% &]
|
||||
[ {{10000t/25b/25@1 [s0; [* Function List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:LoadStream`(Stream`&`): [_^String^ String]_[* LoadStream]([_^Stream^ Stream][@(0.0.255) `&
|
||||
]_[*@3 in])&]
|
||||
[s2;%% Reads the stream starting with the current position till the
|
||||
end is reached and returns data in String.&]
|
||||
[s7;%% [%-*C@3 in]-|Stream.&]
|
||||
[s7;%% [*/ Return value]-|Content of stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:SaveStream`(Stream`&`,const String`&`): [@(0.0.255) bool]_[* SaveStream]([_^Stream^ St
|
||||
ream][@(0.0.255) `&]_[*@3 out], [@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 dat
|
||||
a])&]
|
||||
[s2;%% Writes data to stream.&]
|
||||
[s7;%% [%-*C@3 out]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 data]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|True if all data were successfully written
|
||||
to the stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:CopyStream`(Stream`&`,Stream`&`,int64`): [_^int64^ int64]_[* CopyStream]([_^Stream^ St
|
||||
ream][@(0.0.255) `&]_[*@3 dest], [_^Stream^ Stream][@(0.0.255) `&]_[*@3 src],
|
||||
[_^int64^ int64]_[*@3 count] `= INT64`_MAX)&]
|
||||
[s2;%% Copies at most [%-*@3 count] bytes from source to destination
|
||||
stream. Returns the actual number of bytes copied. With default
|
||||
[%-*@3 count] value it copies all data from [%-*@3 src] until EOF.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:CoutUTF8`(`): [@(0.0.255) void]_[* CoutUTF8]()&]
|
||||
[s2;%% In Win32, setups console output for UTF8. NOP in POSIX.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Cout`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* Cout]()&]
|
||||
[s2;%% Returns special output stream representing console output.
|
||||
Data written to this stream are displayed as characters in console.
|
||||
In Win32, encoding is converted to default console encoding,
|
||||
or is not convereted at all if CoutUTF8 was called.&]
|
||||
[s7;%% [*/ Return value]-|Console stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Cerr`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* Cerr]()&]
|
||||
[s2;%% Returns special output stream representing console error output.
|
||||
Data written to this stream are displayed as characters in console.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:ReadStdIn`(`): [_^String^ String]_[* ReadStdIn]()&]
|
||||
[s2;%% Reads one line of input data from the console.&]
|
||||
[s7;%% [*/ Return value]-|Console input.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:ReadSecret`(`): [_^Upp`:`:String^ String]_[* ReadSecret]()&]
|
||||
[s2;%% Reads one line of input data from the console without echoing.
|
||||
This function is useful for reading passwords, secret phrases,
|
||||
etc. from the console.&]
|
||||
[s7;%% [*/ Return value]-|Console input.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:NilStream`(`): [_^Stream^ Stream][@(0.0.255) `&]_[* NilStream]()&]
|
||||
[s2;%% Returns special stream that is always in IsEof state and simply
|
||||
discards all data written to it.&]
|
||||
[s7;%% [*/ Return value]-|`"Black hole`" stream.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:LoadFile`(const char`*`): [_^String^ String]_[* LoadFile]([@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 filename])&]
|
||||
[s2;%% Loads the content of specified file.&]
|
||||
[s7;%% [%-*C@3 filename]-|File name.&]
|
||||
[s7;%% [*/ Return value]-|Content of file.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:SaveFile`(const char`*`,const String`&`): [@(0.0.255) bool]_[* SaveFile]([@(0.0.255) c
|
||||
onst]_[@(0.0.255) char]_`*[*@3 filename], [@(0.0.255) const]_[_^String^ String][@(0.0.255) `&
|
||||
]_[*@3 data])&]
|
||||
[s2;%% Saves data as the file (overwrites existing).&]
|
||||
[s7;%% [%-*C@3 filename]-|File name.&]
|
||||
[s7;%% [%-*C@3 data]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|true if file was successfully written.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`%`(Stream`&`,T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[_^Stream^ Stream][@(0.0.255) `&]_[* operator%]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s],
|
||||
[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2;%% Serialization operator. Simply invokes x.Serialize(s);&]
|
||||
[s7;%% [*C@4 T]-|Type of variable to be serialized.&]
|
||||
[s7;%% [%-*C@3 s]-|Stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Variable to be serialized.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const char`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<
|
||||
<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 x])
|
||||
&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,char`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) char]_`*[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const String`&`): [_^Stream^ Stream][@(0.0.255) `&]_[* operato
|
||||
r<<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[_^String^ String]_`&[*@3 x
|
||||
])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- all characters are written to the
|
||||
stream.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,char`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) char]_[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- it is written as single character.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const void`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<
|
||||
<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) const]_[@(0.0.255) void]_`*[*@3 x])
|
||||
&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- pointer is formatted as hexadecimal
|
||||
value.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,void`*`): [_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ S
|
||||
tream][@(0.0.255) `&]_[*@3 s], [@(0.0.255) void]_`*[*@3 x])&]
|
||||
[s2;%% Overload of stream insertion operator to get simple case work.
|
||||
Insertion operator uses formatted stream output (Putf).&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write `- pointer is formatted as hexadecimal
|
||||
value.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:operator`<`<`(Stream`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >
|
||||
]_[_^Stream^ Stream][@(0.0.255) `&]_[* operator<<]([_^Stream^ Stream][@(0.0.255) `&]_[*@3 s],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 x])&]
|
||||
[s2;%% Global stream insertion operator. Calls AsString for x and
|
||||
stores the result to the stream. Global AsString version in turn
|
||||
calls ToString method of x.&]
|
||||
[s7;%% [*C@4 T]-|Type of data to write to the stream.&]
|
||||
[s7;%% [%-*C@3 s]-|Output stream.&]
|
||||
[s7;%% [%-*C@3 x]-|Data to write.&]
|
||||
[s7;%% [*/ Return value]-|s for chaining.&]
|
||||
[s3;%% &]
|
||||
[s0;%% ]]
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,128 +1,128 @@
|
|||
topic "Thread";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 Thread]]}}&]
|
||||
[s3; &]
|
||||
[s1;:Thread`:`:class: [@(0.0.255) class]_[* Thread]_:_[@(0.0.255) private]_[*@3 NoCopy]&]
|
||||
[s9;%% Encapsulation of thread.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Thread`:`:Thread`(`): [* Thread]()&]
|
||||
[s2;%% Default constructor.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:`~Thread`(`): [@(0.0.255) `~][* Thread]()&]
|
||||
[s2;%% Destructor. Performs Detach `- thread continues running.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Upp`:`:Thread`:`:Run`(Upp`:`:Function`<void`(`)`>`,bool`): [@(0.0.255) bool]_[* Run](
|
||||
[_^Upp`:`:Function^ Function]<[@(0.0.255) void]_()>_[*@3 cb], [@(0.0.255) bool]_[*@3 noshut
|
||||
down]_`=_[@(0.0.255) false])&]
|
||||
[s2;%% Starts a new thread. If [%-*@3 noshutdown] is true, started
|
||||
thread is not meant to be aware of Shutdown system `- basically
|
||||
it means that it does not affect thread counter.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:Start`(Upp`:`:Function`<void`(`)`>`,bool`): [@(0.0.255) static]
|
||||
[@(0.0.255) void]_[* Start]([_^Upp`:`:Function^ Function]<[@(0.0.255) void]_()>_[*@3 cb],
|
||||
[@(0.0.255) bool]_[*@3 noshutdown]_`=_[@(0.0.255) false])&]
|
||||
[s2;%% Starts a thread and returns immediately (you cannot Wait for
|
||||
the thread to finish in this case). If [%-*@3 noshutdown] is true,
|
||||
started thread is not meant to be aware of Shutdown system `-
|
||||
basically it means that it does not affect thread counter.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Detach`(`): [@(0.0.255) void]_[* Detach]()&]
|
||||
[s2;%% Detaches running thread from the Thread object. It means that
|
||||
thread continues running but is no longer controlled by Thread
|
||||
instance.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Wait`(`): [@(0.0.255) int]_[* Wait]()&]
|
||||
[s2;%% Waits for started thread to finish. (`"join`").&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsOpen`(`)const: [@(0.0.255) bool]_[* IsOpen]()_[@(0.0.255) const]&]
|
||||
[s2;%% Thread represents an existing thread. Note that the thread
|
||||
can be already finished and not running anymore (calling to Wait
|
||||
in that case returns immediately).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:GetId`(`)const: [_^Upp`:`:Thread`:`:Id^ Thread`::Id]_[* GetId]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Returns the system`-unique id of thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:GetHandle`(`)const: HANDLE_[* GetHandle]()_[@(0.0.255) const
|
||||
][*C `[WIN32`]]&]
|
||||
[s5;:Thread`:`:GetHandle`(`)const: pthread`_t_[* GetHandle]()_[@(0.0.255) const
|
||||
][*C `[POSIX`]]&]
|
||||
[s2;%% Returns platform specific handle of thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Sleep`(int`): [@(0.0.255) static] [@(0.0.255) void]_[* Sleep]([@(0.0.255) int]_
|
||||
[*@3 ms])&]
|
||||
[s2;%% Sleep for a given number of milliseconds.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsST`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsST]()&]
|
||||
[s2;%% No additional thread was started yet (only the main thread
|
||||
is running so far).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsMain`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsMain]()&]
|
||||
[s2;%% Returns true if current thread is main.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:GetCount`(`): [@(0.0.255) static] [@(0.0.255) int]_[* GetCount]()&]
|
||||
[s2;%% Number of running threads.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:ShutdownThreads`(`): [@(0.0.255) static] [@(0.0.255) void]_[* ShutdownThread
|
||||
s]()&]
|
||||
[s2;%% Sets the `"Shutdown`" flag on, waits before all threads started
|
||||
without noshutdown true terminate, then sets flag off again.
|
||||
It is meant to be used together with IsShutdownThreads to terminate
|
||||
long running secondary service threads. Main thread calls ShutdownThreads,
|
||||
secondary threads test IsShutdownThreads and if true, exit.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsShutdownThreads`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsShutdownTh
|
||||
reads]()&]
|
||||
[s2;%% True if ShutdownThreads is active. This is supposed to be
|
||||
tested by threads participating in shutdown system.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:AtExit: [@(0.0.255) static]_[@(0.0.255) void]_(`*[* AtExit]([@(0.0.255) void]_
|
||||
(`*[*@3 exitfn])()))()&]
|
||||
[s2;%% Allow to install a function [%-*@3 exitfn] to be called at thread
|
||||
exit. Returns the pointer to function already installed or NULL,
|
||||
client code should call the already installed function (return
|
||||
value is not null)&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:GetCurrentId`(`): [@(0.0.255) static] [_^Upp`:`:Thread`:`:Id^ Threa
|
||||
d`::Id]_[* GetCurrentId]()&]
|
||||
[s2;%% Returns the system`-unique id of calling thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Priority`(int`): [@(0.0.255) bool]_[* Priority]([@(0.0.255) int]_[*@3 percent])
|
||||
&]
|
||||
[s2;%% Sets the treads priority to [%-*@3 percent ][%- (0 to 200)]. In
|
||||
reality, current implementation supports only 5 levels, 25%,
|
||||
75%, 125%, 175% and more than 175%; last two levels require root
|
||||
privileges. Returns true if setting the priority was successful.&]
|
||||
topic "Thread";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 Thread]]}}&]
|
||||
[s3; &]
|
||||
[s1;:Thread`:`:class: [@(0.0.255) class]_[* Thread]_:_[@(0.0.255) private]_[*@3 NoCopy]&]
|
||||
[s9;%% Encapsulation of thread.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor Detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Thread`:`:Thread`(`): [* Thread]()&]
|
||||
[s2;%% Default constructor.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:`~Thread`(`): [@(0.0.255) `~][* Thread]()&]
|
||||
[s2;%% Destructor. Performs Detach `- thread continues running.&]
|
||||
[s3;%% &]
|
||||
[s0;%% &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:Upp`:`:Thread`:`:Run`(Upp`:`:Function`<void`(`)`>`,bool`): [@(0.0.255) bool]_[* Run](
|
||||
[_^Upp`:`:Function^ Function]<[@(0.0.255) void]_()>_[*@3 cb], [@(0.0.255) bool]_[*@3 noshut
|
||||
down]_`=_[@(0.0.255) false])&]
|
||||
[s2;%% Starts a new thread. If [%-*@3 noshutdown] is true, started
|
||||
thread is not meant to be aware of Shutdown system `- basically
|
||||
it means that it does not affect thread counter.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:Start`(Upp`:`:Function`<void`(`)`>`,bool`): [@(0.0.255) static]
|
||||
[@(0.0.255) void]_[* Start]([_^Upp`:`:Function^ Function]<[@(0.0.255) void]_()>_[*@3 cb],
|
||||
[@(0.0.255) bool]_[*@3 noshutdown]_`=_[@(0.0.255) false])&]
|
||||
[s2;%% Starts a thread and returns immediately (you cannot Wait for
|
||||
the thread to finish in this case). If [%-*@3 noshutdown] is true,
|
||||
started thread is not meant to be aware of Shutdown system `-
|
||||
basically it means that it does not affect thread counter.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Detach`(`): [@(0.0.255) void]_[* Detach]()&]
|
||||
[s2;%% Detaches running thread from the Thread object. It means that
|
||||
thread continues running but is no longer controlled by Thread
|
||||
instance.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Wait`(`): [@(0.0.255) int]_[* Wait]()&]
|
||||
[s2;%% Waits for started thread to finish. (`"join`").&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsOpen`(`)const: [@(0.0.255) bool]_[* IsOpen]()_[@(0.0.255) const]&]
|
||||
[s2;%% Thread represents an existing thread. Note that the thread
|
||||
can be already finished and not running anymore (calling to Wait
|
||||
in that case returns immediately).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:GetId`(`)const: [_^Upp`:`:Thread`:`:Id^ Thread`::Id]_[* GetId]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s2;%% Returns the system`-unique id of thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:GetHandle`(`)const: HANDLE_[* GetHandle]()_[@(0.0.255) const
|
||||
][*C `[WIN32`]]&]
|
||||
[s5;:Thread`:`:GetHandle`(`)const: pthread`_t_[* GetHandle]()_[@(0.0.255) const
|
||||
][*C `[POSIX`]]&]
|
||||
[s2;%% Returns platform specific handle of thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Sleep`(int`): [@(0.0.255) static] [@(0.0.255) void]_[* Sleep]([@(0.0.255) int]_
|
||||
[*@3 ms])&]
|
||||
[s2;%% Sleep for a given number of milliseconds.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsST`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsST]()&]
|
||||
[s2;%% No additional thread was started yet (only the main thread
|
||||
is running so far).&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsMain`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsMain]()&]
|
||||
[s2;%% Returns true if current thread is main.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:GetCount`(`): [@(0.0.255) static] [@(0.0.255) int]_[* GetCount]()&]
|
||||
[s2;%% Number of running threads.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:ShutdownThreads`(`): [@(0.0.255) static] [@(0.0.255) void]_[* ShutdownThread
|
||||
s]()&]
|
||||
[s2;%% Sets the `"Shutdown`" flag on, waits before all threads started
|
||||
without noshutdown true terminate, then sets flag off again.
|
||||
It is meant to be used together with IsShutdownThreads to terminate
|
||||
long running secondary service threads. Main thread calls ShutdownThreads,
|
||||
secondary threads test IsShutdownThreads and if true, exit.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:IsShutdownThreads`(`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsShutdownTh
|
||||
reads]()&]
|
||||
[s2;%% True if ShutdownThreads is active. This is supposed to be
|
||||
tested by threads participating in shutdown system.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:AtExit: [@(0.0.255) static]_[@(0.0.255) void]_(`*[* AtExit]([@(0.0.255) void]_
|
||||
(`*[*@3 exitfn])()))()&]
|
||||
[s2;%% Allow to install a function [%-*@3 exitfn] to be called at thread
|
||||
exit. Returns the pointer to function already installed or NULL,
|
||||
client code should call the already installed function (return
|
||||
value is not null)&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Thread`:`:GetCurrentId`(`): [@(0.0.255) static] [_^Upp`:`:Thread`:`:Id^ Threa
|
||||
d`::Id]_[* GetCurrentId]()&]
|
||||
[s2;%% Returns the system`-unique id of calling thread.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Thread`:`:Priority`(int`): [@(0.0.255) bool]_[* Priority]([@(0.0.255) int]_[*@3 percent])
|
||||
&]
|
||||
[s2;%% Sets the treads priority to [%-*@3 percent ][%- (0 to 200)]. In
|
||||
reality, current implementation supports only 5 levels, 25%,
|
||||
75%, 125%, 175% and more than 175%; last two levels require root
|
||||
privileges. Returns true if setting the priority was successful.&]
|
||||
[s0; ]]
|
||||
|
|
@ -1,107 +1,107 @@
|
|||
topic "VectorMap";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 VectorMap]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 K][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 K][@(0.0.255)3 >][3 _>]&]
|
||||
[s1;:VectorMap`:`:class:%- [@(0.0.255) class]_[* VectorMap]_:_[@(0.0.255) public]_[*_^MoveableAndDeepCopyOption^@3 M
|
||||
oveableAndDeepCopyOption][@(0.0.255) <][* VectorMap][@(0.0.255) <][*@4 K],
|
||||
[*@4 T], [*@4 HashFn][@(0.0.255) >]_>, [@(0.0.255) public]_[*_^AMap^@3 AMap][@(0.0.255) <]_[*@4 K
|
||||
], [*@4 T], [_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >], [*@4 HashFn]_>_&]
|
||||
[s0;%- &]
|
||||
[s8; [*@4 K]-|Type of keys. K must have deep copy constructor, be [/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
oveable] and must have operator`=`= defined.&]
|
||||
[s8; [*@4 T]-|Type of elements stored in Vector. T is required to be
|
||||
[/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][/ ]and must
|
||||
have either [/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ deep copy
|
||||
constructor], [/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick
|
||||
constructor] or [/ default constructor].&]
|
||||
[s8; [*@4 HashFn]-|Hashing class. Must have defined unsigned operator()(const
|
||||
K`& x) method returning hash value for elements.&]
|
||||
[s0; &]
|
||||
[s9; Vector flavor of map. Inherits most of its functionality from
|
||||
[^topic`:`/`/Core`/src`/AMap`$en`-us^ AMap] and adds only members
|
||||
specific for its flavor.&]
|
||||
[s9; Like any other NTL container, VectorMap is [*/^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 VectorMap is logic error with exception of:&]
|
||||
[s9;C+75 &]
|
||||
[s0; [*C+75 void operator`=(pick`_ VectorMap`& ][*C@3+75 v][*C+75 ) ][*/C+75 (defined
|
||||
by composition)]&]
|
||||
[s0; [*C+75 void operator<<`=(const AMap`& ][*C@3+75 v][*C+75 ) ][*/C+75 (defined
|
||||
in AMap)]&]
|
||||
[s0; [*C+75 void Clear()]&]
|
||||
[s0; [*C+75 bool IsPicked() const]&]
|
||||
[s0;C+75 &]
|
||||
[s9; Optional deep copy operator is inherited from AMap class. Pick
|
||||
operator is implicitly defined by composition.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(`):%- [* VectorMap]()&]
|
||||
[s2; Default constructor. Constructs empty [* VectorMap].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:VectorMap`:`:VectorMap`(std`:`:initializer`_list`<std`:`:pair`<K`,T`>`>`):%- [* V
|
||||
ectorMap]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/pair^ s
|
||||
td`::pair]<[*@4 K], [*@4 T]>>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:VectorMap`:`:operator`(`)`(const K`&`,const T`&`):%- [*_^Upp`:`:VectorMap^ V
|
||||
ectorMap][@(0.0.255) `&]_[* operator()]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&]_[*@3 k],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Same as Add([%-*@3 k], [%-*@3 v]), returns `*this. Syntax sugar
|
||||
for creating map.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(const VectorMap`&`,int`):%- [* VectorMap]([@(0.0.255) const]_
|
||||
[* VectorMap][@(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; [%-*@3 s][%- -|]Source [* VectorMap].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(pick`_ Index`<K`,HashFn`>`&`,pick`_ Vector`<T`>`&`):%- [* V
|
||||
ectorMap]([@(0.128.128) pick`_]_[_^Index^ Index][@(0.0.255) <][*@4 K],
|
||||
[*@4 HashFn][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <
|
||||
][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs [* VectorMap] from [* Index] of keys and [* Vector]
|
||||
of values. Both source containers should have the same number
|
||||
of elements.&]
|
||||
[s7; [%-*@3 ndx][%- -|]Source Index.&]
|
||||
[s7; [%-*@3 val][%- -|]Source Vector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(pick`_ Vector`<K`>`&`,pick`_ Vector`<T`>`&`):%- [* VectorM
|
||||
ap]([@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <][*@4 K][@(0.0.255) >`&]_[*@3 ndx],
|
||||
[@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs [* VectorMap] from [* Vector] of keys and [* Vector]
|
||||
of values. Both source containers should have the same number
|
||||
of elements.&]
|
||||
[s7; [%-*@3 ndx][%- -|]Source Vector of keys.&]
|
||||
[s7; [%-*@3 val][%- -|]Source Vector of values.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)t/25b/25@1 [s0;%- [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:VectorMap`:`:Pop`(`):%- [*@4 T]_[* Pop]()&]
|
||||
[s2; Drops last element of VectorMap and returns its value.&]
|
||||
[s7; [*/ Return value]-|Value of dropped element.&]
|
||||
[s3; &]
|
||||
topic "VectorMap";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}%EN-US
|
||||
[ {{10000@(113.42.0) [s0; [*@7;4 VectorMap]]}}&]
|
||||
[s3; &]
|
||||
[s1;:noref:%- [@(0.0.255)3 template][3 _<][@(0.0.255)3 class][3 _][*@4;3 K][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 K][@(0.0.255)3 >][3 _>]&]
|
||||
[s1;:VectorMap`:`:class:%- [@(0.0.255) class]_[* VectorMap]_:_[@(0.0.255) public]_[*_^MoveableAndDeepCopyOption^@3 M
|
||||
oveableAndDeepCopyOption][@(0.0.255) <][* VectorMap][@(0.0.255) <][*@4 K],
|
||||
[*@4 T], [*@4 HashFn][@(0.0.255) >]_>, [@(0.0.255) public]_[*_^AMap^@3 AMap][@(0.0.255) <]_[*@4 K
|
||||
], [*@4 T], [_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >], [*@4 HashFn]_>_&]
|
||||
[s0;%- &]
|
||||
[s8; [*@4 K]-|Type of keys. K must have deep copy constructor, be [/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ m
|
||||
oveable] and must have operator`=`= defined.&]
|
||||
[s8; [*@4 T]-|Type of elements stored in Vector. T is required to be
|
||||
[/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][/ ]and must
|
||||
have either [/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ deep copy
|
||||
constructor], [/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick
|
||||
constructor] or [/ default constructor].&]
|
||||
[s8; [*@4 HashFn]-|Hashing class. Must have defined unsigned operator()(const
|
||||
K`& x) method returning hash value for elements.&]
|
||||
[s0; &]
|
||||
[s9; Vector flavor of map. Inherits most of its functionality from
|
||||
[^topic`:`/`/Core`/src`/AMap`$en`-us^ AMap] and adds only members
|
||||
specific for its flavor.&]
|
||||
[s9; Like any other NTL container, VectorMap is [*/^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 VectorMap is logic error with exception of:&]
|
||||
[s9;C+75 &]
|
||||
[s0; [*C+75 void operator`=(pick`_ VectorMap`& ][*C@3+75 v][*C+75 ) ][*/C+75 (defined
|
||||
by composition)]&]
|
||||
[s0; [*C+75 void operator<<`=(const AMap`& ][*C@3+75 v][*C+75 ) ][*/C+75 (defined
|
||||
in AMap)]&]
|
||||
[s0; [*C+75 void Clear()]&]
|
||||
[s0; [*C+75 bool IsPicked() const]&]
|
||||
[s0;C+75 &]
|
||||
[s9; Optional deep copy operator is inherited from AMap class. Pick
|
||||
operator is implicitly defined by composition.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Constructor Detail]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(`):%- [* VectorMap]()&]
|
||||
[s2; Default constructor. Constructs empty [* VectorMap].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:VectorMap`:`:VectorMap`(std`:`:initializer`_list`<std`:`:pair`<K`,T`>`>`):%- [* V
|
||||
ectorMap]([_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/initializer`_list^ s
|
||||
td`::initializer`_list]<[_^http`:`/`/en`.cppreference`.com`/w`/cpp`/utility`/pair^ s
|
||||
td`::pair]<[*@4 K], [*@4 T]>>_[*@3 init])&]
|
||||
[s2; C`+`+ 11 initialization.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:VectorMap`:`:operator`(`)`(const K`&`,const T`&`):%- [*_^Upp`:`:VectorMap^ V
|
||||
ectorMap][@(0.0.255) `&]_[* operator()]([@(0.0.255) const]_[*@4 K][@(0.0.255) `&]_[*@3 k],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 v])&]
|
||||
[s2; Same as Add([%-*@3 k], [%-*@3 v]), returns `*this. Syntax sugar
|
||||
for creating map.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(const VectorMap`&`,int`):%- [* VectorMap]([@(0.0.255) const]_
|
||||
[* VectorMap][@(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; [%-*@3 s][%- -|]Source [* VectorMap].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(pick`_ Index`<K`,HashFn`>`&`,pick`_ Vector`<T`>`&`):%- [* V
|
||||
ectorMap]([@(0.128.128) pick`_]_[_^Index^ Index][@(0.0.255) <][*@4 K],
|
||||
[*@4 HashFn][@(0.0.255) >`&]_[*@3 ndx], [@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <
|
||||
][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs [* VectorMap] from [* Index] of keys and [* Vector]
|
||||
of values. Both source containers should have the same number
|
||||
of elements.&]
|
||||
[s7; [%-*@3 ndx][%- -|]Source Index.&]
|
||||
[s7; [%-*@3 val][%- -|]Source Vector.&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:VectorMap`:`:VectorMap`(pick`_ Vector`<K`>`&`,pick`_ Vector`<T`>`&`):%- [* VectorM
|
||||
ap]([@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <][*@4 K][@(0.0.255) >`&]_[*@3 ndx],
|
||||
[@(0.128.128) pick`_]_[_^Vector^ Vector][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 val])&]
|
||||
[s2; Pick`-constructs [* VectorMap] from [* Vector] of keys and [* Vector]
|
||||
of values. Both source containers should have the same number
|
||||
of elements.&]
|
||||
[s7; [%-*@3 ndx][%- -|]Source Vector of keys.&]
|
||||
[s7; [%-*@3 val][%- -|]Source Vector of values.&]
|
||||
[s3; &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)t/25b/25@1 [s0;%- [* Public Member List]]}}&]
|
||||
[s3;%- &]
|
||||
[s5;:VectorMap`:`:Pop`(`):%- [*@4 T]_[* Pop]()&]
|
||||
[s2; Drops last element of VectorMap and returns its value.&]
|
||||
[s7; [*/ Return value]-|Value of dropped element.&]
|
||||
[s3; &]
|
||||
[s0; ]]
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,269 +1,269 @@
|
|||
topic "Template Algorithms";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 Template Algorithms]]}}&]
|
||||
[s3;%% &]
|
||||
[s5;:Swap`(T`&`,T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_&]
|
||||
[s5;:Swap`(T`&`,T`&`): [@(0.0.255) void]_[* Swap]([*@4 T][@(0.0.255) `&]_[*@3 a],
|
||||
[*@4 T][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2;%% Swaps values. Specific types might specialize [* Swap].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:IterSwap`(I`,I`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 I][@(0.0.255) >]_&]
|
||||
[s5;:IterSwap`(I`,I`): [@(0.0.255) void]_[* IterSwap]([*@4 I]_[*@3 a], [*@4 I]_[*@3 b])&]
|
||||
[s2;%% Swaps values pointed to by iterators. Specific types might
|
||||
specialize [* IterSwap].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:sgn`(T`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:sgn`(T`): [@(0.0.255) int]_[* sgn]([*@4 T]_[*@3 a])&]
|
||||
[s2;%% Returns 1 if [%-*@3 a]. is greater than zero, `-1 if [%-*@3 a]
|
||||
is smaller than zero and zero if [%-*@3 a] is zero.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:tabs`(T`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:tabs`(T`): [*@4 T]_[* tabs]([*@4 T]_[*@3 a])&]
|
||||
[s2;%% Returns the absolute value of [%-*@3 a].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:cmp`(const T`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:cmp`(const T`&`,const T`&`): [@(0.0.255) int]_[* cmp]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 a], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2; [%% Returns 1 if ][*@3 a][%% is greater than ][*@3 b][%% , `-1 if ][*@3 a][%%
|
||||
is smaller than ][*@3 b][%% and zero if ][*@3 a][%% is equal than ][*@3 b.]&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`): [@(0.0.255) void]_[* Reverse]([*@4 Range][@(0.0.255) `&]_[*@3 r
|
||||
])&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`&`): [@(0.0.255) void]_[* Reverse]([*@4 Range][@(0.0.255) `&`&]_
|
||||
[*@3 r])&]
|
||||
[s2;%% Reverses the order of values in a range.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Sum`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Sum`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [_^Upp`:`:ValueTypeOf^ V
|
||||
alueTypeOf]<[*@4 Range]>_[* Sum]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[*@3 zero])&]
|
||||
[s2; [%% Returns the sum of all elements in range ][*@3 r][%% , with ][*@3 zero][%%
|
||||
representing initial zero value. ][*@4 T]_must have defined operator`+`=.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Sum`(const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Sum`(const T`&`): [@(0.0.255) typename]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>_[* Sum]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2;%% Same as Sum(c, 0).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Count`(const Range`&`,const V`&`): [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 Range], [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:Count`(const Range`&`,const V`&`): [@(0.0.255) int]_[* Count]([@(0.0.255) const
|
||||
]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 V][@(0.0.255) `&]_[*@3 val])&]
|
||||
[s2;%% Counts the number of elements in the Range [%-*@3 r] that are
|
||||
equal to [%-*@3 val] .&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:CountIf`(const Range`&`,const Predicate`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Predicate]>_&]
|
||||
[s5;:Upp`:`:CountIf`(const Range`&`,const Predicate`&`): [@(0.0.255) int]_[* CountIf]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 Predicate][@(0.0.255) `&]_[*@3 p
|
||||
])&]
|
||||
[s2;%% Counts the number of elements in the Range [%-*@3 r] that satisfy
|
||||
condition [%-*@3 p].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindBest`(const Range`&`,const Pred`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Pred]>_&]
|
||||
[s5;:Upp`:`:FindBest`(const Range`&`,const Pred`&`): [@(0.0.255) int]_[* FindBest]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 Pred][@(0.0.255) `&]_[*@3 pre
|
||||
d])&]
|
||||
[s2;%% Finds the most suitable element in a range [%-*@3 r] as specified
|
||||
by [%-*@3 pred]. E.g. if [%-*@3 pred] is std`::less, finds minimum.
|
||||
If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMin`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>
|
||||
_&]
|
||||
[s5;:Upp`:`:FindMin`(const Range`&`): [@(0.0.255) int]_[* FindMin]([@(0.0.255) const]_[*@4 Ra
|
||||
nge][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the index of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Min`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Min`(const Range`&`): [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<
|
||||
[*@4 Range]>`&_[* Min]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the [/ value] of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, behavior is undefined
|
||||
(ASSERT fails in debug).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Min`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Min`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) cons
|
||||
t]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[* Min]([@(0.0.255) const]_[*@4 Range
|
||||
][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>`&_[*@3 def])&]
|
||||
[s2;%% Returns the [/ value] of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns [%-*@3 def].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMax`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>
|
||||
_&]
|
||||
[s5;:Upp`:`:FindMax`(const Range`&`): [@(0.0.255) int]_[* FindMax]([@(0.0.255) const]_[*@4 Ra
|
||||
nge][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the index of maximal element of [%-*@3 r], using std`::greater
|
||||
to compare elements. If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Max`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Max`(const Range`&`): [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<
|
||||
[*@4 Range]>`&_[* Max]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the [/ value] of maximal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, behavior is undefined
|
||||
(ASSERT fails in debug)..&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Max`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Max`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) cons
|
||||
t]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[* Max]([@(0.0.255) const]_[*@4 Range
|
||||
][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>`&_[*@3 def])&]
|
||||
[s2;%% Returns the [/ value] of maximal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns [%-*@3 def].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:IsEqualRange`(const Range1`&`,const Range2`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range1], [@(0.0.255) class]_[*@4 Range2]>_&]
|
||||
[s5;:Upp`:`:IsEqualRange`(const Range1`&`,const Range2`&`): [@(0.0.255) bool]_[* IsEqualR
|
||||
ange]([@(0.0.255) const]_[*@4 Range1][@(0.0.255) `&]_[*@3 a], [@(0.0.255) const]_[*@4 Range2][@(0.0.255) `&
|
||||
]_[*@3 b])&]
|
||||
[s2;%% Returns true if [%-*@3 a] and [%-*@3 b] are equal. operator`=`=
|
||||
is used to compare elements. Ranges are considered equal if they
|
||||
have the same number of elements and for every element at index
|
||||
[/ i: ][%-*@3 a]`[i`] `=`= [%-*@3 b]`[i`].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:CompareRanges`(const Range1`&`,const Range2`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range1], [@(0.0.255) class]_[*@4 Range2]>_&]
|
||||
[s5;:Upp`:`:CompareRanges`(const Range1`&`,const Range2`&`): [@(0.0.255) int]_[* CompareR
|
||||
anges]([@(0.0.255) const]_[*@4 Range1][@(0.0.255) `&]_[*@3 a], [@(0.0.255) const]_[*@4 Range2
|
||||
][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2;%% Lexicographically compares ranges [%-*@3 a] [%-*@3 b], using SgnCompare
|
||||
to compare elements. SgnCompare is supposed to return value <
|
||||
0 if first element is less than second, 0 if they are equal,
|
||||
>0 otherwise. Returns value <0, 0, >0 if [%-*@3 a] < [%-*@3 b],[%-*@3
|
||||
a] `=`= [%-*@3 b],[%-*@3 a] > [%-*@3 b].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMatch`(const Range`&`,const C`&`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 V], [@(0.0.255) class]_[*@4 C]>_&]
|
||||
[s5;:Upp`:`:FindMatch`(const Range`&`,const C`&`,int`): [@(0.0.255) int]_[* FindMatch]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 C][@(0.0.255) `&]_[*@3 match],
|
||||
[@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the index of first element for which predicate [%-*@3 match]
|
||||
is true. If not found, returns `-1. Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindIndex`(const Range`&`,const V`&`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:FindIndex`(const Range`&`,const V`&`,int`): [@(0.0.255) int]_[* FindIndex]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 V][@(0.0.255) `&]_[*@3 value],
|
||||
[@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the index of first element which is equal to [%-*@3 value].
|
||||
If not found, returns `-1. Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindAll`(const Range`&`,Predicate`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Predicate]>_&]
|
||||
[s5;:Upp`:`:FindAll`(const Range`&`,Predicate`,int`): [_^Upp`:`:Vector^ Vector]<[@(0.0.255) i
|
||||
nt]>_[* FindAll]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[*@4 Predicate]_[*@3 match], [@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the Vector of indices of [/ ALL] elements for which
|
||||
[%-*@3 match] is true. Returned Vector is sorted in ascending order.
|
||||
Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`,const Less`&`): [@(0.0.255) templ
|
||||
ate]_<[@(0.0.255) class]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 Les
|
||||
s]>_&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`,const Less`&`): [@(0.0.255) int]_
|
||||
[* FindLowerBound]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val], [@(0.0.255) const]_[*@4 Less][@(0.0.255) `&
|
||||
]_[*@3 less])&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindLowerBoun
|
||||
d]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val])&]
|
||||
[s2;%% Finds the first index in sorted range [%-*@3 r], which must
|
||||
be sorted by [%-*@3 less ]predicate (or std`::less in second overload),
|
||||
where [%-*@3 val] can be inserted without breaking the ordering.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) template
|
||||
]_<[@(0.0.255) class]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 L]>_&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) int]_[* Fi
|
||||
ndUpperBound]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val], [@(0.0.255) const]_[*@4 L][@(0.0.255) `&]_
|
||||
[*@3 less])&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindUpperBoun
|
||||
d]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val])&]
|
||||
[s2;%% Finds the last index in sorted range [%-*@3 r], which must be
|
||||
sorted by [%-*@3 less ]predicate (or std`::less in second overload),
|
||||
where [%-*@3 val] can be inserted without breaking the ordering.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 L]>_&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) int]_[* FindBi
|
||||
nary]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val], [@(0.0.255) const]_[*@4 L][@(0.0.255) `&]_[*@3 less])&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) cl
|
||||
ass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindBinary]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val])&]
|
||||
[s2;%% Finds the index of [%-*@3 val] in sorted range [%-*@3 r], which
|
||||
must be sorted by [%-*@3 less ]predicate (or std`::less in second
|
||||
overload). If [%-*@3 val] is not present in [%-*@3 r], return `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:LruAdd`(Container`&`,T`,int`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 C
|
||||
ontainer], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:LruAdd`(Container`&`,T`,int`): [@(0.0.255) void]_[* LruAdd]([*@4 Container][@(0.0.255) `&
|
||||
]_[*@3 lru], [*@4 T]_[*@3 value], [@(0.0.255) int]_[*@3 limit]_`=_[@3 10])&]
|
||||
[s2;%% This specialized algorithm is intended to manage Least`-Recently`-Used
|
||||
lists. [%-*@3 lru] has to be U`+`+ array type (Vector, Array, InVector,
|
||||
InArray) and represents the list. [%-*@3 value] is the value to
|
||||
be eventually added to the list, [%-*@3 limit] is the maximum number
|
||||
of elements in the list. On call, if [%-*@3 value] is present in
|
||||
the [%-*@3 lru], it is moved to the front. If it is not present,
|
||||
it is inserted to the front and the size of list is eventually
|
||||
reduced to [%-*@3 limit], possibly removing the element at the
|
||||
end of list.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:MakeIota`(V`,V`,V`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 C]_`=_Vecto
|
||||
r<[@(0.0.255) int]>, [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:MakeIota`(V`,V`,V`): [*@4 C]_[* MakeIota]([*@4 V]_[*@3 end],
|
||||
[*@4 V]_[*@3 start]_`=_[@3 0], [*@4 V]_[*@3 step]_`=_[@3 1])&]
|
||||
[s2;%% Returns a cointainer of type [%-*@4 C] filled with sequence
|
||||
of numbers starting at [%-*@3 start] and less than [%-*@3 end] increasing
|
||||
by [%-*@3 step] increments.&]
|
||||
[s3;%% &]
|
||||
topic "Template Algorithms";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
|
||||
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
|
||||
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
|
||||
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
|
||||
[b42;2 $$9,9#13035079074754324216151401829390:normal]
|
||||
[{_}
|
||||
[ {{10000@(113.42.0) [s0;%% [*@7;4 Template Algorithms]]}}&]
|
||||
[s3;%% &]
|
||||
[s5;:Swap`(T`&`,T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_&]
|
||||
[s5;:Swap`(T`&`,T`&`): [@(0.0.255) void]_[* Swap]([*@4 T][@(0.0.255) `&]_[*@3 a],
|
||||
[*@4 T][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2;%% Swaps values. Specific types might specialize [* Swap].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:IterSwap`(I`,I`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 I][@(0.0.255) >]_&]
|
||||
[s5;:IterSwap`(I`,I`): [@(0.0.255) void]_[* IterSwap]([*@4 I]_[*@3 a], [*@4 I]_[*@3 b])&]
|
||||
[s2;%% Swaps values pointed to by iterators. Specific types might
|
||||
specialize [* IterSwap].&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:sgn`(T`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:sgn`(T`): [@(0.0.255) int]_[* sgn]([*@4 T]_[*@3 a])&]
|
||||
[s2;%% Returns 1 if [%-*@3 a]. is greater than zero, `-1 if [%-*@3 a]
|
||||
is smaller than zero and zero if [%-*@3 a] is zero.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:tabs`(T`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:tabs`(T`): [*@4 T]_[* tabs]([*@4 T]_[*@3 a])&]
|
||||
[s2;%% Returns the absolute value of [%-*@3 a].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:cmp`(const T`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:cmp`(const T`&`,const T`&`): [@(0.0.255) int]_[* cmp]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 a], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2; [%% Returns 1 if ][*@3 a][%% is greater than ][*@3 b][%% , `-1 if ][*@3 a][%%
|
||||
is smaller than ][*@3 b][%% and zero if ][*@3 a][%% is equal than ][*@3 b.]&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`): [@(0.0.255) void]_[* Reverse]([*@4 Range][@(0.0.255) `&]_[*@3 r
|
||||
])&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Reverse`(Range`&`&`): [@(0.0.255) void]_[* Reverse]([*@4 Range][@(0.0.255) `&`&]_
|
||||
[*@3 r])&]
|
||||
[s2;%% Reverses the order of values in a range.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Sum`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Sum`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [_^Upp`:`:ValueTypeOf^ V
|
||||
alueTypeOf]<[*@4 Range]>_[* Sum]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[*@3 zero])&]
|
||||
[s2; [%% Returns the sum of all elements in range ][*@3 r][%% , with ][*@3 zero][%%
|
||||
representing initial zero value. ][*@4 T]_must have defined operator`+`=.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Sum`(const T`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Sum`(const T`&`): [@(0.0.255) typename]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>_[* Sum]([@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 c])&]
|
||||
[s2;%% Same as Sum(c, 0).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Count`(const Range`&`,const V`&`): [@(0.0.255) template]_<[@(0.0.255) class]_
|
||||
[*@4 Range], [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:Count`(const Range`&`,const V`&`): [@(0.0.255) int]_[* Count]([@(0.0.255) const
|
||||
]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 V][@(0.0.255) `&]_[*@3 val])&]
|
||||
[s2;%% Counts the number of elements in the Range [%-*@3 r] that are
|
||||
equal to [%-*@3 val] .&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:CountIf`(const Range`&`,const Predicate`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Predicate]>_&]
|
||||
[s5;:Upp`:`:CountIf`(const Range`&`,const Predicate`&`): [@(0.0.255) int]_[* CountIf]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 Predicate][@(0.0.255) `&]_[*@3 p
|
||||
])&]
|
||||
[s2;%% Counts the number of elements in the Range [%-*@3 r] that satisfy
|
||||
condition [%-*@3 p].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindBest`(const Range`&`,const Pred`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Pred]>_&]
|
||||
[s5;:Upp`:`:FindBest`(const Range`&`,const Pred`&`): [@(0.0.255) int]_[* FindBest]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 Pred][@(0.0.255) `&]_[*@3 pre
|
||||
d])&]
|
||||
[s2;%% Finds the most suitable element in a range [%-*@3 r] as specified
|
||||
by [%-*@3 pred]. E.g. if [%-*@3 pred] is std`::less, finds minimum.
|
||||
If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMin`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>
|
||||
_&]
|
||||
[s5;:Upp`:`:FindMin`(const Range`&`): [@(0.0.255) int]_[* FindMin]([@(0.0.255) const]_[*@4 Ra
|
||||
nge][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the index of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Min`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Min`(const Range`&`): [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<
|
||||
[*@4 Range]>`&_[* Min]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the [/ value] of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, behavior is undefined
|
||||
(ASSERT fails in debug).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Min`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Min`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) cons
|
||||
t]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[* Min]([@(0.0.255) const]_[*@4 Range
|
||||
][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>`&_[*@3 def])&]
|
||||
[s2;%% Returns the [/ value] of minimal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns [%-*@3 def].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMax`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>
|
||||
_&]
|
||||
[s5;:Upp`:`:FindMax`(const Range`&`): [@(0.0.255) int]_[* FindMax]([@(0.0.255) const]_[*@4 Ra
|
||||
nge][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the index of maximal element of [%-*@3 r], using std`::greater
|
||||
to compare elements. If [%-*@3 r] is empty, returns `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Max`(const Range`&`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Max`(const Range`&`): [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<
|
||||
[*@4 Range]>`&_[* Max]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r])&]
|
||||
[s2;%% Returns the [/ value] of maximal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, behavior is undefined
|
||||
(ASSERT fails in debug)..&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:Max`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) temp
|
||||
late]_<[@(0.0.255) class]_[*@4 Range]>_&]
|
||||
[s5;:Upp`:`:Max`(const Range`&`,const Upp`:`:ValueTypeOf`<Range`>`&`): [@(0.0.255) cons
|
||||
t]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range]>`&_[* Max]([@(0.0.255) const]_[*@4 Range
|
||||
][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[_^Upp`:`:ValueTypeOf^ ValueTypeOf]<[*@4 Range
|
||||
]>`&_[*@3 def])&]
|
||||
[s2;%% Returns the [/ value] of maximal element of [%-*@3 r], using std`::less
|
||||
to compare elements. If [%-*@3 r] is empty, returns [%-*@3 def].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:IsEqualRange`(const Range1`&`,const Range2`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range1], [@(0.0.255) class]_[*@4 Range2]>_&]
|
||||
[s5;:Upp`:`:IsEqualRange`(const Range1`&`,const Range2`&`): [@(0.0.255) bool]_[* IsEqualR
|
||||
ange]([@(0.0.255) const]_[*@4 Range1][@(0.0.255) `&]_[*@3 a], [@(0.0.255) const]_[*@4 Range2][@(0.0.255) `&
|
||||
]_[*@3 b])&]
|
||||
[s2;%% Returns true if [%-*@3 a] and [%-*@3 b] are equal. operator`=`=
|
||||
is used to compare elements. Ranges are considered equal if they
|
||||
have the same number of elements and for every element at index
|
||||
[/ i: ][%-*@3 a]`[i`] `=`= [%-*@3 b]`[i`].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:CompareRanges`(const Range1`&`,const Range2`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range1], [@(0.0.255) class]_[*@4 Range2]>_&]
|
||||
[s5;:Upp`:`:CompareRanges`(const Range1`&`,const Range2`&`): [@(0.0.255) int]_[* CompareR
|
||||
anges]([@(0.0.255) const]_[*@4 Range1][@(0.0.255) `&]_[*@3 a], [@(0.0.255) const]_[*@4 Range2
|
||||
][@(0.0.255) `&]_[*@3 b])&]
|
||||
[s2;%% Lexicographically compares ranges [%-*@3 a] [%-*@3 b], using SgnCompare
|
||||
to compare elements. SgnCompare is supposed to return value <
|
||||
0 if first element is less than second, 0 if they are equal,
|
||||
>0 otherwise. Returns value <0, 0, >0 if [%-*@3 a] < [%-*@3 b],[%-*@3
|
||||
a] `=`= [%-*@3 b],[%-*@3 a] > [%-*@3 b].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindMatch`(const Range`&`,const C`&`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 V], [@(0.0.255) class]_[*@4 C]>_&]
|
||||
[s5;:Upp`:`:FindMatch`(const Range`&`,const C`&`,int`): [@(0.0.255) int]_[* FindMatch]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 C][@(0.0.255) `&]_[*@3 match],
|
||||
[@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the index of first element for which predicate [%-*@3 match]
|
||||
is true. If not found, returns `-1. Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindIndex`(const Range`&`,const V`&`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:FindIndex`(const Range`&`,const V`&`,int`): [@(0.0.255) int]_[* FindIndex]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 V][@(0.0.255) `&]_[*@3 value],
|
||||
[@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the index of first element which is equal to [%-*@3 value].
|
||||
If not found, returns `-1. Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindAll`(const Range`&`,Predicate`,int`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 Predicate]>_&]
|
||||
[s5;:Upp`:`:FindAll`(const Range`&`,Predicate`,int`): [_^Upp`:`:Vector^ Vector]<[@(0.0.255) i
|
||||
nt]>_[* FindAll]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[*@4 Predicate]_[*@3 match], [@(0.0.255) int]_[*@3 from]_`=_[@3 0])&]
|
||||
[s2;%% Returns the Vector of indices of [/ ALL] elements for which
|
||||
[%-*@3 match] is true. Returned Vector is sorted in ascending order.
|
||||
Search starts at index [%-*@3 from].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`,const Less`&`): [@(0.0.255) templ
|
||||
ate]_<[@(0.0.255) class]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 Les
|
||||
s]>_&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`,const Less`&`): [@(0.0.255) int]_
|
||||
[* FindLowerBound]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val], [@(0.0.255) const]_[*@4 Less][@(0.0.255) `&
|
||||
]_[*@3 less])&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindLowerBound`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindLowerBoun
|
||||
d]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val])&]
|
||||
[s2;%% Finds the first index in sorted range [%-*@3 r], which must
|
||||
be sorted by [%-*@3 less ]predicate (or std`::less in second overload),
|
||||
where [%-*@3 val] can be inserted without breaking the ordering.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) template
|
||||
]_<[@(0.0.255) class]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 L]>_&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) int]_[* Fi
|
||||
ndUpperBound]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r],
|
||||
[@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val], [@(0.0.255) const]_[*@4 L][@(0.0.255) `&]_
|
||||
[*@3 less])&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindUpperBound`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindUpperBoun
|
||||
d]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val])&]
|
||||
[s2;%% Finds the last index in sorted range [%-*@3 r], which must be
|
||||
sorted by [%-*@3 less ]predicate (or std`::less in second overload),
|
||||
where [%-*@3 val] can be inserted without breaking the ordering.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) template]_<[@(0.0.255) c
|
||||
lass]_[*@4 Range], [@(0.0.255) class]_[*@4 T], [@(0.0.255) class]_[*@4 L]>_&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`,const L`&`): [@(0.0.255) int]_[* FindBi
|
||||
nary]([@(0.0.255) const]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&
|
||||
]_[*@3 val], [@(0.0.255) const]_[*@4 L][@(0.0.255) `&]_[*@3 less])&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`): [@(0.0.255) template]_<[@(0.0.255) cl
|
||||
ass]_[*@4 Range], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:FindBinary`(const Range`&`,const T`&`): [@(0.0.255) int]_[* FindBinary]([@(0.0.255) c
|
||||
onst]_[*@4 Range][@(0.0.255) `&]_[*@3 r], [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[*@3 val])&]
|
||||
[s2;%% Finds the index of [%-*@3 val] in sorted range [%-*@3 r], which
|
||||
must be sorted by [%-*@3 less ]predicate (or std`::less in second
|
||||
overload). If [%-*@3 val] is not present in [%-*@3 r], return `-1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:LruAdd`(Container`&`,T`,int`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 C
|
||||
ontainer], [@(0.0.255) class]_[*@4 T]>_&]
|
||||
[s5;:Upp`:`:LruAdd`(Container`&`,T`,int`): [@(0.0.255) void]_[* LruAdd]([*@4 Container][@(0.0.255) `&
|
||||
]_[*@3 lru], [*@4 T]_[*@3 value], [@(0.0.255) int]_[*@3 limit]_`=_[@3 10])&]
|
||||
[s2;%% This specialized algorithm is intended to manage Least`-Recently`-Used
|
||||
lists. [%-*@3 lru] has to be U`+`+ array type (Vector, Array, InVector,
|
||||
InArray) and represents the list. [%-*@3 value] is the value to
|
||||
be eventually added to the list, [%-*@3 limit] is the maximum number
|
||||
of elements in the list. On call, if [%-*@3 value] is present in
|
||||
the [%-*@3 lru], it is moved to the front. If it is not present,
|
||||
it is inserted to the front and the size of list is eventually
|
||||
reduced to [%-*@3 limit], possibly removing the element at the
|
||||
end of list.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:Upp`:`:MakeIota`(V`,V`,V`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 C]_`=_Vecto
|
||||
r<[@(0.0.255) int]>, [@(0.0.255) class]_[*@4 V]>_&]
|
||||
[s5;:Upp`:`:MakeIota`(V`,V`,V`): [*@4 C]_[* MakeIota]([*@4 V]_[*@3 end],
|
||||
[*@4 V]_[*@3 start]_`=_[@3 0], [*@4 V]_[*@3 step]_`=_[@3 1])&]
|
||||
[s2;%% Returns a cointainer of type [%-*@4 C] filled with sequence
|
||||
of numbers starting at [%-*@3 start] and less than [%-*@3 end] increasing
|
||||
by [%-*@3 step] increments.&]
|
||||
[s3;%% &]
|
||||
[s0;%% ]]
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue