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
5f9d4a02
Commit
5f9d4a02
authored
Dec 20, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client/*: add "noexcept"
parent
7094d889
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
Client.hxx
src/client/Client.hxx
+18
-18
ClientExpire.cxx
src/client/ClientExpire.cxx
+2
-2
ClientIdle.cxx
src/client/ClientIdle.cxx
+3
-3
ClientNew.cxx
src/client/ClientNew.cxx
+3
-3
ClientSubscribe.cxx
src/client/ClientSubscribe.cxx
+4
-4
No files found.
src/client/Client.hxx
View file @
5f9d4a02
...
...
@@ -97,14 +97,14 @@ public:
std
::
list
<
ClientMessage
>
messages
;
Client
(
EventLoop
&
loop
,
Partition
&
partition
,
UniqueSocketDescriptor
fd
,
int
uid
,
int
num
);
UniqueSocketDescriptor
fd
,
int
uid
,
int
num
)
noexcept
;
~
Client
()
{
~
Client
()
noexcept
{
if
(
FullyBufferedSocket
::
IsDefined
())
FullyBufferedSocket
::
Close
();
}
bool
IsConnected
()
const
{
bool
IsConnected
()
const
noexcept
{
return
FullyBufferedSocket
::
IsDefined
();
}
...
...
@@ -113,8 +113,8 @@ public:
return
!
FullyBufferedSocket
::
IsDefined
();
}
void
Close
();
void
SetExpired
();
void
Close
()
noexcept
;
void
SetExpired
()
noexcept
;
bool
Write
(
const
void
*
data
,
size_t
length
);
...
...
@@ -127,7 +127,7 @@ public:
* returns the uid of the client process, or a negative value
* if the uid is unknown
*/
int
GetUID
()
const
{
int
GetUID
()
const
noexcept
{
return
uid
;
}
...
...
@@ -135,24 +135,24 @@ public:
* Is this client running on the same machine, connected with
* a local (UNIX domain) socket?
*/
bool
IsLocal
()
const
{
bool
IsLocal
()
const
noexcept
{
return
uid
>=
0
;
}
unsigned
GetPermission
()
const
{
unsigned
GetPermission
()
const
noexcept
{
return
permission
;
}
void
SetPermission
(
unsigned
_permission
)
{
void
SetPermission
(
unsigned
_permission
)
noexcept
{
permission
=
_permission
;
}
/**
* Send "idle" response to this client.
*/
void
IdleNotify
();
void
IdleAdd
(
unsigned
flags
);
bool
IdleWait
(
unsigned
flags
);
void
IdleNotify
()
noexcept
;
void
IdleAdd
(
unsigned
flags
)
noexcept
;
bool
IdleWait
(
unsigned
flags
)
noexcept
;
enum
class
SubscribeResult
{
/** success */
...
...
@@ -173,10 +173,10 @@ public:
return
subscriptions
.
find
(
channel_name
)
!=
subscriptions
.
end
();
}
SubscribeResult
Subscribe
(
const
char
*
channel
);
bool
Unsubscribe
(
const
char
*
channel
);
void
UnsubscribeAll
();
bool
PushMessage
(
const
ClientMessage
&
msg
);
SubscribeResult
Subscribe
(
const
char
*
channel
)
noexcept
;
bool
Unsubscribe
(
const
char
*
channel
)
noexcept
;
void
UnsubscribeAll
()
noexcept
;
bool
PushMessage
(
const
ClientMessage
&
msg
)
noexcept
;
/**
* Is this client allowed to use the specified local file?
...
...
@@ -231,7 +231,7 @@ private:
void
OnSocketClosed
()
override
;
/* callback for TimerEvent */
void
OnTimeout
();
void
OnTimeout
()
noexcept
;
};
void
...
...
@@ -239,7 +239,7 @@ client_manager_init();
void
client_new
(
EventLoop
&
loop
,
Partition
&
partition
,
UniqueSocketDescriptor
fd
,
SocketAddress
address
,
int
uid
);
UniqueSocketDescriptor
fd
,
SocketAddress
address
,
int
uid
)
noexcept
;
/**
* Write a printf-like formatted string to the client.
...
...
src/client/ClientExpire.cxx
View file @
5f9d4a02
...
...
@@ -22,7 +22,7 @@
#include "Log.hxx"
void
Client
::
SetExpired
()
Client
::
SetExpired
()
noexcept
{
if
(
IsExpired
())
return
;
...
...
@@ -32,7 +32,7 @@ Client::SetExpired()
}
void
Client
::
OnTimeout
()
Client
::
OnTimeout
()
noexcept
{
if
(
!
IsExpired
())
{
assert
(
!
idle_waiting
);
...
...
src/client/ClientIdle.cxx
View file @
5f9d4a02
...
...
@@ -24,7 +24,7 @@
#include <assert.h>
void
Client
::
IdleNotify
()
Client
::
IdleNotify
()
noexcept
{
assert
(
idle_waiting
);
assert
(
idle_flags
!=
0
);
...
...
@@ -46,7 +46,7 @@ Client::IdleNotify()
}
void
Client
::
IdleAdd
(
unsigned
flags
)
Client
::
IdleAdd
(
unsigned
flags
)
noexcept
{
if
(
IsExpired
())
return
;
...
...
@@ -57,7 +57,7 @@ Client::IdleAdd(unsigned flags)
}
bool
Client
::
IdleWait
(
unsigned
flags
)
Client
::
IdleWait
(
unsigned
flags
)
noexcept
{
assert
(
!
idle_waiting
);
...
...
src/client/ClientNew.cxx
View file @
5f9d4a02
...
...
@@ -42,7 +42,7 @@
static
constexpr
char
GREETING
[]
=
"OK MPD "
PROTOCOL_VERSION
"
\n
"
;
Client
::
Client
(
EventLoop
&
_loop
,
Partition
&
_partition
,
UniqueSocketDescriptor
_fd
,
int
_uid
,
int
_num
)
UniqueSocketDescriptor
_fd
,
int
_uid
,
int
_num
)
noexcept
:
FullyBufferedSocket
(
_fd
.
Release
(),
_loop
,
16384
,
client_max_output_buffer_size
),
timeout_event
(
_loop
,
BIND_THIS_METHOD
(
OnTimeout
)),
...
...
@@ -56,7 +56,7 @@ Client::Client(EventLoop &_loop, Partition &_partition,
void
client_new
(
EventLoop
&
loop
,
Partition
&
partition
,
UniqueSocketDescriptor
fd
,
SocketAddress
address
,
int
uid
)
UniqueSocketDescriptor
fd
,
SocketAddress
address
,
int
uid
)
noexcept
{
static
unsigned
int
next_client_num
;
const
auto
remote
=
ToString
(
address
);
...
...
@@ -102,7 +102,7 @@ client_new(EventLoop &loop, Partition &partition,
}
void
Client
::
Close
()
Client
::
Close
()
noexcept
{
partition
->
instance
.
client_list
->
Remove
(
*
this
);
...
...
src/client/ClientSubscribe.cxx
View file @
5f9d4a02
...
...
@@ -25,7 +25,7 @@
#include <assert.h>
Client
::
SubscribeResult
Client
::
Subscribe
(
const
char
*
channel
)
Client
::
Subscribe
(
const
char
*
channel
)
noexcept
{
assert
(
channel
!=
nullptr
);
...
...
@@ -47,7 +47,7 @@ Client::Subscribe(const char *channel)
}
bool
Client
::
Unsubscribe
(
const
char
*
channel
)
Client
::
Unsubscribe
(
const
char
*
channel
)
noexcept
{
const
auto
i
=
subscriptions
.
find
(
channel
);
if
(
i
==
subscriptions
.
end
())
...
...
@@ -67,14 +67,14 @@ Client::Unsubscribe(const char *channel)
}
void
Client
::
UnsubscribeAll
()
Client
::
UnsubscribeAll
()
noexcept
{
subscriptions
.
clear
();
num_subscriptions
=
0
;
}
bool
Client
::
PushMessage
(
const
ClientMessage
&
msg
)
Client
::
PushMessage
(
const
ClientMessage
&
msg
)
noexcept
{
if
(
messages
.
size
()
>=
CLIENT_MAX_MESSAGES
||
!
IsSubscribed
(
msg
.
GetChannel
()))
...
...
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