Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas
athena
Commits
8ebf1386
Commit
8ebf1386
authored
1 year ago
by
Johannes Junggeburth
Browse files
Options
Downloads
Patches
Plain Diff
Use GeoIntrusivePtr instead of GeoRef
parent
bc8a760c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!68773
GeoModelUtilities - Use GeoIntrusivePtr instead of GeoRef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoRef.h
+2
-100
2 additions, 100 deletions
...ion/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoRef.h
with
2 additions
and
100 deletions
DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/GeoRef.h
+
2
−
100
View file @
8ebf1386
...
...
@@ -15,106 +15,8 @@
#ifndef GEOMODELUTILITIES_GEOREF_H
#define GEOMODELUTILITIES_GEOREF_H
#include
"GeoModelKernel/GeoIntrusivePtr.h"
template
<
class
T
>
class
GeoRef
{
public:
GeoRef
(
T
*
p
=
nullptr
)
noexcept
:
m_p
(
p
)
{
if
(
m_p
)
m_p
->
ref
();
}
~
GeoRef
()
noexcept
{
if
(
m_p
)
m_p
->
unref
();
}
GeoRef
(
const
GeoRef
&
o
)
noexcept
:
m_p
(
o
.
m_p
)
{
if
(
m_p
)
m_p
->
ref
();
}
template
<
class
U
>
GeoRef
(
GeoRef
<
U
>&
o
)
noexcept
:
m_p
(
o
.
get
())
{
if
(
m_p
)
m_p
->
ref
();
}
GeoRef
(
GeoRef
&&
o
)
noexcept
:
m_p
(
o
.
m_p
)
{
o
.
m_p
=
nullptr
;
}
GeoRef
&
operator
=
(
const
GeoRef
&
o
)
noexcept
{
if
(
this
!=
&
o
)
{
if
(
m_p
)
m_p
->
unref
();
m_p
=
o
.
m_p
;
if
(
m_p
)
m_p
->
ref
();
}
return
*
this
;
}
template
<
class
U
>
GeoRef
&
operator
=
(
GeoRef
<
U
>&
o
)
noexcept
{
if
(
m_p
)
m_p
->
unref
();
m_p
=
o
.
get
();
if
(
m_p
)
m_p
->
ref
();
return
*
this
;
}
GeoRef
&
operator
=
(
GeoRef
&&
o
)
noexcept
{
if
(
this
!=
&
o
)
{
if
(
m_p
)
m_p
->
unref
();
m_p
=
o
.
m_p
;
o
.
m_p
=
nullptr
;
}
return
*
this
;
}
operator
T
*
()
noexcept
{
return
m_p
;
}
T
*
get
()
noexcept
{
return
m_p
;
}
T
*
operator
->
()
noexcept
{
return
m_p
;
}
T
&
operator
*
()
noexcept
{
return
*
m_p
;
}
private
:
T
*
m_p
;
};
template
<
class
T
>
using
GeoRef
=
GeoIntrusivePtr
<
T
>
;
#endif // not GEOMODELUTILITIES_GEOREF_H
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