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
daeb7ae9
Commit
daeb7ae9
authored
Dec 26, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/InputStream: add "noexcept"
parent
82a79565
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
33 deletions
+34
-33
IcyInputStream.cxx
src/input/IcyInputStream.cxx
+3
-3
IcyInputStream.hxx
src/input/IcyInputStream.hxx
+5
-5
Init.cxx
src/input/Init.cxx
+2
-1
Init.hxx
src/input/Init.hxx
+1
-1
InputStream.cxx
src/input/InputStream.cxx
+5
-5
InputStream.hxx
src/input/InputStream.hxx
+10
-10
ProxyInputStream.cxx
src/input/ProxyInputStream.cxx
+3
-3
ProxyInputStream.hxx
src/input/ProxyInputStream.hxx
+3
-3
RewindInputPlugin.cxx
src/input/plugins/RewindInputPlugin.cxx
+2
-2
No files found.
src/input/IcyInputStream.cxx
View file @
daeb7ae9
...
@@ -21,15 +21,15 @@
...
@@ -21,15 +21,15 @@
#include "IcyInputStream.hxx"
#include "IcyInputStream.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag.hxx"
IcyInputStream
::
IcyInputStream
(
InputStream
*
_input
)
IcyInputStream
::
IcyInputStream
(
InputStream
*
_input
)
noexcept
:
ProxyInputStream
(
_input
)
:
ProxyInputStream
(
_input
)
{
{
}
}
IcyInputStream
::~
IcyInputStream
()
=
default
;
IcyInputStream
::~
IcyInputStream
()
noexcept
=
default
;
void
void
IcyInputStream
::
Update
()
IcyInputStream
::
Update
()
noexcept
{
{
ProxyInputStream
::
Update
();
ProxyInputStream
::
Update
();
...
...
src/input/IcyInputStream.hxx
View file @
daeb7ae9
...
@@ -47,22 +47,22 @@ class IcyInputStream final : public ProxyInputStream {
...
@@ -47,22 +47,22 @@ class IcyInputStream final : public ProxyInputStream {
offset_type
override_offset
=
0
;
offset_type
override_offset
=
0
;
public
:
public
:
IcyInputStream
(
InputStream
*
_input
);
IcyInputStream
(
InputStream
*
_input
)
noexcept
;
virtual
~
IcyInputStream
();
virtual
~
IcyInputStream
()
noexcept
;
IcyInputStream
(
const
IcyInputStream
&
)
=
delete
;
IcyInputStream
(
const
IcyInputStream
&
)
=
delete
;
IcyInputStream
&
operator
=
(
const
IcyInputStream
&
)
=
delete
;
IcyInputStream
&
operator
=
(
const
IcyInputStream
&
)
=
delete
;
void
Enable
(
size_t
_data_size
)
{
void
Enable
(
size_t
_data_size
)
noexcept
{
parser
.
Start
(
_data_size
);
parser
.
Start
(
_data_size
);
}
}
bool
IsEnabled
()
const
{
bool
IsEnabled
()
const
noexcept
{
return
parser
.
IsDefined
();
return
parser
.
IsDefined
();
}
}
/* virtual methods from InputStream */
/* virtual methods from InputStream */
void
Update
()
override
;
void
Update
()
noexcept
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
size_t
Read
(
void
*
ptr
,
size_t
size
)
override
;
size_t
Read
(
void
*
ptr
,
size_t
size
)
override
;
};
};
...
...
src/input/Init.cxx
View file @
daeb7ae9
...
@@ -69,7 +69,8 @@ input_stream_global_init(EventLoop &event_loop)
...
@@ -69,7 +69,8 @@ input_stream_global_init(EventLoop &event_loop)
}
}
}
}
void
input_stream_global_finish
(
void
)
void
input_stream_global_finish
()
noexcept
{
{
input_plugins_for_each_enabled
(
plugin
)
input_plugins_for_each_enabled
(
plugin
)
if
(
plugin
->
finish
!=
nullptr
)
if
(
plugin
->
finish
!=
nullptr
)
...
...
src/input/Init.hxx
View file @
daeb7ae9
...
@@ -32,6 +32,6 @@ input_stream_global_init(EventLoop &event_loop);
...
@@ -32,6 +32,6 @@ input_stream_global_init(EventLoop &event_loop);
* Deinitializes this library and all #InputStream implementations.
* Deinitializes this library and all #InputStream implementations.
*/
*/
void
void
input_stream_global_finish
();
input_stream_global_finish
()
noexcept
;
#endif
#endif
src/input/InputStream.cxx
View file @
daeb7ae9
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <assert.h>
#include <assert.h>
InputStream
::~
InputStream
()
InputStream
::~
InputStream
()
noexcept
{
{
}
}
...
@@ -37,12 +37,12 @@ InputStream::Check()
...
@@ -37,12 +37,12 @@ InputStream::Check()
}
}
void
void
InputStream
::
Update
()
InputStream
::
Update
()
noexcept
{
{
}
}
void
void
InputStream
::
SetReady
()
InputStream
::
SetReady
()
noexcept
{
{
assert
(
!
ready
);
assert
(
!
ready
);
...
@@ -51,7 +51,7 @@ InputStream::SetReady()
...
@@ -51,7 +51,7 @@ InputStream::SetReady()
}
}
void
void
InputStream
::
WaitReady
()
InputStream
::
WaitReady
()
noexcept
{
{
while
(
true
)
{
while
(
true
)
{
Update
();
Update
();
...
@@ -63,7 +63,7 @@ InputStream::WaitReady()
...
@@ -63,7 +63,7 @@ InputStream::WaitReady()
}
}
void
void
InputStream
::
LockWaitReady
()
InputStream
::
LockWaitReady
()
noexcept
{
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
WaitReady
();
WaitReady
();
...
...
src/input/InputStream.hxx
View file @
daeb7ae9
...
@@ -107,7 +107,7 @@ public:
...
@@ -107,7 +107,7 @@ public:
*
*
* The caller must not lock the mutex.
* The caller must not lock the mutex.
*/
*/
virtual
~
InputStream
();
virtual
~
InputStream
()
noexcept
;
/**
/**
* Opens a new input stream. You may not access it until the "ready"
* Opens a new input stream. You may not access it until the "ready"
...
@@ -138,15 +138,15 @@ public:
...
@@ -138,15 +138,15 @@ public:
*
*
* No lock necessary for this method.
* No lock necessary for this method.
*/
*/
const
char
*
GetURI
()
const
{
const
char
*
GetURI
()
const
noexcept
{
return
uri
.
c_str
();
return
uri
.
c_str
();
}
}
void
Lock
()
{
void
Lock
()
noexcept
{
mutex
.
lock
();
mutex
.
lock
();
}
}
void
Unlock
()
{
void
Unlock
()
noexcept
{
mutex
.
unlock
();
mutex
.
unlock
();
}
}
...
@@ -160,9 +160,9 @@ public:
...
@@ -160,9 +160,9 @@ public:
* Update the public attributes. Call before accessing attributes
* Update the public attributes. Call before accessing attributes
* such as "ready" or "offset".
* such as "ready" or "offset".
*/
*/
virtual
void
Update
();
virtual
void
Update
()
noexcept
;
void
SetReady
();
void
SetReady
()
noexcept
;
/**
/**
* Return whether the stream is ready for reading and whether
* Return whether the stream is ready for reading and whether
...
@@ -174,13 +174,13 @@ public:
...
@@ -174,13 +174,13 @@ public:
return
ready
;
return
ready
;
}
}
void
WaitReady
();
void
WaitReady
()
noexcept
;
/**
/**
* Wrapper for WaitReady() which locks and unlocks the mutex;
* Wrapper for WaitReady() which locks and unlocks the mutex;
* the caller must not be holding it already.
* the caller must not be holding it already.
*/
*/
void
LockWaitReady
();
void
LockWaitReady
()
noexcept
;
gcc_pure
gcc_pure
bool
HasMimeType
()
const
noexcept
{
bool
HasMimeType
()
const
noexcept
{
...
@@ -201,13 +201,13 @@ public:
...
@@ -201,13 +201,13 @@ public:
}
}
gcc_nonnull_all
gcc_nonnull_all
void
SetMimeType
(
const
char
*
_mime
)
{
void
SetMimeType
(
const
char
*
_mime
)
noexcept
{
assert
(
!
ready
);
assert
(
!
ready
);
mime
=
_mime
;
mime
=
_mime
;
}
}
void
SetMimeType
(
std
::
string
&&
_mime
)
{
void
SetMimeType
(
std
::
string
&&
_mime
)
noexcept
{
assert
(
!
ready
);
assert
(
!
ready
);
mime
=
std
::
move
(
_mime
);
mime
=
std
::
move
(
_mime
);
...
...
src/input/ProxyInputStream.cxx
View file @
daeb7ae9
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
#include "ProxyInputStream.hxx"
#include "ProxyInputStream.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag.hxx"
ProxyInputStream
::
ProxyInputStream
(
InputStream
*
_input
)
ProxyInputStream
::
ProxyInputStream
(
InputStream
*
_input
)
noexcept
:
InputStream
(
_input
->
GetURI
(),
_input
->
mutex
,
_input
->
cond
),
:
InputStream
(
_input
->
GetURI
(),
_input
->
mutex
,
_input
->
cond
),
input
(
*
_input
)
{}
input
(
*
_input
)
{}
ProxyInputStream
::~
ProxyInputStream
()
ProxyInputStream
::~
ProxyInputStream
()
noexcept
{
{
delete
&
input
;
delete
&
input
;
}
}
...
@@ -57,7 +57,7 @@ ProxyInputStream::Check()
...
@@ -57,7 +57,7 @@ ProxyInputStream::Check()
}
}
void
void
ProxyInputStream
::
Update
()
ProxyInputStream
::
Update
()
noexcept
{
{
input
.
Update
();
input
.
Update
();
CopyAttributes
();
CopyAttributes
();
...
...
src/input/ProxyInputStream.hxx
View file @
daeb7ae9
...
@@ -35,16 +35,16 @@ protected:
...
@@ -35,16 +35,16 @@ protected:
public
:
public
:
gcc_nonnull_all
gcc_nonnull_all
ProxyInputStream
(
InputStream
*
_input
);
ProxyInputStream
(
InputStream
*
_input
)
noexcept
;
virtual
~
ProxyInputStream
();
virtual
~
ProxyInputStream
()
noexcept
;
ProxyInputStream
(
const
ProxyInputStream
&
)
=
delete
;
ProxyInputStream
(
const
ProxyInputStream
&
)
=
delete
;
ProxyInputStream
&
operator
=
(
const
ProxyInputStream
&
)
=
delete
;
ProxyInputStream
&
operator
=
(
const
ProxyInputStream
&
)
=
delete
;
/* virtual methods from InputStream */
/* virtual methods from InputStream */
void
Check
()
override
;
void
Check
()
override
;
void
Update
()
override
;
void
Update
()
noexcept
override
;
void
Seek
(
offset_type
new_offset
)
override
;
void
Seek
(
offset_type
new_offset
)
override
;
bool
IsEOF
()
noexcept
override
;
bool
IsEOF
()
noexcept
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
...
...
src/input/plugins/RewindInputPlugin.cxx
View file @
daeb7ae9
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
/* virtual methods from InputStream */
/* virtual methods from InputStream */
void
Update
()
override
{
void
Update
()
noexcept
override
{
if
(
!
ReadingFromBuffer
())
if
(
!
ReadingFromBuffer
())
ProxyInputStream
::
Update
();
ProxyInputStream
::
Update
();
}
}
...
@@ -70,7 +70,7 @@ private:
...
@@ -70,7 +70,7 @@ private:
* Are we currently reading from the buffer, and does the
* Are we currently reading from the buffer, and does the
* buffer contain more data for the next read operation?
* buffer contain more data for the next read operation?
*/
*/
bool
ReadingFromBuffer
()
const
{
bool
ReadingFromBuffer
()
const
noexcept
{
return
tail
>
0
&&
offset
<
input
.
GetOffset
();
return
tail
>
0
&&
offset
<
input
.
GetOffset
();
}
}
};
};
...
...
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