From b2028085fdfddfd5a7ac0f52d9f34b84457b3b98 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 4 Aug 2010 19:02:30 -0700 Subject: first pass at faster XUI parsing (no recursion support yet) also made LLSD->param block parsing faster --- indra/llui/llsdparam.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 12f28f876f..71b0a45630 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -79,9 +79,19 @@ private: LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack); - bool readSDParam(void* value_ptr); bool writeU32Param(const void* value_ptr, const parser_t::name_stack_t& name_stack); + static bool readS32(Parser& parser, void* val_ptr); + static bool readU32(Parser& parser, void* val_ptr); + static bool readF32(Parser& parser, void* val_ptr); + static bool readF64(Parser& parser, void* val_ptr); + static bool readBool(Parser& parser, void* val_ptr); + static bool readString(Parser& parser, void* val_ptr); + static bool readUUID(Parser& parser, void* val_ptr); + static bool readDate(Parser& parser, void* val_ptr); + static bool readURI(Parser& parser, void* val_ptr); + static bool readSD(Parser& parser, void* val_ptr); + Parser::name_stack_t mNameStack; const LLSD* mCurReadSD; LLSD* mWriteSD; -- cgit v1.2.3 From e948c4d9a95633f0b9eda9fbcb6e79ebacda8ef5 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 20 Aug 2010 14:36:46 -0700 Subject: removed unused template function --- indra/llui/llsdparam.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 71b0a45630..d8af3c9bce 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -56,15 +56,6 @@ public: private: void readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block); - template - bool readTypedValue(void* val_ptr, boost::function parser_func) - { - if (!mCurReadSD) return false; - - *((T*)val_ptr) = parser_func(*mCurReadSD); - return true; - } - template bool writeTypedValue(const void* val_ptr, const parser_t::name_stack_t& name_stack) { -- cgit v1.2.3 From 65c9914d23022df6a39db50ce295750f08695893 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 23 Aug 2010 11:03:19 -0700 Subject: made Params parsers not act as singletons --- indra/llui/llsdparam.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index d8af3c9bce..e98318fc1e 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -37,17 +37,14 @@ #include "llinitparam.h" class LLParamSDParser -: public LLInitParam::Parser, - public LLSingleton +: public LLInitParam::Parser { LOG_CLASS(LLParamSDParser); typedef LLInitParam::Parser parser_t; -protected: - LLParamSDParser(); - friend class LLSingleton; public: + LLParamSDParser(); void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false); void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block); -- cgit v1.2.3 From 0daa627db4f1bba2f69ec717426b26593674d14c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 24 Aug 2010 11:44:28 -0700 Subject: removed LLLayoutStack::fromXML custom xml parsing --- indra/llui/llsdparam.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index e98318fc1e..83c958d67d 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -54,11 +54,12 @@ private: void readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block); template - bool writeTypedValue(const void* val_ptr, const parser_t::name_stack_t& name_stack) + static bool writeTypedValue(Parser& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack) { - if (!mWriteSD) return false; + LLParamSDParser& sdparser = static_cast(parser); + if (!sdparser.mWriteSD) return false; - LLSD* sd_to_write = getSDWriteNode(name_stack); + LLSD* sd_to_write = sdparser.getSDWriteNode(name_stack); if (!sd_to_write) return false; sd_to_write->assign(*((const T*)val_ptr)); @@ -67,7 +68,7 @@ private: LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack); - bool writeU32Param(const void* value_ptr, const parser_t::name_stack_t& name_stack); + static bool writeU32Param(Parser& parser, const void* value_ptr, const parser_t::name_stack_t& name_stack); static bool readS32(Parser& parser, void* val_ptr); static bool readU32(Parser& parser, void* val_ptr); -- cgit v1.2.3 From 904e43e664583b6e567a32becf182957b2006dff Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 26 Aug 2010 11:23:46 -0700 Subject: Fix another mac build error. --- indra/llui/llsdparam.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 83c958d67d..c42358178a 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -93,7 +93,8 @@ class LLSDParamAdapter : public T LLSDParamAdapter() {} LLSDParamAdapter(const LLSD& sd) { - LLParamSDParser::instance().readSD(sd, *this); + LLParamSDParser parser; + parser.readSD(sd, *this); } LLSDParamAdapter(const T& val) -- cgit v1.2.3 From 3918b251e0f0405042ac8af6f5ff808bc2cc9553 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 14 Sep 2010 20:10:18 -0700 Subject: implemented param block -> LLSD serialization --- indra/llui/llsdparam.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui/llsdparam.h') diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index bebf202b81..97e8b58e49 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -51,7 +51,7 @@ private: static bool writeTypedValue(Parser& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack) { LLParamSDParser& sdparser = static_cast(parser); - if (!sdparser.mWriteSD) return false; + if (!sdparser.mWriteRootSD) return false; LLSD* sd_to_write = sdparser.getSDWriteNode(name_stack); if (!sd_to_write) return false; @@ -77,7 +77,8 @@ private: Parser::name_stack_t mNameStack; const LLSD* mCurReadSD; - LLSD* mWriteSD; + LLSD* mWriteRootSD; + LLSD* mCurWriteSD; }; template -- cgit v1.2.3