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
07865d07
Commit
07865d07
authored
Feb 23, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zeroconf/avahi/Poll: move to namespace Avahi
parent
1ac16516
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
ZeroconfAvahi.cxx
src/zeroconf/ZeroconfAvahi.cxx
+2
-2
Poll.cxx
src/zeroconf/avahi/Poll.cxx
+10
-5
Poll.hxx
src/zeroconf/avahi/Poll.hxx
+8
-4
No files found.
src/zeroconf/ZeroconfAvahi.cxx
View file @
07865d07
...
...
@@ -36,7 +36,7 @@
static
constexpr
Domain
avahi_domain
(
"avahi"
);
static
char
*
avahi_name
;
static
MyAvahi
Poll
*
avahi_poll
;
static
Avahi
::
Poll
*
avahi_poll
;
static
AvahiClient
*
avahi_client
;
static
AvahiEntryGroup
*
avahi_group
;
...
...
@@ -241,7 +241,7 @@ AvahiInit(EventLoop &loop, const char *serviceName)
avahi_name
=
avahi_strdup
(
serviceName
);
avahi_poll
=
new
MyAvahi
Poll
(
loop
);
avahi_poll
=
new
Avahi
::
Poll
(
loop
);
int
error
;
avahi_client
=
avahi_client_new
(
avahi_poll
,
AVAHI_CLIENT_NO_FAIL
,
...
...
src/zeroconf/avahi/Poll.cxx
View file @
07865d07
...
...
@@ -39,6 +39,7 @@ ToAvahiWatchEvent(unsigned e) noexcept
}
struct
AvahiWatch
final
{
private
:
SocketEvent
event
;
const
AvahiWatchCallback
callback
;
...
...
@@ -109,7 +110,9 @@ private:
}
};
MyAvahiPoll
::
MyAvahiPoll
(
EventLoop
&
_loop
)
noexcept
namespace
Avahi
{
Poll
::
Poll
(
EventLoop
&
_loop
)
noexcept
:
event_loop
(
_loop
)
{
watch_new
=
WatchNew
;
...
...
@@ -122,20 +125,22 @@ MyAvahiPoll::MyAvahiPoll(EventLoop &_loop) noexcept
}
AvahiWatch
*
MyAvahi
Poll
::
WatchNew
(
const
AvahiPoll
*
api
,
int
fd
,
AvahiWatchEvent
event
,
Poll
::
WatchNew
(
const
AvahiPoll
*
api
,
int
fd
,
AvahiWatchEvent
event
,
AvahiWatchCallback
callback
,
void
*
userdata
)
noexcept
{
const
MyAvahiPoll
&
poll
=
*
(
const
MyAvahi
Poll
*
)
api
;
const
Poll
&
poll
=
*
(
const
Poll
*
)
api
;
return
new
AvahiWatch
(
poll
.
event_loop
,
SocketDescriptor
(
fd
),
event
,
callback
,
userdata
);
}
AvahiTimeout
*
MyAvahi
Poll
::
TimeoutNew
(
const
AvahiPoll
*
api
,
const
struct
timeval
*
tv
,
Poll
::
TimeoutNew
(
const
AvahiPoll
*
api
,
const
struct
timeval
*
tv
,
AvahiTimeoutCallback
callback
,
void
*
userdata
)
noexcept
{
const
MyAvahiPoll
&
poll
=
*
(
const
MyAvahi
Poll
*
)
api
;
const
Poll
&
poll
=
*
(
const
Poll
*
)
api
;
return
new
AvahiTimeout
(
poll
.
event_loop
,
tv
,
callback
,
userdata
);
}
}
// namespace Avahi
src/zeroconf/avahi/Poll.hxx
View file @
07865d07
...
...
@@ -24,14 +24,16 @@
class
EventLoop
;
class
MyAvahiPoll
final
:
public
AvahiPoll
{
namespace
Avahi
{
class
Poll
final
:
public
AvahiPoll
{
EventLoop
&
event_loop
;
public
:
explicit
MyAvahi
Poll
(
EventLoop
&
_loop
)
noexcept
;
explicit
Poll
(
EventLoop
&
_loop
)
noexcept
;
MyAvahiPoll
(
const
MyAvahi
Poll
&
)
=
delete
;
MyAvahiPoll
&
operator
=
(
const
MyAvahi
Poll
&
)
=
delete
;
Poll
(
const
Poll
&
)
=
delete
;
Poll
&
operator
=
(
const
Poll
&
)
=
delete
;
EventLoop
&
GetEventLoop
()
const
noexcept
{
return
event_loop
;
...
...
@@ -49,4 +51,6 @@ private:
void
*
userdata
)
noexcept
;
};
}
// namespace Avahi
#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