ClienteTFG/conexion.h
2020-06-02 15:21:59 +02:00

41 lines
843 B
C++

#ifndef CONEXION_H
#define CONEXION_H
#include "config_reader.h"
class conexion
{
public:
/**
* @brief conexion
* Create a conexion
* @param conf Config file to give the parameters of conexion
*/
conexion(config_reader &conf);
/**
* @brief read_string
* Read a string in the socket
* @param input String readed
* @param size Length to read
* @return Size of bytes readed
*/
virtual ssize_t read_string(std::string &input, int size);
/**
* @brief write_string
* Write a sitring in the socket
* @param output String to send
* @return bytes sended
*/
virtual ssize_t write_string(std::string output);
/**
* @brief get_conf
* Get the config object
* @return Config object
*/
config_reader* get_conf();
protected:
config_reader *config;
int fd;
};
#endif // CONEXION_H