IRC SERVER
The goal of this project is to make you write your own IRC server.
Server Class Reference

#include <Server.hpp>

Public Types

enum  Status { OFFLINE, ONLINE, CLOSED }
 

Public Member Functions

 Server (std::string host, std::string port, std::string password)
 Here we init the server instance. More...
 
 ~Server ()
 
void close_server ()
 
void run ()
 
bool is_running (void)
 
bool hasPassword (void)
 
const std::string getPassword (void)
 
const std::string getServerName (void)
 
std::vector< Client * > getRelatedClients (Client *client)
 
std::map< std::string, Channel * > getRelatedChannels (Client *client)
 
ClientgetClient (std::string const &name)
 
void deleteClient (int fd)
 
size_t getClientIndex (std::string &name)
 
ChannelgetChannel (std::string &name)
 
std::vector< Channel * > getChannels (void)
 
ChannelcreateChannel (std::string &name, std::string &password)
 
CommandgetCommand (std::string &name)
 

Public Attributes

std::map< size_t, Client * > _clients
 
std::map< std::string, Command * > _commands
 
std::map< std::string, Channel * > _channels
 
enum Server::Status _status
 
std::vector< pollfd > _pfds
 
int _fd
 

Member Enumeration Documentation

◆ Status

Enumerator
OFFLINE 
ONLINE 
CLOSED 

Constructor & Destructor Documentation

◆ Server()

Server::Server ( std::string  host,
std::string  port,
std::string  password 
)

Here we init the server instance.

Parameters
portThe port to listen to
passwordThe password to use

◆ ~Server()

Server::~Server ( )

Member Function Documentation

◆ close_server()

void Server::close_server ( )

◆ createChannel()

Channel* Server::createChannel ( std::string &  name,
std::string &  password 
)
inline
Here is the caller graph for this function:

◆ deleteClient()

void Server::deleteClient ( int  fd)
inline
Here is the caller graph for this function:

◆ getChannel()

Channel* Server::getChannel ( std::string &  name)
inline
Here is the caller graph for this function:

◆ getChannels()

std::vector<Channel *> Server::getChannels ( void  )
inline
Here is the caller graph for this function:

◆ getClient()

Client* Server::getClient ( std::string const &  name)
inline
Here is the caller graph for this function:

◆ getClientIndex()

size_t Server::getClientIndex ( std::string &  name)
inline

◆ getCommand()

Command* Server::getCommand ( std::string &  name)
inline

◆ getPassword()

const std::string Server::getPassword ( void  )
inline
Here is the caller graph for this function:

◆ getRelatedChannels()

std::map<std::string, Channel *> Server::getRelatedChannels ( Client client)
inline
Here is the caller graph for this function:

◆ getRelatedClients()

std::vector<Client *> Server::getRelatedClients ( Client client)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getServerName()

const std::string Server::getServerName ( void  )
inline

◆ hasPassword()

bool Server::hasPassword ( void  )
inline

◆ is_running()

bool Server::is_running ( void  )
inline

◆ run()

void Server::run ( )

Member Data Documentation

◆ _channels

std::map<std::string, Channel *> Server::_channels

◆ _clients

std::map<size_t, Client *> Server::_clients

◆ _commands

std::map<std::string, Command *> Server::_commands

◆ _fd

int Server::_fd

◆ _pfds

std::vector<pollfd> Server::_pfds

◆ _status

enum Server::Status Server::_status

The documentation for this class was generated from the following files: