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
b1233925
Commit
b1233925
authored
Jul 10, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/async: more API documentation
parent
ccbb5c3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
AsyncInputStream.hxx
src/input/AsyncInputStream.hxx
+26
-0
No files found.
src/input/AsyncInputStream.hxx
View file @
b1233925
...
@@ -78,14 +78,25 @@ public:
...
@@ -78,14 +78,25 @@ public:
size_t
Read
(
void
*
ptr
,
size_t
read_size
,
Error
&
error
)
final
;
size_t
Read
(
void
*
ptr
,
size_t
read_size
,
Error
&
error
)
final
;
protected
:
protected
:
/**
* Pass an tag from the I/O thread to the client thread.
*/
void
SetTag
(
Tag
*
_tag
);
void
SetTag
(
Tag
*
_tag
);
void
Pause
();
void
Pause
();
/**
* Declare that the underlying stream was closed. We will
* continue feeding Read() calls from the buffer until it runs
* empty.
*/
void
SetClosed
()
{
void
SetClosed
()
{
open
=
false
;
open
=
false
;
}
}
/**
* Pass an error from the I/O thread to the client thread.
*/
void
PostponeError
(
Error
&&
error
);
void
PostponeError
(
Error
&&
error
);
bool
IsBufferEmpty
()
const
{
bool
IsBufferEmpty
()
const
{
...
@@ -96,13 +107,24 @@ protected:
...
@@ -96,13 +107,24 @@ protected:
return
buffer
.
IsFull
();
return
buffer
.
IsFull
();
}
}
/**
* Determine how many bytes can be added to the buffer.
*/
gcc_pure
gcc_pure
size_t
GetBufferSpace
()
const
{
size_t
GetBufferSpace
()
const
{
return
buffer
.
GetSpace
();
return
buffer
.
GetSpace
();
}
}
/**
* Append data to the buffer. The size must fit into the
* buffer; see GetBufferSpace().
*/
void
AppendToBuffer
(
const
void
*
data
,
size_t
append_size
);
void
AppendToBuffer
(
const
void
*
data
,
size_t
append_size
);
/**
* Implement code here that will resume the stream after it
* has been paused due to full input buffer.
*/
virtual
void
DoResume
()
=
0
;
virtual
void
DoResume
()
=
0
;
/**
/**
...
@@ -116,6 +138,10 @@ protected:
...
@@ -116,6 +138,10 @@ protected:
return
seek_state
==
SeekState
::
PENDING
;
return
seek_state
==
SeekState
::
PENDING
;
}
}
/**
* Call this after seeking has finished. It will notify the
* client thread.
*/
void
SeekDone
();
void
SeekDone
();
private
:
private
:
...
...
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