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
b7a98920
Commit
b7a98920
authored
15 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Improved comments as we are re-reading them to help repair the mighunter.
parent
398063b0
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
castor/tape/utils/SmartFILEPtr.hpp
+74
-75
74 additions, 75 deletions
castor/tape/utils/SmartFILEPtr.hpp
with
74 additions
and
75 deletions
castor/tape/utils/SmartFILEPtr.hpp
+
74
−
75
View file @
b7a98920
...
...
@@ -34,83 +34,82 @@ namespace castor {
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.
*/
class
SmartFILEPtr
{
public:
/**
*
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.
*
Constructor.
*
*/
class
SmartFILEPtr
{
public:
/**
* Constructor.
*
*/
SmartFILEPtr
();
/**
* Constructor.
*
* @param file The FILE pointer to be owned by the smart FILE pointer.
*/
SmartFILEPtr
(
FILE
*
const
file
);
/**
* Take ownership of the specified FILE pointer, closing the previously
* owned FILE pointer if there is one and it is not the same as the one
* specified.
*
* @param file The FILE pointer to be owned, defaults to NULL if not
* specified, where NULL means this SmartFILEPtr does not own
* anything.
*/
void
reset
(
FILE
*
const
file
)
throw
();
/**
* SmartFILEPtr assignment operator.
*
* This function does the following:
* <ul>
* <li> Calls release on the previous owner (obj);
* <li> Closes the FILE pointer of this object if it already owns one.
* <li> Makes this object the owner of the FILE pointer released from the
* previous owner (obj).
* </ul>
*/
SmartFILEPtr
&
operator
=
(
SmartFILEPtr
&
obj
)
throw
();
/**
* Destructor.
*
* Closes the owned FILE pointer if there is one.
*/
~
SmartFILEPtr
();
/**
* Returns the owned FILE pointer or NULL if this smartFILEPtr does not own
* FILE pointer.
*
* @return The owned FILE pointer.
*/
FILE
*
get
()
throw
();
/**
* Releases the owned FILE pointer.
*
* @return The released FILE pointer.
*/
FILE
*
release
()
throw
(
castor
::
exception
::
Exception
);
private:
/**
* The owned FILE pointer. A value of NULL means this SmartFILEPtr does
* not own anything.
*/
FILE
*
m_file
;
};
SmartFILEPtr
();
/**
* Constructor.
*
* @param file The FILE pointer to be owned by the smart pointer.
*/
SmartFILEPtr
(
FILE
*
const
file
);
/**
* Take ownership of the specified FILE pointer, closing the previously
* owned FILE pointer if there is one and it is not the same as the one
* specified.
*
* @param file The FILE pointer to be owned, defaults to NULL if not
* specified, where NULL means this smart pointer will not own a
* pointer after the reset() method returns.
*/
void
reset
(
FILE
*
const
file
)
throw
();
/**
* SmartFILEPtr assignment operator.
*
* This function does the following:
* <ul>
* <li> Calls release on the previous owner (obj);
* <li> Closes the FILE pointer of this object if it already owns one.
* <li> Makes this object the owner of the FILE pointer released from the
* previous owner (obj).
* </ul>
*/
SmartFILEPtr
&
operator
=
(
SmartFILEPtr
&
obj
)
throw
();
/**
* Destructor.
*
* Closes the owned FILE pointer if there is one.
*/
~
SmartFILEPtr
();
/**
* Returns the owned pointer or NULL if this smart pointer does not own one.
*
* @return The owned FILE pointer.
*/
FILE
*
get
()
throw
();
/**
* Releases the owned FILE pointer.
*
* @return The released FILE pointer.
*/
FILE
*
release
()
throw
(
castor
::
exception
::
Exception
);
private:
/**
* The owned pointer. A value of NULL means this smart pointer does not own
* a pointer.
*/
FILE
*
m_file
;
};
// class SmartFILEPtr
}
// namespace utils
}
// namespace tape
...
...
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