Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
7e487652
Commit
7e487652
authored
14 years ago
by
Richard Nelson
Browse files
Options
Downloads
Patches
Plain Diff
DEV-50271 WIP SLURL support for non-clickable names
fixed merging logic for blockvalues like rect, uiimage, etc
parent
087ba606
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llxuixml/llinitparam.cpp
+6
-6
6 additions, 6 deletions
indra/llxuixml/llinitparam.cpp
indra/llxuixml/llinitparam.h
+39
-39
39 additions, 39 deletions
indra/llxuixml/llinitparam.h
with
45 additions
and
45 deletions
indra/llxuixml/llinitparam.cpp
+
6
−
6
View file @
7e487652
...
@@ -139,7 +139,7 @@ namespace LLInitParam
...
@@ -139,7 +139,7 @@ namespace LLInitParam
bool
BaseBlock
::
validateBlock
(
bool
emit_errors
)
const
bool
BaseBlock
::
validateBlock
(
bool
emit_errors
)
const
{
{
const
BlockDescriptor
&
block_data
=
get
BlockDescriptor
();
const
BlockDescriptor
&
block_data
=
mostDerived
BlockDescriptor
();
for
(
BlockDescriptor
::
param_validation_list_t
::
const_iterator
it
=
block_data
.
mValidationList
.
begin
();
it
!=
block_data
.
mValidationList
.
end
();
++
it
)
for
(
BlockDescriptor
::
param_validation_list_t
::
const_iterator
it
=
block_data
.
mValidationList
.
begin
();
it
!=
block_data
.
mValidationList
.
end
();
++
it
)
{
{
const
Param
*
param
=
getParamFromHandle
(
it
->
first
);
const
Param
*
param
=
getParamFromHandle
(
it
->
first
);
...
@@ -159,7 +159,7 @@ namespace LLInitParam
...
@@ -159,7 +159,7 @@ namespace LLInitParam
{
{
// named param is one like LLView::Params::follows
// named param is one like LLView::Params::follows
// unnamed param is like LLView::Params::rect - implicit
// unnamed param is like LLView::Params::rect - implicit
const
BlockDescriptor
&
block_data
=
get
BlockDescriptor
();
const
BlockDescriptor
&
block_data
=
mostDerived
BlockDescriptor
();
for
(
BlockDescriptor
::
param_list_t
::
const_iterator
it
=
block_data
.
mUnnamedParams
.
begin
();
for
(
BlockDescriptor
::
param_list_t
::
const_iterator
it
=
block_data
.
mUnnamedParams
.
begin
();
it
!=
block_data
.
mUnnamedParams
.
end
();
it
!=
block_data
.
mUnnamedParams
.
end
();
...
@@ -230,7 +230,7 @@ namespace LLInitParam
...
@@ -230,7 +230,7 @@ namespace LLInitParam
{
{
// named param is one like LLView::Params::follows
// named param is one like LLView::Params::follows
// unnamed param is like LLView::Params::rect - implicit
// unnamed param is like LLView::Params::rect - implicit
const
BlockDescriptor
&
block_data
=
get
BlockDescriptor
();
const
BlockDescriptor
&
block_data
=
mostDerived
BlockDescriptor
();
for
(
BlockDescriptor
::
param_list_t
::
const_iterator
it
=
block_data
.
mUnnamedParams
.
begin
();
for
(
BlockDescriptor
::
param_list_t
::
const_iterator
it
=
block_data
.
mUnnamedParams
.
begin
();
it
!=
block_data
.
mUnnamedParams
.
end
();
it
!=
block_data
.
mUnnamedParams
.
end
();
...
@@ -301,7 +301,7 @@ namespace LLInitParam
...
@@ -301,7 +301,7 @@ namespace LLInitParam
bool
BaseBlock
::
deserializeBlock
(
Parser
&
p
,
Parser
::
name_stack_range_t
name_stack
)
bool
BaseBlock
::
deserializeBlock
(
Parser
&
p
,
Parser
::
name_stack_range_t
name_stack
)
{
{
BlockDescriptor
&
block_data
=
get
BlockDescriptor
();
BlockDescriptor
&
block_data
=
mostDerived
BlockDescriptor
();
bool
names_left
=
name_stack
.
first
!=
name_stack
.
second
;
bool
names_left
=
name_stack
.
first
!=
name_stack
.
second
;
if
(
names_left
)
if
(
names_left
)
...
@@ -386,7 +386,7 @@ namespace LLInitParam
...
@@ -386,7 +386,7 @@ namespace LLInitParam
void
BaseBlock
::
addSynonym
(
Param
&
param
,
const
std
::
string
&
synonym
)
void
BaseBlock
::
addSynonym
(
Param
&
param
,
const
std
::
string
&
synonym
)
{
{
BlockDescriptor
&
block_data
=
get
BlockDescriptor
();
BlockDescriptor
&
block_data
=
mostDerived
BlockDescriptor
();
if
(
block_data
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
block_data
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
{
{
param_handle_t
handle
=
getHandleFromParam
(
&
param
);
param_handle_t
handle
=
getHandleFromParam
(
&
param
);
...
@@ -445,7 +445,7 @@ namespace LLInitParam
...
@@ -445,7 +445,7 @@ namespace LLInitParam
ParamDescriptor
*
BaseBlock
::
findParamDescriptor
(
param_handle_t
handle
)
ParamDescriptor
*
BaseBlock
::
findParamDescriptor
(
param_handle_t
handle
)
{
{
BlockDescriptor
&
descriptor
=
get
BlockDescriptor
();
BlockDescriptor
&
descriptor
=
mostDerived
BlockDescriptor
();
BlockDescriptor
::
all_params_list_t
::
iterator
end_it
=
descriptor
.
mAllParams
.
end
();
BlockDescriptor
::
all_params_list_t
::
iterator
end_it
=
descriptor
.
mAllParams
.
end
();
for
(
BlockDescriptor
::
all_params_list_t
::
iterator
it
=
descriptor
.
mAllParams
.
begin
();
for
(
BlockDescriptor
::
all_params_list_t
::
iterator
it
=
descriptor
.
mAllParams
.
begin
();
it
!=
end_it
;
it
!=
end_it
;
...
...
This diff is collapsed.
Click to expand it.
indra/llxuixml/llinitparam.h
+
39
−
39
View file @
7e487652
...
@@ -479,8 +479,8 @@ namespace LLInitParam
...
@@ -479,8 +479,8 @@ namespace LLInitParam
bool
serializeBlock
(
Parser
&
p
,
Parser
::
name_stack_t
name_stack
=
Parser
::
name_stack_t
(),
const
BaseBlock
*
diff_block
=
NULL
)
const
;
bool
serializeBlock
(
Parser
&
p
,
Parser
::
name_stack_t
name_stack
=
Parser
::
name_stack_t
(),
const
BaseBlock
*
diff_block
=
NULL
)
const
;
bool
inspectBlock
(
Parser
&
p
,
Parser
::
name_stack_t
name_stack
=
Parser
::
name_stack_t
())
const
;
bool
inspectBlock
(
Parser
&
p
,
Parser
::
name_stack_t
name_stack
=
Parser
::
name_stack_t
())
const
;
const
BlockDescriptor
&
get
BlockDescriptor
()
const
{
return
*
mBlockDescriptor
;
}
const
BlockDescriptor
&
mostDerived
BlockDescriptor
()
const
{
return
*
mBlockDescriptor
;
}
BlockDescriptor
&
get
BlockDescriptor
()
{
return
*
mBlockDescriptor
;
}
BlockDescriptor
&
mostDerived
BlockDescriptor
()
{
return
*
mBlockDescriptor
;
}
// take all provided params from other and apply to self
// take all provided params from other and apply to self
bool
overwriteFrom
(
const
BaseBlock
&
other
)
bool
overwriteFrom
(
const
BaseBlock
&
other
)
...
@@ -507,7 +507,7 @@ namespace LLInitParam
...
@@ -507,7 +507,7 @@ namespace LLInitParam
BlockDescriptor
*
mBlockDescriptor
;
// most derived block descriptor
BlockDescriptor
*
mBlockDescriptor
;
// most derived block descriptor
static
BlockDescriptor
&
b
lockDescriptor
()
static
BlockDescriptor
&
selfB
lockDescriptor
()
{
{
static
BlockDescriptor
sBlockDescriptor
;
static
BlockDescriptor
sBlockDescriptor
;
return
sBlockDescriptor
;
return
sBlockDescriptor
;
...
@@ -559,7 +559,7 @@ namespace LLInitParam
...
@@ -559,7 +559,7 @@ namespace LLInitParam
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
{
{
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
&
mergeWith
,
&
mergeWith
,
...
@@ -723,7 +723,7 @@ namespace LLInitParam
...
@@ -723,7 +723,7 @@ namespace LLInitParam
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
T
(
value
)
T
(
value
)
{
{
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
&
mergeWith
,
&
mergeWith
,
...
@@ -858,7 +858,7 @@ namespace LLInitParam
...
@@ -858,7 +858,7 @@ namespace LLInitParam
{
{
const
self_t
&
src_typed_param
=
static_cast
<
const
self_t
&>
(
src
);
const
self_t
&
src_typed_param
=
static_cast
<
const
self_t
&>
(
src
);
self_t
&
dst_typed_param
=
static_cast
<
self_t
&>
(
dst
);
self_t
&
dst_typed_param
=
static_cast
<
self_t
&>
(
dst
);
if
(
dst_typed_param
.
T
::
merge
(
dst_typed_param
.
BaseBlock
::
get
BlockDescriptor
(),
src_typed_param
,
overwrite
))
if
(
dst_typed_param
.
T
::
merge
(
self
BlockDescriptor
(),
src_typed_param
,
overwrite
||
!
dst_typed_param
.
isProvided
()
))
{
{
dst_typed_param
.
mData
.
clearKey
();
dst_typed_param
.
mData
.
clearKey
();
return
true
;
return
true
;
...
@@ -902,7 +902,7 @@ namespace LLInitParam
...
@@ -902,7 +902,7 @@ namespace LLInitParam
mValues
(
value
)
mValues
(
value
)
{
{
mCachedKeys
.
resize
(
mValues
.
size
());
mCachedKeys
.
resize
(
mValues
.
size
());
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
&
mergeWith
,
&
mergeWith
,
...
@@ -1085,7 +1085,7 @@ namespace LLInitParam
...
@@ -1085,7 +1085,7 @@ namespace LLInitParam
mLastParamGeneration
(
0
)
mLastParamGeneration
(
0
)
{
{
mCachedKeys
.
resize
(
mValues
.
size
());
mCachedKeys
.
resize
(
mValues
.
size
());
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
&
mergeWith
,
&
mergeWith
,
...
@@ -1273,24 +1273,23 @@ namespace LLInitParam
...
@@ -1273,24 +1273,23 @@ namespace LLInitParam
// take all provided params from other and apply to self
// take all provided params from other and apply to self
bool
overwriteFrom
(
const
self_t
&
other
)
bool
overwriteFrom
(
const
self_t
&
other
)
{
{
return
merge
(
b
lockDescriptor
(),
other
,
true
);
return
merge
(
selfB
lockDescriptor
(),
other
,
true
);
}
}
// take all provided params that are not already provided, and apply to self
// take all provided params that are not already provided, and apply to self
bool
fillFrom
(
const
self_t
&
other
)
bool
fillFrom
(
const
self_t
&
other
)
{
{
return
merge
(
b
lockDescriptor
(),
other
,
false
);
return
merge
(
selfB
lockDescriptor
(),
other
,
false
);
}
}
// merge with other block
// merge with other block
bool
merge
(
BlockDescriptor
&
block_data
,
const
self_t
&
other
,
bool
overwrite
)
bool
merge
(
BlockDescriptor
&
block_data
,
const
self_t
&
other
,
bool
overwrite
)
{
{
// only merge a choice if we are overwriting with other's contents
// only merge a choice if we are overwriting with other's contents
// or we have never specified a choice locally, other than the default
if
(
overwrite
)
if
(
overwrite
||
getLastChangeVersion
()
==
0
)
{
{
mCurChoice
=
other
.
mCurChoice
;
mCurChoice
=
other
.
mCurChoice
;
return
BaseBlock
::
merge
(
b
lockDescriptor
(),
other
,
overwrite
);
return
BaseBlock
::
merge
(
selfB
lockDescriptor
(),
other
,
overwrite
);
}
}
return
false
;
return
false
;
}
}
...
@@ -1317,7 +1316,7 @@ namespace LLInitParam
...
@@ -1317,7 +1316,7 @@ namespace LLInitParam
Choice
()
Choice
()
:
mCurChoice
(
0
)
:
mCurChoice
(
0
)
{
{
BaseBlock
::
init
(
b
lockDescriptor
(),
BaseBlock
::
b
lockDescriptor
(),
sizeof
(
DERIVED_BLOCK
));
BaseBlock
::
init
(
selfB
lockDescriptor
(),
BaseBlock
::
selfB
lockDescriptor
(),
sizeof
(
DERIVED_BLOCK
));
}
}
// Alternatives are mutually exclusive wrt other Alternatives in the same block.
// Alternatives are mutually exclusive wrt other Alternatives in the same block.
...
@@ -1334,13 +1333,14 @@ namespace LLInitParam
...
@@ -1334,13 +1333,14 @@ namespace LLInitParam
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
explicit
Alternative
(
const
char
*
name
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
explicit
Alternative
(
const
char
*
name
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
:
super_t
(
DERIVED_BLOCK
::
b
lockDescriptor
(),
name
,
val
,
NULL
,
0
,
1
),
:
super_t
(
DERIVED_BLOCK
::
selfB
lockDescriptor
(),
name
,
val
,
NULL
,
0
,
1
),
mOriginalValue
(
val
)
mOriginalValue
(
val
)
{
{
// assign initial choice to first declared option
// assign initial choice to first declared option
DERIVED_BLOCK
*
blockp
=
((
DERIVED_BLOCK
*
)
DERIVED_BLOCK
::
blockDescriptor
().
mCurrentBlockPtr
);
DERIVED_BLOCK
*
blockp
=
((
DERIVED_BLOCK
*
)
DERIVED_BLOCK
::
selfBlockDescriptor
().
mCurrentBlockPtr
);
if
(
DERIVED_BLOCK
::
blockDescriptor
().
mInitializationState
==
BlockDescriptor
::
INITIALIZING
if
(
LL_UNLIKELY
(
&&
blockp
->
mCurChoice
==
0
)
DERIVED_BLOCK
::
selfBlockDescriptor
().
mInitializationState
==
BlockDescriptor
::
INITIALIZING
&&
blockp
->
mCurChoice
==
0
))
{
{
blockp
->
mCurChoice
=
Param
::
enclosingBlock
().
getHandleFromParam
(
this
);
blockp
->
mCurChoice
=
Param
::
enclosingBlock
().
getHandleFromParam
(
this
);
}
}
...
@@ -1385,7 +1385,7 @@ namespace LLInitParam
...
@@ -1385,7 +1385,7 @@ namespace LLInitParam
};
};
protected
:
protected
:
static
BlockDescriptor
&
b
lockDescriptor
()
static
BlockDescriptor
&
selfB
lockDescriptor
()
{
{
static
BlockDescriptor
sBlockDescriptor
;
static
BlockDescriptor
sBlockDescriptor
;
return
sBlockDescriptor
;
return
sBlockDescriptor
;
...
@@ -1413,19 +1413,19 @@ namespace LLInitParam
...
@@ -1413,19 +1413,19 @@ namespace LLInitParam
// take all provided params from other and apply to self
// take all provided params from other and apply to self
bool
overwriteFrom
(
const
self_t
&
other
)
bool
overwriteFrom
(
const
self_t
&
other
)
{
{
return
BaseBlock
::
merge
(
b
lockDescriptor
(),
other
,
true
);
return
BaseBlock
::
merge
(
selfB
lockDescriptor
(),
other
,
true
);
}
}
// take all provided params that are not already provided, and apply to self
// take all provided params that are not already provided, and apply to self
bool
fillFrom
(
const
self_t
&
other
)
bool
fillFrom
(
const
self_t
&
other
)
{
{
return
BaseBlock
::
merge
(
b
lockDescriptor
(),
other
,
false
);
return
BaseBlock
::
merge
(
selfB
lockDescriptor
(),
other
,
false
);
}
}
protected
:
protected
:
Block
()
Block
()
{
{
//#pragma message("Parsing LLInitParam::Block")
//#pragma message("Parsing LLInitParam::Block")
BaseBlock
::
init
(
b
lockDescriptor
(),
BASE_BLOCK
::
b
lockDescriptor
(),
sizeof
(
DERIVED_BLOCK
));
BaseBlock
::
init
(
selfB
lockDescriptor
(),
BASE_BLOCK
::
selfB
lockDescriptor
(),
sizeof
(
DERIVED_BLOCK
));
}
}
//
//
...
@@ -1439,7 +1439,7 @@ namespace LLInitParam
...
@@ -1439,7 +1439,7 @@ namespace LLInitParam
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
explicit
Optional
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
explicit
Optional
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
:
super_t
(
DERIVED_BLOCK
::
b
lockDescriptor
(),
name
,
val
,
NULL
,
0
,
1
)
:
super_t
(
DERIVED_BLOCK
::
selfB
lockDescriptor
(),
name
,
val
,
NULL
,
0
,
1
)
{
{
//#pragma message("Parsing LLInitParam::Block::Optional")
//#pragma message("Parsing LLInitParam::Block::Optional")
}
}
...
@@ -1468,7 +1468,7 @@ namespace LLInitParam
...
@@ -1468,7 +1468,7 @@ namespace LLInitParam
// mandatory parameters require a name to be parseable
// mandatory parameters require a name to be parseable
explicit
Mandatory
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
explicit
Mandatory
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
T
>::
get
())
:
super_t
(
DERIVED_BLOCK
::
b
lockDescriptor
(),
name
,
val
,
&
validate
,
1
,
1
)
:
super_t
(
DERIVED_BLOCK
::
selfB
lockDescriptor
(),
name
,
val
,
&
validate
,
1
,
1
)
{}
{}
Mandatory
&
operator
=
(
value_assignment_t
val
)
Mandatory
&
operator
=
(
value_assignment_t
val
)
...
@@ -1504,7 +1504,7 @@ namespace LLInitParam
...
@@ -1504,7 +1504,7 @@ namespace LLInitParam
typedef
typename
container_t
::
const_iterator
const_iterator
;
typedef
typename
container_t
::
const_iterator
const_iterator
;
explicit
Multiple
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
container_t
>::
get
())
explicit
Multiple
(
const
char
*
name
=
""
,
value_assignment_t
val
=
DefaultInitializer
<
container_t
>::
get
())
:
super_t
(
DERIVED_BLOCK
::
b
lockDescriptor
(),
name
,
val
,
&
validate
,
RANGE
::
minCount
(),
RANGE
::
maxCount
())
:
super_t
(
DERIVED_BLOCK
::
selfB
lockDescriptor
(),
name
,
val
,
&
validate
,
RANGE
::
minCount
(),
RANGE
::
maxCount
())
{}
{}
using
super_t
::
operator
();
using
super_t
::
operator
();
...
@@ -1532,10 +1532,10 @@ namespace LLInitParam
...
@@ -1532,10 +1532,10 @@ namespace LLInitParam
{
{
public:
public:
explicit
Deprecated
(
const
char
*
name
)
explicit
Deprecated
(
const
char
*
name
)
:
Param
(
DERIVED_BLOCK
::
b
lockDescriptor
().
mCurrentBlockPtr
)
:
Param
(
DERIVED_BLOCK
::
selfB
lockDescriptor
().
mCurrentBlockPtr
)
{
{
BlockDescriptor
&
block_descriptor
=
DERIVED_BLOCK
::
b
lockDescriptor
();
BlockDescriptor
&
block_descriptor
=
DERIVED_BLOCK
::
selfB
lockDescriptor
();
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
NULL
,
NULL
,
...
@@ -1564,7 +1564,7 @@ namespace LLInitParam
...
@@ -1564,7 +1564,7 @@ namespace LLInitParam
typedef
Deprecated
Ignored
;
typedef
Deprecated
Ignored
;
protected
:
protected
:
static
BlockDescriptor
&
b
lockDescriptor
()
static
BlockDescriptor
&
selfB
lockDescriptor
()
{
{
static
BlockDescriptor
sBlockDescriptor
;
static
BlockDescriptor
sBlockDescriptor
;
return
sBlockDescriptor
;
return
sBlockDescriptor
;
...
@@ -1577,12 +1577,12 @@ namespace LLInitParam
...
@@ -1577,12 +1577,12 @@ namespace LLInitParam
public
Param
public
Param
{
{
public:
public:
typedef
enum
e_value_
valid
typedef
enum
e_value_
age
{
{
OLDER_THAN_BLOCK
,
// mData.mValue needs to be refreshed from the block parameters
OLDER_THAN_BLOCK
,
// mData.mValue needs to be refreshed from the block parameters
NEWER_THAN_BLOCK
,
// mData.mValue holds the authoritative value (which has been replicated to the block parameters via setBlockFromValue)
NEWER_THAN_BLOCK
,
// mData.mValue holds the authoritative value (which has been replicated to the block parameters via setBlockFromValue)
SAME_AS_BLOCK
// mData.mValue is derived from the block parameters, which are authoritative
SAME_AS_BLOCK
// mData.mValue is derived from the block parameters, which are authoritative
}
EValue
Valid
;
}
EValue
Age
;
typedef
BlockValue
<
T
>
self_t
;
typedef
BlockValue
<
T
>
self_t
;
typedef
Block
<
TypedParam
<
T
,
TypeValues
<
T
>
,
false
>
>
block_t
;
typedef
Block
<
TypedParam
<
T
,
TypeValues
<
T
>
,
false
>
>
block_t
;
...
@@ -1592,9 +1592,9 @@ namespace LLInitParam
...
@@ -1592,9 +1592,9 @@ namespace LLInitParam
BlockValue
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
BlockValue
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
mData
(
value
)
mData
(
value
,
NEWER_THAN_BLOCK
)
{
{
if
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
)
)
{
{
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
ParamDescriptor
param_descriptor
(
block_descriptor
.
mCurrentBlockPtr
->
getHandleFromParam
(
this
),
&
mergeWith
,
&
mergeWith
,
...
@@ -1802,13 +1802,13 @@ namespace LLInitParam
...
@@ -1802,13 +1802,13 @@ namespace LLInitParam
struct
Data
:
public
key_cache_t
struct
Data
:
public
key_cache_t
{
{
Data
(
const
T
&
value
)
Data
(
const
T
&
value
,
EValueAge
age
)
:
mValue
(
value
),
:
mValue
(
value
),
mValueAge
(
SAME_AS_BLOCK
)
mValueAge
(
age
)
{}
{}
T
mValue
;
T
mValue
;
EValue
Valid
mValueAge
;
EValue
Age
mValueAge
;
};
};
// mutable to allow lazy updates on get
// mutable to allow lazy updates on get
...
@@ -1831,7 +1831,7 @@ namespace LLInitParam
...
@@ -1831,7 +1831,7 @@ namespace LLInitParam
else
else
{
{
// merge individual parameters into destination
// merge individual parameters into destination
dst_typed_param
.
merge
(
block_t
::
b
lockDescriptor
(),
src_typed_param
,
overwrite
);
dst_typed_param
.
merge
(
block_t
::
selfB
lockDescriptor
(),
src_typed_param
,
overwrite
);
}
}
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment