diff options
author | hugues <hugues@0f7e0d06-a6f9-0310-a55f-d5f984f55e4c> | 2006-03-25 15:07:51 +0000 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-03-18 10:06:55 +0100 |
commit | 56cc59cf44ec64440ba4d1c0d005196195c758e6 (patch) | |
tree | 0e4bc431438a05c2e32b8703a8c79dcbf26a7cbf /trunk/glagen/algo_distribue/network/data/Data_exemple.hh | |
parent | d49be924baa2759aefa5b5311a35adf50db48e12 (diff) |
git-svn-id: file:///usr/local/opt/svn/repos/glagen@12 0f7e0d06-a6f9-0310-a55f-d5f984f55e4c
Diffstat (limited to 'trunk/glagen/algo_distribue/network/data/Data_exemple.hh')
-rw-r--r-- | trunk/glagen/algo_distribue/network/data/Data_exemple.hh | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/trunk/glagen/algo_distribue/network/data/Data_exemple.hh b/trunk/glagen/algo_distribue/network/data/Data_exemple.hh deleted file mode 100644 index ca1291b..0000000 --- a/trunk/glagen/algo_distribue/network/data/Data_exemple.hh +++ /dev/null @@ -1,66 +0,0 @@ -// Classe Data_exemple - -// Un exemple sur un point de coordonnees 3D - -#ifndef DATA_EXEMPLE_HH_ -# define DATA_EXEMPLE_HH_ - -#include <iostream> -#include <unistd.h> // Pour write/read - -#include <errno.h> - -class Data_exemple -{ -public: - Data_exemple() : _x(0), _y(0), _z(0) {}; - Data_exemple(int x, int y, int z) : _x(x), _y(y), _z(z) {}; - - void write_data(const int& fd) const - { - std::cout << "Donnees envoyes au serveur" << std::endl; - std::cout << _x << std::endl; - std::cout << _y << std::endl; - std::cout << _z << std::endl; - write(fd, &_x, sizeof(int)); - write(fd, &_y, sizeof(int)); - write(fd, &_z, sizeof(int)); - } - - void read_data(const int& fd) - { - do - { - errno = 0; - read(fd, &_x, sizeof(int)); - } - while (errno == 4); - - do - { - errno = 0; - read(fd, &_y, sizeof(int)); - } - while (errno == 4); - - do - { - errno = 0; - read(fd, &_z, sizeof(int)); - } - while (errno == 4); - - std::cout << "Reception message sur le file descriptor :" << fd - << std::endl; - std::cout << _x << std::endl; - std::cout << _y << std::endl; - std::cout << _z << std::endl; - } - -private: - int _x; - int _y; - int _z; -}; - -#endif // DATA_EXEMPLE |