Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dCache
cta
Commits
b281751e
Commit
b281751e
authored
15 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Simplified C++ comments
parent
e5e9ae0b
No related branches found
Branches containing commit
Tags
v0.0-27
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
castor/tape/utils/SmartFILEPtr.cpp
+8
-8
8 additions, 8 deletions
castor/tape/utils/SmartFILEPtr.cpp
castor/tape/utils/SmartFILEPtr.hpp
+2
-2
2 additions, 2 deletions
castor/tape/utils/SmartFILEPtr.hpp
with
10 additions
and
10 deletions
castor/tape/utils/SmartFILEPtr.cpp
+
8
−
8
View file @
b281751e
...
...
@@ -50,15 +50,15 @@ castor::tape::utils::SmartFILEPtr::SmartFILEPtr(FILE *const file) throw() :
//-----------------------------------------------------------------------------
void
castor
::
tape
::
utils
::
SmartFILEPtr
::
reset
(
FILE
*
const
file
=
NULL
)
throw
()
{
// If the new
FILE
pointer is not the one already owned
// If the new pointer is not the one already owned
if
(
file
!=
m_file
)
{
// If this
S
mart
FILEPt
r still owns a
FILE
pointer, then close it
// If this
s
mart
pointe
r still owns a pointer, then
f
close it
if
(
m_file
!=
NULL
)
{
fclose
(
m_file
);
}
// Take ownership of the new
FILE
pointer
// Take ownership of the new pointer
m_file
=
file
;
}
}
...
...
@@ -100,21 +100,21 @@ FILE *castor::tape::utils::SmartFILEPtr::get() const throw() {
FILE
*
castor
::
tape
::
utils
::
SmartFILEPtr
::
release
()
throw
(
castor
::
exception
::
Exception
)
{
// If this
S
mart
FILEPt
r does not own a
FILE
pointer
// If this
s
mart
pointe
r does not own a pointer
if
(
m_file
==
NULL
)
{
castor
::
exception
::
Exception
ex
(
EPERM
);
ex
.
getMessage
()
<<
"Smart
FILE
pointer does not own a
basic
FILE pointer"
;
"Smart pointer does not own a FILE pointer"
;
throw
(
ex
);
}
FILE
*
const
tmp
File
=
m_file
;
FILE
*
const
tmp
=
m_file
;
// A NULL value indicates this
S
mart
FILEPt
r does not own a
FILE
pointer
// A NULL value indicates this
s
mart
pointe
r does not own a pointer
m_file
=
NULL
;
return
tmp
File
;
return
tmp
;
}
This diff is collapsed.
Click to expand it.
castor/tape/utils/SmartFILEPtr.hpp
+
2
−
2
View file @
b281751e
...
...
@@ -35,8 +35,8 @@ namespace tape {
namespace
utils
{
/**
* A smart
FILE
pointer that owns a
basic
FILE pointer. When the smart
FILE
*
pointer goes out
of scope, it will close the FILE pointer it owns.
* A smart pointer that owns a FILE pointer. When the smart
pointer goes out
* of scope, it will
f
close the FILE pointer it owns.
*/
class
SmartFILEPtr
{
...
...
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