summaryrefslogtreecommitdiff
path: root/indra/llxuixml/llinitparam.h
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-04 15:31:19 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-04 15:31:19 -0800
commitc9868071b113b251e03d95163118b696e28bbe98 (patch)
tree8428d2e97f7a61b1a10e7e10494199a39969369d /indra/llxuixml/llinitparam.h
parente833e7ad442f5b59f95c6ccfcaaf1d103d247d69 (diff)
parente8659e0e13c65308ad2f036dc7e7ccff0e665976 (diff)
Merge from trunk. Conflicts manually resolved in:
U indra/llui/lluictrlfactory.cpp U indra/newview/llinventorybridge.cpp U indra/newview/llviewertexture.cpp U indra/newview/llviewertexture.h
Diffstat (limited to 'indra/llxuixml/llinitparam.h')
-rw-r--r--indra/llxuixml/llinitparam.h78
1 files changed, 40 insertions, 38 deletions
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<U32 MIN_AMOUNT>
+ struct AtLeast
+ {
+ static U32 minCount() { return MIN_AMOUNT; }
+ static U32 maxCount() { return U32_MAX; }
+ };
+
+ template<U32 MAX_AMOUNT>
+ struct AtMost
+ {
+ static U32 minCount() { return 0; }
+ static U32 maxCount() { return MAX_AMOUNT; }
+ };
+
+ template<U32 MIN_AMOUNT, U32 MAX_AMOUNT>
+ struct Between
+ {
+ static U32 minCount() { return MIN_AMOUNT; }
+ static U32 maxCount() { return MAX_AMOUNT; }
+ };
+
+ template<U32 EXACT_COUNT>
+ 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<U32 MIN_AMOUNT>
- struct AtLeast
- {
- static U32 minCount() { return MIN_AMOUNT; }
- static U32 maxCount() { return U32_MAX; }
- };
-
- template<U32 MAX_AMOUNT>
- struct AtMost
- {
- static U32 minCount() { return 0; }
- static U32 maxCount() { return MAX_AMOUNT; }
- };
-
- template<U32 MIN_AMOUNT, U32 MAX_AMOUNT>
- struct Between
- {
- static U32 minCount() { return MIN_AMOUNT; }
- static U32 maxCount() { return MAX_AMOUNT; }
- };
-
- template<U32 EXACT_COUNT>
- struct Exactly
- {
- static U32 minCount() { return EXACT_COUNT; }
- static U32 maxCount() { return EXACT_COUNT; }
- };
-
template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlock>
class Block
: public BASE_BLOCK
@@ -1491,7 +1492,7 @@ namespace LLInitParam
};
- template <typename T, typename RANGE = AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> >
+ template <typename T, typename RANGE = BaseBlock::AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> >
class Multiple : public TypedParam<T, NAME_VALUE_LOOKUP, true>
{
public:
@@ -1711,7 +1712,7 @@ namespace LLInitParam
{
if (block_t::validateBlock(true))
{
- mData.mValue = static_cast<const DERIVED*>(this)->getValueFromBlock();
+ static_cast<const DERIVED*>(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<DERIVED*>(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<const DERIVED*>(this)->getValueFromBlock();
+ static_cast<const DERIVED*>(this)->setValueFromBlock();
mData.clearKey();
mData.mLastParamVersion = BaseBlock::getLastChangeVersion();
}