From 3bb377084606fae973afc101de412f985bb67266 Mon Sep 17 00:00:00 2001 From: cbpporter Date: Wed, 19 Nov 2008 14:24:10 +0000 Subject: [PATCH] Any, One and SerializationUtils documentation update. git-svn-id: svn://ultimatepp.org/upp/trunk@654 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/src.tpp/Any$en-us.tpp | 125 ++++----- uppsrc/Core/src.tpp/One$en-us.tpp | 250 +++++++++--------- .../Core/src.tpp/SerializationUtils$en-us.tpp | 172 ++++++------ 3 files changed, 285 insertions(+), 262 deletions(-) diff --git a/uppsrc/Core/src.tpp/Any$en-us.tpp b/uppsrc/Core/src.tpp/Any$en-us.tpp index ee9500c73..b8131f71d 100644 --- a/uppsrc/Core/src.tpp/Any$en-us.tpp +++ b/uppsrc/Core/src.tpp/Any$en-us.tpp @@ -9,75 +9,80 @@ topic "Any"; [l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param] [i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam] [b42;2 $$9,9#13035079074754324216151401829390:normal] -[{_} -[s1;:Any`:`:class: [@(0.0.255) class]_[* Any]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) < +[{_}%EN-US +[s1;:Any`:`:class:%- [*@3;4 Any]&] +[s1;:Any`:`:class:%- [@(0.0.255) class]_[* Any]_:_[@(0.0.255) private]_[*@3 Moveable][@(0.0.255) < ][* Any][@(0.0.255) >]&] -[s0;%% Any is a special type of container capable of containing none +[s0; 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.&] -[s0;%% &] -[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&] +[s0; Any has pick semantics.&] [s3; &] -[s5;:Any`:`:Any`(pick`_ Any`&`): [* Any]([@(0.128.128) pick`_]_[* Any][@(0.0.255) `&]_[*@3 s])&] -[s2;%% Pick constructor. Transfers content of source Any while destroying -its content by picking.&] -[s7;%% [%-*C@3 s]-|Source Any.&] +[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`(`): [* Any]()&] -[s2;%% Constructs an empty Any.&] +[s4;%- &] +[s5;:Any`:`:Any`(pick`_ Any`&`):%- [* Any]([@(0.128.128) pick`_]_[* Any][@(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;%% Destructor.&] +[s4;%- &] +[s5;:Any`:`:`~Any`(`):%- [@(0.0.255) `~][* Any]()&] +[s2; Default destructor.&] [s3; &] -[s4; &] -[s5;:Any`:`:Create`(`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[*@4 T][@(0.0.255) `& -]_[* Create]()&] -[s2;%% Creates content of type T inside Any.&] -[s7;%% [*C@4 T]-|Type of content.&] -[s7;%% [*/ Return value]-|Reference to the newly created content.&] -[s3; &] -[s4; &] -[s5;:Any`:`:Is`(`)const: [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[@(0.0.255) b +[s0; &] +[ {{10000F(128)G(128)@1 [s0; [* Public Method List]]}}&] +[s3;%- &] +[s5;:Any`:`:Create`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]_[*@4 T +][@(0.0.255) `&]_[* Create]()&] +[s2; Creates content of type T inside Any.&] +[s7; [*C@4 T]-|Type of content.&] +[s7; [*/ Return value]-|Reference to the newly created content.&] +[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) `& +[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 must be true, otherwise +[s2; Returns reference to content. Is 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 +[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 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;:Any`:`:IsPicked`(`)const: [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&] -[s7;%% [*/ Return value]-|true if Any is picked.&] -[s3; &] -[s4; &] -[s5;:Any`:`:operator`=`(pick`_ Any`&`): [@(0.0.255) void]_[* operator`=]([@(0.128.128) pick -`_]_Any[@(0.0.255) `&]_[*@3 s])&] -[s2;%% Pick operator. Transfers content while destroying source.&] -[s7;%% [%-*C@3 s]-|Source Any.&] -[s0; ] \ No newline at end of file +[s2; Returns constant reference to content. Is 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;:Any`:`:IsPicked`(`)const:%- [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&] +[s7; [*/ Return value]-|true if Any is picked.&] +[s3;%- &] +[s4;%- &] +[s5;:Any`:`:operator`=`(pick`_ Any`&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) pi +ck`_]_Any[@(0.0.255) `&]_[*@3 s])&] +[s2; Pick operator. Transfers content while destroying source.&] +[s7; [%-*C@3 s]-|Source Any.&] +[s3;%- &] +[s0;%- ] \ No newline at end of file diff --git a/uppsrc/Core/src.tpp/One$en-us.tpp b/uppsrc/Core/src.tpp/One$en-us.tpp index e14bc3d7f..4457ae55e 100644 --- a/uppsrc/Core/src.tpp/One$en-us.tpp +++ b/uppsrc/Core/src.tpp/One$en-us.tpp @@ -9,151 +9,145 @@ topic "One"; [l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param] [i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam] [b42;2 $$9,9#13035079074754324216151401829390:normal] -[{_} -[s0;:noref: [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 T][@(0.0.255) >]&] -[s1;:`:`:One`:`:class: [@(0.0.255) class]_[* One]_:_[@(0.0.255) private]_[*@3 MoveableAndDeepC -opyOption][@(0.0.255) <]_[* One][@(0.0.255) <][*@4 T][@(0.0.255) >]_>_&] -[s0;*C@4 &] -[s8;%% [%-*C@4 T]-|Type or base class of element stored in One.&] -[s0;%% &] -[s0;%% One is a container capable of containing none or single element +[{_}%EN-US +[s0;%- [*@3;4 One]&] +[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 MoveableAndDeepCop +yOption][@(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; &] +[s0; One is a container capable of containing none or single element of type specified as template argument or derived from it.&] -[s0;%% One is [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/ +[s0; One is [*/^topic`:`/`/Core`/srcdoc`/Moveable`$en`-us^ moveable][*/ ]type with [*/^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick and optional deep copy] transfer semantics. Calling methods of picked -One is logic error with exception of&] -[s0;%% [C+75 void ][*C+75 operator`=][C+75 (pick`_ One`& ][*C@3+75 v][C+75 )]&] -[s0;%% [C+75 void ][*C+75 operator<<`=][C+75 (const One`& ][*C@3+75 v][C+75 )][+75 -][/+75 (defined using DeepCopyOption template base class)]&] -[s3; &] -[s4; &] -[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;%% Members&] -[s3; &] -[s4; &] -[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. Content is specified by pointer +One is logic error with exception of:&] +[s0; &] +[s0; [C+75 void ][*C+75 operator`=][C+75 (pick`_ One`& ][*C@3+75 v][C+75 )]&] +[s0; [C+75 void ][*C+75 operator<<`=][C+75 (const One`& ][*C@3+75 v][C+75 ) +][/C+75 (defined using DeepCopyOption template base class)]&] +[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. Content is specified by pointer to object created using operator new. One takes over ownership of this this object. &] -[s7;%% [*C@3 newt]-|Object to be added.&] +[s7; [%-*@3 newt]-|Object to be added.&] [s3; &] -[s4; &] -[s5;:`:`:One`:`:One`(pick`_`:`:One``&`): [* One]([@(0.128.128) pick`_]_[* One][@(0.0.255) < -][*@4 T][@(0.0.255) >`&]_[*@3 p])&] -[s2;%% Pick constructor. Transfers source One in low constant time, -but destroys it by picking. &] -[s7;%% [*C@3 p]-|Source One.&] +[s4;%- &] +[s5;:One`:`:One`(pick`_ One``&`):%- [* One]([@(0.128.128) pick`_]_[* One][@(0.0.255) <][*@4 T +][@(0.0.255) >`&]_[*@3 p])&] +[s2; Pick constructor. Transfers source [* One] [%-*@3 p ]in low constant +time, but destroys it by picking.&] [s3; &] -[s4; &] -[s5;:`:`:One`:`:One`(const`:`:One``&`,int`): [* One]([@(0.0.255) const]_[* One][@(0.0.255) < -][*@4 T][@(0.0.255) >`&]_[*@3 p], [@(0.0.255) int])&] -[s2;%% Optional deep copy constructor.&] -[s6;%% Requires T to have deep copy constructor or optional deep -copy constructor.&] -[s7;%% [*C@3 p]-|Source One.&] +[s4;%- &] +[s5;:One`:`:One`(const One``&`,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;%% Destructor.&] +[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 +[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).&] -[s7;%% [%-*C@3 data]-|Pointer to the new element created using operator +[s7; [%-*C@3 data]-|Pointer to the new element created using operator new.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:Detach`(`)pick`_: [*@4 T]_`*[* Detach]()_[@(0.128.128) pick`_]&] -[s2;%% Removes content giving up ownership. Client is responsible -for deletion of content.&] -[s7;%% [*/ Return value]-|Pointer to the content allocated on the heap.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`-`(`)pick`_: [*@4 T]_`*[* operator`-]()_[@(0.128.128) pick`_]&] -[s2;%% Same as Detach() (operator version).&] -[s7;%% [*/ Return value]-|Pointer to the content allocated on the heap.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:Clear`(`): [@(0.0.255) void]_[* Clear]()&] -[s2;%% Removes and destroys content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`=`(T`*`): [@(0.0.255) void]_[* operator`=]([*@4 T]_`*[*@3 data])&] -[s2;%% Same as Attach(data) (operator version).&] -[s7;%% [%-*C@3 data]-|Pointer to the new element created using operator +[s3;%- &] +[s4;%- &] +[s5;:One`:`:Detach`(`)pick`_:%- [*@4 T]_`*[* Detach]()_[@(0.128.128) pick`_]&] +[s2; Removes content giving up ownership. Client is responsible for +deletion of content.&] +[s7; [*/ Return value]-|Pointer to the content allocated on the heap.&] +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`-`(`)pick`_:%- [*@4 T]_`*[* operator`-]()_[@(0.128.128) pick`_]&] +[s2; Same as Detach() (operator version).&] +[s7; [*/ Return value]-|Pointer to the content allocated on the heap.&] +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`=`(T`*`):%- [@(0.0.255) void]_[* operator`=]([*@4 T]_`*[*@3 data])&] +[s2; Same as Attach(data) (operator version).&] +[s7; [%-*C@3 data]-|Pointer to the new element created using operator new.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`=`(pick`_`:`:One``&`): [@(0.0.255) void]_[* operator`=]([@(0.128.128) p -ick`_]_[_^`:`:One^ One][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 d])&] -[s2;%% Pick operator. Transfers source One in low constant time, -but destroys it by picking.&] -[s7;%% [%-*C@3 d]-|Source One.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`-`>`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`->]()_[@(0.0.255) c +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`=`(pick`_ One``&`):%- [@(0.0.255) void]_[* operator`=]([@(0.128.128) p +ick`_]_[_^One^ One][@(0.0.255) <][*@4 T][@(0.0.255) >`&]_[*@3 d])&] +[s2; Pick operator. Transfers source One in low constant time, but +destroys it by picking.&] +[s7; [%-*C@3 d]-|Source One.&] +[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.&] -[s7;%% [*/ Return value]-|Returns constant pointer to content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`-`>`(`): [*@4 T]_`*[* operator`->]()&] -[s2;%% Content access operator. Illegal if there is no content.&] -[s7;%% [*/ Return value]-|Returns pointer to content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`~`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) c +[s2; Constant content access operator. Illegal if there is no content.&] +[s7; [*/ Return value]-|Returns constant pointer to content.&] +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`-`>`(`):%- [*@4 T]_`*[* operator`->]()&] +[s2; Content access operator. Illegal if there is no content.&] +[s7; [*/ Return value]-|Returns pointer to content.&] +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`~`(`)const:%- [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) c onst]&] -[s2;%% Constant content pointer access.&] -[s7;%% [*/ Return value]-|Returns constant pointer to content or NULL +[s2; Constant content pointer access.&] +[s7; [*/ Return value]-|Returns constant pointer to content or NULL when there is no content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator`~`(`): [*@4 T]_`*[* operator`~]()&] -[s2;%% Content pointer access.&] -[s7;%% [*/ Return value]-|Returns pointer to content or NULL when there +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`~`(`):%- [*@4 T]_`*[* operator`~]()&] +[s2; Content pointer access.&] +[s7; [*/ Return value]-|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) const]&] -[s2;%% Content constant reference access. Illegal if there is no -content.&] -[s7;%% [*/ Return value]-|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.&] -[s7;%% [*/ Return value]-|Reference to content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:Create`(`): [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT][@(0.0.255) >]_ -[*@4 TT][@(0.0.255) `&]_[* Create]()&] -[s2;%% Creates content in One. (Note: if there is content in One while +[s3;%- &] +[s4;%- &] +[s5;:One`:`:operator`*`(`)const:%- [@(0.0.255) const]_[*@4 T][@(0.0.255) `&]_[* operator`*]() +_[@(0.0.255) const]&] +[s2; Content constant reference access. Illegal if there is no content.&] +[s7; [*/ Return value]-|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.&] +[s7; [*/ Return value]-|Reference to content.&] +[s3;%- &] +[s4;%- &] +[s5;:One`:`:Create`(`):%- [@(0.0.255) template]_<[@(0.0.255) class]_[*@4 TT][@(0.0.255) >]_[*@4 T +T][@(0.0.255) `&]_[* Create]()&] +[s2; Creates content in One. (Note: if there is content in One while calling this function, it is destroyed).&] -[s7;%% [*C@4 TT]-|Type of content. Must be equal to T or derived from +[s7; [*C@4 TT]-|Type of content. Must be equal to T or derived from it.&] -[s7;%% [*/ Return value]-|Reference to actual content (of type TT).&] +[s7; [*/ Return value]-|Reference to actual content (of type TT).&] +[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.&] [s3; &] -[s4; &] -[s5;:`:`:One`:`:IsPicked`(`)const: [@(0.0.255) bool]_[* IsPicked]()_[@(0.0.255) const]&] -[s7;%% [*/ Return value]-|true if One is picked.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:IsEmpty`(`)const: [@(0.0.255) bool]_[* IsEmpty]()_[@(0.0.255) const]&] -[s7;%% [*/ Return value]-|true if there is no content.&] -[s3; &] -[s4; &] -[s5;:`:`:One`:`:operator bool`(`)const: [@(0.0.255) operator]_[@(0.0.255) bool]()_[@(0.0.255) c -onst]&] -[s7;%% [*/ Return value]-|true if there is content.&] [s0; ] \ No newline at end of file diff --git a/uppsrc/Core/src.tpp/SerializationUtils$en-us.tpp b/uppsrc/Core/src.tpp/SerializationUtils$en-us.tpp index d5e3eec8e..7897395d6 100644 --- a/uppsrc/Core/src.tpp/SerializationUtils$en-us.tpp +++ b/uppsrc/Core/src.tpp/SerializationUtils$en-us.tpp @@ -10,34 +10,38 @@ topic "Serialization utilities"; [i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam] [b42;2 $$9,9#13035079074754324216151401829390:normal] [{_}%EN-US -[s0; Serialization utilities&] -[s0;3 &] -[s5;K%- [^`:`:Stream^ Stream]`&_Pack16[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) , - ][@(0.0.255) int][@(64) `&_][@3 i][@(64) )]&] +[s0; [*@3;4 Serialization utilities]&] +[s0;3%- &] +[ {{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.&] -[s0;3 &] -[s5;K%- [^`:`:Stream^ Stream]`&_Pack16[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) , - ][@(0.0.255) int][@(64) `&_][@3 i1][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i2][@(64) )]&] -[s5;K%- [^`:`:Stream^ Stream]`&_Pack16[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) , - ][@(0.0.255) int][@(64) `&_][@3 i1][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i2][@(64) , -][@(0.0.255) int][@(64) `&_][@3 i3][@(64) )]&] -[s5;K%- [^`:`:Stream^ Stream]`&_Pack16[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) , - ][@(0.0.255) int][@(64) `&_][@3 i1][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i2][@(64) , -][@(0.0.255) int][@(64) `&_][@3 i3][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i4][@(64) )]&] -[s5;K%- [^`:`:Stream^ Stream]`&_Pack16[@(64) (][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) , - ][@(0.0.255) int][@(64) `&_][@3 i1][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i2][@(64) , -][@(0.0.255) int][@(64) `&_][@3 i3][@(64) , ][@(0.0.255) int][@(64) `&_][@3 i4][@(64) , -][@(0.0.255) int][@(64) `&_][@3 i5][@(64) )]&] +[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.&] -[s0;3 &] -[s5;K%- [@(0.0.255) bool][@(64) _]Load[@(64) (][^`:`:Callback1^@(64) Callback1][@(64) <][^`:`:Stream^@(64) S -tream][@(64) `&>_][@3 serialize][@(64) , ][^`:`:Stream^@(64) Stream][@(64) `&_][@3 stream][@(64) ) -]&] +[s3; &] +[s4;%- &] +[s5;:Load`(Callback1``,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 @@ -48,35 +52,40 @@ returns false.&] [s7; [%-*C@3 serialize]-|Callback to the serialization function.&] [s7; [%-*C@3 stream]-|Stream.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- [@(0.0.255) bool][@(64) _]Store[@(64) (][^`:`:Callback1^@(64) Callback1][@(64) <][^`:`:Stream^@(64) S -tream][@(64) `&>_][@3 serialize][@(64) , ][^`:`:Stream^@(64) Stream][@(64) `&_][@3 stream][@(64) ) -]&] +[s3; &] +[s4;%- &] +[s5;:Store`(Callback1``,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.&] -[s0;3 &] -[s5;K%- [@(0.0.255) bool][@(64) _]LoadFromFile[@(64) (][^`:`:Callback1^@(64) Callback1][@(64) < -Stream`&>_][@3 serialize][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][@3 f -ile][@(64) _`=_NULL)]&] +[s3; &] +[s4;%- &] +[s5;:LoadFromFile`(Callback1``,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`&`)^ 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.&] -[s0;3 &] -[s5;K%- [@(0.0.255) bool][@(64) _]StoreToFile[@(64) (][^`:`:Callback1^@(64) Callback1][@(64) _][@3 serialize][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _`*][@3 fi -le][@(64) _`=_NULL)]&] +[s3; &] +[s4;%- &] +[s5;:StoreToFile`(Callback1``,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`&`)^ 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.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]Load[@(64) ( -][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) )]&] +[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`&`)^ L oad] with callback(`&[@3 x], `&T`::Serialize) as serialization callback. In other words, [@3 x] is restored using its Serialize method.&] @@ -84,9 +93,11 @@ In other words, [@3 x] is restored using its Serialize method.&] [s7; [%-*C@3 x]-|Reference to the object.&] [s7; [%-*C@3 s]-|Stream.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]Store[@(64) ( -][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][^`:`:Stream^@(64) Stream][@(64) `&_][@3 s][@(64) )]&] +[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 @@ -95,10 +106,11 @@ method.&] [s7; [%-*C@3 x]-|Reference to the object.&] [s7; [%-*C@3 s]-|Stream.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]LoadFromF -ile[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _ -`*][@3 name][@(64) _`=_NULL)]&] +[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``,const char`*`)^ L oadFromFile] with callback(`&[@3 x], `&T`::Serialize) as serialization callback. In other words, [@3 x] is restored from the file using @@ -107,10 +119,11 @@ its Serialize method.&] [s7; [%-*C@3 x]-|Reference to the object.&] [s7; [%-*C@3 name]-|Filename.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]StoreToFi -le[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _ -`*][@3 name][@(64) _`=_NULL)]&] +[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``,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 @@ -119,67 +132,78 @@ Serialize method.&] [s7; [%-*C@3 x]-|Reference to the object.&] [s7; [%-*C@3 name]-|Filename.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][^`:`:String^@(64) String][@(64) _]S -toreAsString[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) )]&] +[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].&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]LoadFromS -tring[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][@(0.0.255) const][@(64) _][^`:`:String^@(64) S -tring][@(64) `&_][@3 s][@(64) )]&] +[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; Global modular serialization support&] -[s0; Modular serialization is a viable option for storing configuration +[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 &] -[s5;K%- [@(0.0.255) void][@(64) _]RegisterGlobalConfig[@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) c -har][@(64) _`*][@3 name][@(64) )]&] +[ {{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])&] [s2; Registers name as global configuration key.&] [s7; [%-*C@3 name]-|Key.&] -[s0;3 &] -[s5;K%- [@(0.0.255) void][@(64) _]RegisterGlobalConfig[@(64) (][@(0.0.255) const][@(64) _][@(0.0.255) c -har][@(64) _`*][@3 name][@(64) , ][^`:`:Callback^@(64) Callback][@(64) _][@3 WhenFlush][@(64) ) -]&] +[s3; &] +[s4;%- &] +[s5;:RegisterGlobalConfig`(const char`*`,Callback`):%- [@(0.0.255) void]_[* RegisterGloba +lConfig]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 name], [_^Callback^ Callback]_[*@3 Whe +nFlush])&] [s2; Registers name as global configuration key, with flush callback.&] [s7; [%-*C@3 name]-|Key.&] [s7; [%-*C@3 WhenFlush]-|This callback 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.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) bool][@(64) _]LoadFromG -lobal[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _ -`*][@3 name][@(64) )]&] -[s2; Loads [@3 x] from global configuration key, using smart backup +[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, using smart backup methods provided by [^topic`:`/`/Core`/src`/SerializationUtils`$en`-us`#`:`:Load`(Callback1``,Stream`&`)^ L oad].&] [s7; [*C@4 T]-|Type of serialized object.&] [s7; [%-*C@3 x]-|Reference to serialized object.&] [s7; [%-*C@3 name]-|Configuration key.&] [s7; [*/ Return value]-|true indicates success.&] -[s0;3 &] -[s5;K%- template_<[@(0.0.255) class][@(64) _][@4 T][@(64) >__][@(0.0.255) void][@(64) _]StoreToGl -obal[@(64) (][^T^@(64) T][@(64) `&_][@3 x][@(64) , ][@(0.0.255) const][@(64) _][@(0.0.255) char][@(64) _ -`*][@3 name][@(64) )]&] +[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.&] [s7; [*C@4 T]-|Type of serialized object.&] [s7; [%-*C@3 x]-|Reference to serialized object.&] [s7; [%-*C@3 name]-|Configuration key.&] -[s0;3 &] -[s5;K%- [@(0.0.255) void][@(64) _]SerializeGlobalConfigs[@(64) (][^`:`:Stream^@(64) Stream][@(64) `& -_][@3 s][@(64) )]&] +[s3; &] +[s4;%- &] +[s5;:SerializeGlobalConfigs`(Stream`&`):%- [@(0.0.255) void]_[* SerializeGlobalConfigs]([_^Stream^ S +tream][@(0.0.255) `&]_[*@3 s])&] [s2; Serializes all global configuration data from/to single stream.&] [s7; [%-*C@3 s]-|Stream.&] +[s3; &] [s0; ] \ No newline at end of file