SpiecsEngine
 
Loading...
Searching...
No Matches
Poller.cpp
Go to the documentation of this file.
1/**
2* @file Poller.cpp.
3* @brief The Poller Class Implementation.
4* @author Spices & Muduo.
5*/
6
7#include "Pchheader.h"
8#include "Poller.h"
9#include "Network/Net/Channel.h"
10#include "EPollPoller.h"
11
12namespace Spices {
13
14namespace Net {
15
16 bool Poller::HasChannel(Channel* channel) const
17 {
19
20 auto it = m_Channels.find(channel->Fd());
21
22 return it != m_Channels.end() && it->second == channel;
23 }
24
25 std::shared_ptr<Poller> Poller::DefaultPoller(EventLoop* loop)
26 {
27 return std::make_shared<EPollPoller>(loop);
28 }
29
30}
31
32}
#define SPICES_PROFILE_ZONE
Wrapper of SOCKET'S Event.
Definition Channel.h:27
Wrapper of Poller and wakeup socket to acceptor(SubLoop).
Definition EventLoop.h:28
static std::shared_ptr< Poller > DefaultPoller(EventLoop *loop)
Create Default Poller.
Definition Poller.cpp:25
bool HasChannel(Channel *channel) const
Determine if channel is in ChannelMap.
Definition Poller.cpp:16
Inherit from this and Implement Specific Poller.
Definition Poller.h:25