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
5f34508a
Commit
5f34508a
authored
Feb 24, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zeroconf/Glue: move code to the ZeroconfHelper constructor
parent
2d8ecd56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
Glue.cxx
src/zeroconf/Glue.cxx
+1
-9
Helper.cxx
src/zeroconf/Helper.cxx
+6
-0
Helper.hxx
src/zeroconf/Helper.hxx
+3
-3
No files found.
src/zeroconf/Glue.cxx
View file @
5f34508a
...
...
@@ -84,13 +84,5 @@ ZeroconfInit(const ConfigData &config, [[maybe_unused]] EventLoop &loop)
}
}
#ifdef HAVE_AVAHI
return
std
::
make_unique
<
ZeroconfHelper
>
(
AvahiInit
(
loop
,
serviceName
,
listen_port
));
#endif
#ifdef HAVE_BONJOUR
return
std
::
make_unique
<
ZeroconfHelper
>
(
BonjourInit
(
loop
,
serviceName
,
listen_port
));
#endif
return
std
::
make_unique
<
ZeroconfHelper
>
(
loop
,
serviceName
,
listen_port
);
}
src/zeroconf/Helper.cxx
View file @
5f34508a
...
...
@@ -21,10 +21,16 @@
#ifdef HAVE_AVAHI
#include "avahi/Helper.hxx"
#define CreateHelper AvahiInit
#endif
#ifdef HAVE_BONJOUR
#include "Bonjour.hxx"
#define CreateHelper BonjourInit
#endif
ZeroconfHelper
::
ZeroconfHelper
(
EventLoop
&
event_loop
,
const
char
*
name
,
unsigned
port
)
:
helper
(
CreateHelper
(
event_loop
,
name
,
port
))
{}
ZeroconfHelper
::~
ZeroconfHelper
()
noexcept
=
default
;
src/zeroconf/Helper.hxx
View file @
5f34508a
...
...
@@ -24,6 +24,7 @@
#include <memory>
class
EventLoop
;
class
AvahiHelper
;
class
BonjourHelper
;
...
...
@@ -37,9 +38,8 @@ class ZeroconfHelper final {
#endif
public
:
template
<
typename
T
>
ZeroconfHelper
(
T
&&
_helper
)
noexcept
:
helper
(
std
::
forward
<
T
>
(
_helper
))
{}
ZeroconfHelper
(
EventLoop
&
event_loop
,
const
char
*
name
,
unsigned
port
);
~
ZeroconfHelper
()
noexcept
;
};
...
...
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