source: flair-src/trunk/lib/FlairCore/src/unexported/ui_com.h@ 2

Last change on this file since 2 was 2, checked in by Sanahuja Guillaume, 8 years ago

flaircore

File size: 2.0 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2011/05/01
6// filename: ui_com.h
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: classe permettant la lecture et l'ecriture RT sur socket UDT
14//
15//
16/*********************************************************************/
17
18#ifndef UI_COM_H
19#define UI_COM_H
20
21#include "Thread.h"
22#include <udt.h>
23#ifdef __XENO__
24#include <native/pipe.h>
25#endif
26
27namespace flair
28{
29 namespace core
30 {
31 class Mutex;
32 class Object;
33 }
34 namespace gui
35 {
36 class SendData;
37 }
38}
39
40class ui_com: public flair::core::Thread
41{
42 public:
43 ui_com(const flair::core::Object *parent,UDTSOCKET sock);
44 ~ui_com();
45 void Send(char* buf,ssize_t size);
46 ssize_t Receive(char* buf,ssize_t buf_size);
47 void AddSendData(const flair::gui::SendData *obj);
48 void UpdateSendData(const flair::gui::SendData *obj);
49 void RemoveSendData(const flair::gui::SendData *obj);
50 void UpdateDataToSendSize(void);
51 void Block(void);
52 void UnBlock(void);
53 bool ConnectionLost(void);
54
55 private:
56 ssize_t send_size;
57 char *send_buffer;
58 std::vector<const flair::gui::SendData*> data_to_send;
59 std::vector<flair::core::Time> resume_time;
60 flair::core::Mutex *send_mutex;
61 UDTSOCKET socket_fd;
62 bool connection_lost;
63 void Run(void);
64 void SendDatas(void);
65 static int compressBuffer(char *in, ssize_t in_size,char **out,ssize_t *out_size, int level);
66 static int uncompressBuffer(unsigned char *in, ssize_t in_size,unsigned char **out,ssize_t *out_size);
67#ifdef __XENO__
68 bool is_running;
69 static void* user_thread(void * arg);
70 pthread_t thread;
71 RT_PIPE pipe;
72#endif
73
74};
75
76#endif // UI_COM_H
Note: See TracBrowser for help on using the repository browser.