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
43ae94ab
Commit
43ae94ab
authored
15 years ago
by
Nat Goodspeed
Browse files
Options
Downloads
Patches
Plain Diff
Rename private methods to avoid ambiguity with subclasses
parent
113a0271
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/llinstancetracker.h
+23
-23
23 additions, 23 deletions
indra/llcommon/llinstancetracker.h
with
23 additions
and
23 deletions
indra/llcommon/llinstancetracker.h
+
23
−
23
View file @
43ae94ab
...
@@ -61,46 +61,46 @@ class LLInstanceTracker : boost::noncopyable
...
@@ -61,46 +61,46 @@ class LLInstanceTracker : boost::noncopyable
static
T
*
getInstance
(
const
KEY
&
k
)
static
T
*
getInstance
(
const
KEY
&
k
)
{
{
typename
InstanceMap
::
const_iterator
found
=
getMap
().
find
(
k
);
typename
InstanceMap
::
const_iterator
found
=
getMap
_
().
find
(
k
);
return
(
found
==
getMap
().
end
())
?
NULL
:
found
->
second
;
return
(
found
==
getMap
_
().
end
())
?
NULL
:
found
->
second
;
}
}
static
key_iter
beginKeys
()
static
key_iter
beginKeys
()
{
{
return
boost
::
make_transform_iterator
(
getMap
().
begin
(),
return
boost
::
make_transform_iterator
(
getMap
_
().
begin
(),
boost
::
bind
(
&
InstanceMap
::
value_type
::
first
,
_1
));
boost
::
bind
(
&
InstanceMap
::
value_type
::
first
,
_1
));
}
}
static
key_iter
endKeys
()
static
key_iter
endKeys
()
{
{
return
boost
::
make_transform_iterator
(
getMap
().
end
(),
return
boost
::
make_transform_iterator
(
getMap
_
().
end
(),
boost
::
bind
(
&
InstanceMap
::
value_type
::
first
,
_1
));
boost
::
bind
(
&
InstanceMap
::
value_type
::
first
,
_1
));
}
}
static
instance_iter
beginInstances
()
static
instance_iter
beginInstances
()
{
{
return
instance_iter
(
boost
::
make_transform_iterator
(
getMap
().
begin
(),
return
instance_iter
(
boost
::
make_transform_iterator
(
getMap
_
().
begin
(),
boost
::
bind
(
&
InstanceMap
::
value_type
::
second
,
_1
)));
boost
::
bind
(
&
InstanceMap
::
value_type
::
second
,
_1
)));
}
}
static
instance_iter
endInstances
()
static
instance_iter
endInstances
()
{
{
return
instance_iter
(
boost
::
make_transform_iterator
(
getMap
().
end
(),
return
instance_iter
(
boost
::
make_transform_iterator
(
getMap
_
().
end
(),
boost
::
bind
(
&
InstanceMap
::
value_type
::
second
,
_1
)));
boost
::
bind
(
&
InstanceMap
::
value_type
::
second
,
_1
)));
}
}
static
S32
instanceCount
()
{
return
getMap
().
size
();
}
static
S32
instanceCount
()
{
return
getMap
_
().
size
();
}
protected
:
protected
:
LLInstanceTracker
(
KEY
key
)
{
add
(
key
);
}
LLInstanceTracker
(
KEY
key
)
{
add
_
(
key
);
}
virtual
~
LLInstanceTracker
()
{
remove
();
}
virtual
~
LLInstanceTracker
()
{
remove
_
();
}
virtual
void
setKey
(
KEY
key
)
{
remove
();
add
(
key
);
}
virtual
void
setKey
(
KEY
key
)
{
remove
_
();
add
_
(
key
);
}
virtual
const
KEY
&
getKey
()
const
{
return
mKey
;
}
virtual
const
KEY
&
getKey
()
const
{
return
mKey
;
}
private
:
private
:
void
add
(
KEY
key
)
void
add
_
(
KEY
key
)
{
{
mKey
=
key
;
mKey
=
key
;
getMap
()[
key
]
=
static_cast
<
T
*>
(
this
);
getMap
_
()[
key
]
=
static_cast
<
T
*>
(
this
);
}
}
void
remove
()
{
getMap
().
erase
(
mKey
);
}
void
remove
_
()
{
getMap
_
().
erase
(
mKey
);
}
static
InstanceMap
&
getMap
()
static
InstanceMap
&
getMap
_
()
{
{
if
(
!
sInstances
)
if
(
!
sInstances
)
{
{
...
@@ -129,19 +129,19 @@ class LLInstanceTracker<T, T*>
...
@@ -129,19 +129,19 @@ class LLInstanceTracker<T, T*>
/// for completeness of analogy with the generic implementation
/// for completeness of analogy with the generic implementation
static
T
*
getInstance
(
T
*
k
)
{
return
k
;
}
static
T
*
getInstance
(
T
*
k
)
{
return
k
;
}
static
key_iter
beginKeys
()
{
return
getSet
().
begin
();
}
static
key_iter
beginKeys
()
{
return
getSet
_
().
begin
();
}
static
key_iter
endKeys
()
{
return
getSet
().
end
();
}
static
key_iter
endKeys
()
{
return
getSet
_
().
end
();
}
static
instance_iter
beginInstances
()
{
return
instance_iter
(
getSet
().
begin
());
}
static
instance_iter
beginInstances
()
{
return
instance_iter
(
getSet
_
().
begin
());
}
static
instance_iter
endInstances
()
{
return
instance_iter
(
getSet
().
end
());
}
static
instance_iter
endInstances
()
{
return
instance_iter
(
getSet
_
().
end
());
}
static
S32
instanceCount
()
{
return
getSet
().
size
();
}
static
S32
instanceCount
()
{
return
getSet
_
().
size
();
}
protected
:
protected
:
LLInstanceTracker
()
{
getSet
().
insert
(
static_cast
<
T
*>
(
this
));
}
LLInstanceTracker
()
{
getSet
_
().
insert
(
static_cast
<
T
*>
(
this
));
}
virtual
~
LLInstanceTracker
()
{
getSet
().
erase
(
static_cast
<
T
*>
(
this
));
}
virtual
~
LLInstanceTracker
()
{
getSet
_
().
erase
(
static_cast
<
T
*>
(
this
));
}
LLInstanceTracker
(
const
LLInstanceTracker
&
other
)
{
getSet
().
insert
(
static_cast
<
T
*>
(
this
));
}
LLInstanceTracker
(
const
LLInstanceTracker
&
other
)
{
getSet
_
().
insert
(
static_cast
<
T
*>
(
this
));
}
static
InstanceSet
&
getSet
()
// called after getReady() but before go()
static
InstanceSet
&
getSet
_
()
// called after getReady() but before go()
{
{
if
(
!
sInstances
)
if
(
!
sInstances
)
{
{
...
...
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