From 3a02b9ec882c98009ae6c24913ee8a7a620b0f87 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 15 Dec 2009 19:33:18 -0800 Subject: added setBlockFromValue so setting a LLRect param in code will set the individual left, right, top, bottom values, for example don't call setupParams when creating widgets from code moved Multiple param constraints into BaseBlock to remove extra scoping --- indra/llxuixml/llinitparam.h | 78 +++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 493ddaa378..7e1e4a3d21 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1,5 +1,5 @@ /** - * @file llinitparam.h +f * @file llinitparam.h * @brief parameter block abstraction for creating complex objects and * parsing construction parameters from xml and LLSD * @@ -405,6 +405,41 @@ namespace LLInitParam class BaseBlock { public: + // "Multiple" constraint types + struct AnyAmount + { + static U32 minCount() { return 0; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtLeast + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtMost + { + static U32 minCount() { return 0; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Between + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Exactly + { + static U32 minCount() { return EXACT_COUNT; } + static U32 maxCount() { return EXACT_COUNT; } + }; + // this typedef identifies derived classes as being blocks typedef void baseblock_base_class_t; LOG_CLASS(BaseBlock); @@ -1365,40 +1400,6 @@ namespace LLInitParam } }; - struct AnyAmount - { - static U32 minCount() { return 0; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtLeast - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtMost - { - static U32 minCount() { return 0; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Between - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Exactly - { - static U32 minCount() { return EXACT_COUNT; } - static U32 maxCount() { return EXACT_COUNT; } - }; - template class Block : public BASE_BLOCK @@ -1491,7 +1492,7 @@ namespace LLInitParam }; - template > + template > class Multiple : public TypedParam { public: @@ -1711,7 +1712,7 @@ namespace LLInitParam { if (block_t::validateBlock(true)) { - mData.mValue = static_cast(this)->getValueFromBlock(); + static_cast(this)->setValueFromBlock(); // clear stale keyword associated with old value mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); @@ -1737,6 +1738,7 @@ namespace LLInitParam mData.mValue = val; mData.clearKey(); setProvided(flag_as_provided); + static_cast(this)->setBlockFromValue(); } void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true) @@ -1768,7 +1770,7 @@ namespace LLInitParam // go ahead and issue warnings at this point if any param is invalid if(block_t::validateBlock(false)) { - mData.mValue = static_cast(this)->getValueFromBlock(); + static_cast(this)->setValueFromBlock(); mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); } -- cgit v1.2.3 From e8fe81c4fcbec173606b5ad635e0b774e4d8b24b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 16 Dec 2009 16:04:09 -0800 Subject: Backed out changeset: cfa60aef8061, added setBlockFromValue so setting a LLRect param in code will set the individua --- indra/llxuixml/llinitparam.h | 78 +++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 40 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 7e1e4a3d21..493ddaa378 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1,5 +1,5 @@ /** -f * @file llinitparam.h + * @file llinitparam.h * @brief parameter block abstraction for creating complex objects and * parsing construction parameters from xml and LLSD * @@ -405,41 +405,6 @@ namespace LLInitParam class BaseBlock { public: - // "Multiple" constraint types - struct AnyAmount - { - static U32 minCount() { return 0; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtLeast - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtMost - { - static U32 minCount() { return 0; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Between - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Exactly - { - static U32 minCount() { return EXACT_COUNT; } - static U32 maxCount() { return EXACT_COUNT; } - }; - // this typedef identifies derived classes as being blocks typedef void baseblock_base_class_t; LOG_CLASS(BaseBlock); @@ -1400,6 +1365,40 @@ namespace LLInitParam } }; + struct AnyAmount + { + static U32 minCount() { return 0; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtLeast + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtMost + { + static U32 minCount() { return 0; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Between + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Exactly + { + static U32 minCount() { return EXACT_COUNT; } + static U32 maxCount() { return EXACT_COUNT; } + }; + template class Block : public BASE_BLOCK @@ -1492,7 +1491,7 @@ namespace LLInitParam }; - template > + template > class Multiple : public TypedParam { public: @@ -1712,7 +1711,7 @@ namespace LLInitParam { if (block_t::validateBlock(true)) { - static_cast(this)->setValueFromBlock(); + mData.mValue = static_cast(this)->getValueFromBlock(); // clear stale keyword associated with old value mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); @@ -1738,7 +1737,6 @@ namespace LLInitParam mData.mValue = val; mData.clearKey(); setProvided(flag_as_provided); - static_cast(this)->setBlockFromValue(); } void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true) @@ -1770,7 +1768,7 @@ namespace LLInitParam // go ahead and issue warnings at this point if any param is invalid if(block_t::validateBlock(false)) { - static_cast(this)->setValueFromBlock(); + mData.mValue = static_cast(this)->getValueFromBlock(); mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); } -- cgit v1.2.3 From 9ff869a6b287a2b4b8c94219584d1c7b66ebb399 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 17 Dec 2009 10:01:55 -0800 Subject: Backed out changeset: 4d482c1ed041 --- indra/llxuixml/llinitparam.h | 78 +++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 493ddaa378..7e1e4a3d21 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1,5 +1,5 @@ /** - * @file llinitparam.h +f * @file llinitparam.h * @brief parameter block abstraction for creating complex objects and * parsing construction parameters from xml and LLSD * @@ -405,6 +405,41 @@ namespace LLInitParam class BaseBlock { public: + // "Multiple" constraint types + struct AnyAmount + { + static U32 minCount() { return 0; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtLeast + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return U32_MAX; } + }; + + template + struct AtMost + { + static U32 minCount() { return 0; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Between + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template + struct Exactly + { + static U32 minCount() { return EXACT_COUNT; } + static U32 maxCount() { return EXACT_COUNT; } + }; + // this typedef identifies derived classes as being blocks typedef void baseblock_base_class_t; LOG_CLASS(BaseBlock); @@ -1365,40 +1400,6 @@ namespace LLInitParam } }; - struct AnyAmount - { - static U32 minCount() { return 0; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtLeast - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return U32_MAX; } - }; - - template - struct AtMost - { - static U32 minCount() { return 0; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Between - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template - struct Exactly - { - static U32 minCount() { return EXACT_COUNT; } - static U32 maxCount() { return EXACT_COUNT; } - }; - template class Block : public BASE_BLOCK @@ -1491,7 +1492,7 @@ namespace LLInitParam }; - template > + template > class Multiple : public TypedParam { public: @@ -1711,7 +1712,7 @@ namespace LLInitParam { if (block_t::validateBlock(true)) { - mData.mValue = static_cast(this)->getValueFromBlock(); + static_cast(this)->setValueFromBlock(); // clear stale keyword associated with old value mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); @@ -1737,6 +1738,7 @@ namespace LLInitParam mData.mValue = val; mData.clearKey(); setProvided(flag_as_provided); + static_cast(this)->setBlockFromValue(); } void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true) @@ -1768,7 +1770,7 @@ namespace LLInitParam // go ahead and issue warnings at this point if any param is invalid if(block_t::validateBlock(false)) { - mData.mValue = static_cast(this)->getValueFromBlock(); + static_cast(this)->setValueFromBlock(); mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); } -- cgit v1.2.3