summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsdparam.h
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-05-22 22:08:54 +0000
committerMonty Brandenberg <monty@lindenlab.com>2014-05-22 22:08:54 +0000
commit060c728970dc78d30f2cebdbeda7e56ea8de46e2 (patch)
tree8f00ce1b3bd564bc6cb81a2bc39a081eb3deca35 /indra/llcommon/llsdparam.h
parentf8874d04b8ca238ee99dc464055295cff417a9b2 (diff)
parent644ca6a0f8a7759119814f88df93b8e838321a12 (diff)
Merge. Pull in viewer-release after release of 3.7.8
Diffstat (limited to 'indra/llcommon/llsdparam.h')
-rwxr-xr-xindra/llcommon/llsdparam.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h
index 6ef5debd7b..1542f95e68 100755
--- a/indra/llcommon/llsdparam.h
+++ b/indra/llcommon/llsdparam.h
@@ -30,6 +30,7 @@
#include "llinitparam.h"
#include "boost/function.hpp"
+#include "llfasttimer.h"
struct LL_COMMON_API LLParamSDParserUtilities
{
@@ -50,11 +51,28 @@ typedef LLInitParam::Parser parser_t;
public:
LLParamSDParser();
void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false);
- void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block);
+ template<typename BLOCK>
+ void writeSD(LLSD& sd,
+ const BLOCK& block,
+ const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(),
+ const LLInitParam::BaseBlock* diff_block = NULL)
+ {
+ if (!diff_block
+ && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE))
+ {
+ diff_block = &LLInitParam::defaultValue<BLOCK>();
+ }
+ writeSDImpl(sd, block, rules, diff_block);
+ }
/*virtual*/ std::string getCurrentElementName();
private:
+ void writeSDImpl(LLSD& sd,
+ const LLInitParam::BaseBlock& block,
+ const LLInitParam::predicate_rule_t,
+ const LLInitParam::BaseBlock* diff_block);
+
void submit(LLInitParam::BaseBlock& block, const LLSD& sd, LLInitParam::Parser::name_stack_t& name_stack);
template<typename T>
@@ -92,7 +110,7 @@ private:
};
-extern LL_COMMON_API LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR;
+extern LL_COMMON_API LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR;
template<typename T>
class LLSDParamAdapter : public T
{
@@ -100,7 +118,7 @@ public:
LLSDParamAdapter() {}
LLSDParamAdapter(const LLSD& sd)
{
- LLFastTimer _(FTM_SD_PARAM_ADAPTOR);
+ LL_RECORD_BLOCK_TIME(FTM_SD_PARAM_ADAPTOR);
LLParamSDParser parser;
// don't spam for implicit parsing of LLSD, as we want to allow arbitrary freeform data and ignore most of it
bool parse_silently = true;