conflicts fixed

This commit is contained in:
Samy Ben Tayeb 2025-05-20 17:24:42 +02:00
parent e5e1afae50
commit 8f1d0b3e8a
6 changed files with 21 additions and 88 deletions

View file

@ -1,3 +1,15 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PollManager.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/19 19:15:13 by omoudni #+# #+# */
/* Updated: 2025/05/20 17:22:59 by sben-tay ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <map>

View file

@ -1,14 +1,14 @@
/******************************************************************************/
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* core.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* By: sben-tay <sben-tay@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/12 14:16:03 by rparodi #+# #+# */
/* Updated: 2025/05/19 20:15:14 by omoudni ### ########.fr */
/* Updated: 2025/05/20 17:23:41 by sben-tay ### ########.fr */
/* */
/******************************************************************************/
/* ************************************************************************** */
#pragma once
@ -30,7 +30,7 @@ enum e_state {
};
#include "pollManager.hpp"
#include "PollManager.hpp"
#include "color.hpp"
#include "server.hpp"
#include "parser.hpp"

View file

@ -1,30 +0,0 @@
/******************************************************************************/
/* */
/* ::: :::::::: */
/* pollManager.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/19 19:15:13 by omoudni #+# #+# */
/* Updated: 2025/05/19 19:25:45 by omoudni ### ########.fr */
/* */
/******************************************************************************/
#pragma once
#include <vector>
#include <poll.h>
#include <map>
class PollManager {
private:
std::vector<struct pollfd> _fds;
std::map<int, short> _fd_events; // fd -> event
public:
PollManager();
void addFd(int fd, short events);
void removeFd(int fd);
void updateFd(int fd, short events);
int pollEvents(int timeout = -1);
const std::vector<struct pollfd>& getFds() const;
};