Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5e512763
Commit
5e512763
authored
Aug 20, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/UniqueFileDescriptor: make the base class public
parent
a65d02d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
55 deletions
+5
-55
UniqueFileDescriptor.hxx
src/system/UniqueFileDescriptor.hxx
+5
-55
No files found.
src/system/UniqueFileDescriptor.hxx
View file @
5e512763
...
...
@@ -34,10 +34,12 @@
#include <utility>
#include <assert.h>
/**
* An OO wrapper for a UNIX file descriptor.
*/
class
UniqueFileDescriptor
:
p
rotected
FileDescriptor
{
class
UniqueFileDescriptor
:
p
ublic
FileDescriptor
{
public
:
UniqueFileDescriptor
()
noexcept
:
FileDescriptor
(
FileDescriptor
::
Undefined
())
{}
...
...
@@ -51,6 +53,8 @@ public:
explicit
UniqueFileDescriptor
(
FileDescriptor
_fd
)
noexcept
:
FileDescriptor
(
_fd
)
{}
UniqueFileDescriptor
(
const
UniqueFileDescriptor
&
)
=
delete
;
UniqueFileDescriptor
(
UniqueFileDescriptor
&&
other
)
noexcept
:
FileDescriptor
(
other
.
Steal
())
{}
...
...
@@ -63,20 +67,6 @@ public:
return
*
this
;
}
/**
* Convert this object to its #FileDescriptor base type.
*/
const
FileDescriptor
&
ToFileDescriptor
()
const
noexcept
{
return
*
this
;
}
using
FileDescriptor
::
IsDefined
;
#ifndef _WIN32
using
FileDescriptor
::
IsValid
;
#endif
using
FileDescriptor
::
Get
;
using
FileDescriptor
::
Steal
;
protected
:
void
Set
(
int
_fd
)
noexcept
{
assert
(
!
IsDefined
());
...
...
@@ -86,57 +76,17 @@ protected:
}
public
:
using
FileDescriptor
::
Open
;
using
FileDescriptor
::
OpenReadOnly
;
#ifndef _WIN32
using
FileDescriptor
::
OpenNonBlocking
;
static
bool
CreatePipe
(
UniqueFileDescriptor
&
r
,
UniqueFileDescriptor
&
w
)
noexcept
{
return
FileDescriptor
::
CreatePipe
(
r
,
w
);
}
using
FileDescriptor
::
SetNonBlocking
;
using
FileDescriptor
::
SetBlocking
;
using
FileDescriptor
::
Duplicate
;
using
FileDescriptor
::
CheckDuplicate
;
static
bool
CreatePipe
(
FileDescriptor
&
r
,
FileDescriptor
&
w
)
noexcept
;
#endif
using
FileDescriptor
::
EnableCloseOnExec
;
using
FileDescriptor
::
DisableCloseOnExec
;
#ifdef USE_EVENTFD
using
FileDescriptor
::
CreateEventFD
;
#endif
#ifdef USE_SIGNALFD
using
FileDescriptor
::
CreateSignalFD
;
#endif
#ifdef HAVE_INOTIFY_INIT
using
FileDescriptor
::
CreateInotify
;
#endif
bool
Close
()
noexcept
{
return
IsDefined
()
&&
FileDescriptor
::
Close
();
}
using
FileDescriptor
::
Rewind
;
using
FileDescriptor
::
Seek
;
using
FileDescriptor
::
Skip
;
using
FileDescriptor
::
Tell
;
using
FileDescriptor
::
GetSize
;
using
FileDescriptor
::
Read
;
using
FileDescriptor
::
Write
;
#ifndef _WIN32
using
FileDescriptor
::
Poll
;
using
FileDescriptor
::
WaitReadable
;
using
FileDescriptor
::
WaitWritable
;
using
FileDescriptor
::
IsReadyForWriting
;
#endif
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment