From 80e0b302ab4b98d568c078d89d36345b5888b574 Mon Sep 17 00:00:00 2001 From: Bartosz Kostrzewa Date: Fri, 12 Nov 2010 16:21:49 +0100 Subject: [PATCH] removing directory completely now --- frame-server/Buffer.cpp | 33 --------------- frame-server/Buffer.h | 22 ---------- frame-server/Buffers.cpp | 43 ------------------- frame-server/Buffers.h | 26 ------------ frame-server/defines.h | 21 ---------- frame-server/maketest | 2 - frame-server/test | Bin 18907 -> 0 bytes frame-server/test.cpp | 87 --------------------------------------- 8 files changed, 234 deletions(-) delete mode 100644 frame-server/Buffer.cpp delete mode 100644 frame-server/Buffer.h delete mode 100644 frame-server/Buffers.cpp delete mode 100644 frame-server/Buffers.h delete mode 100644 frame-server/defines.h delete mode 100755 frame-server/maketest delete mode 100755 frame-server/test delete mode 100644 frame-server/test.cpp diff --git a/frame-server/Buffer.cpp b/frame-server/Buffer.cpp deleted file mode 100644 index 1431a6e..0000000 --- a/frame-server/Buffer.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "Buffer.h" - -Buffer::Buffer( int _id ) -{ - id = _id; - - // allocate memory -} - -Buffer::~Buffer() -{ - // deallocate memory -} - -void Buffer::set(frame_t data) -{ - { - Glib::Mutex::Lock lock(mutex_); - frame = data; - } -} - -frame_t Buffer::get() -{ - Glib::Mutex::Lock lock(mutex_); - return frame; -} - -int Buffer::get_id() -{ - Glib::Mutex::Lock lock(mutex_); - return id; -} diff --git a/frame-server/Buffer.h b/frame-server/Buffer.h deleted file mode 100644 index e71e02b..0000000 --- a/frame-server/Buffer.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __BUFFER_H_ -#define __BUFFER_H_ -#include -#include "defines.h" - -class Buffer : public sigc::trackable -{ - public: - Buffer(int _id); - ~Buffer(); - - void set(frame_t); - frame_t get(); - int get_id(); - - private: - int id; - frame_t frame; - - Glib::Mutex mutex_; -}; -#endif \ No newline at end of file diff --git a/frame-server/Buffers.cpp b/frame-server/Buffers.cpp deleted file mode 100644 index 4daea1a..0000000 --- a/frame-server/Buffers.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "Buffers.h" - -Buffers::Buffers() -{ - id = 0; -} - -Buffers::Buffers(int _bufnum) -{ - id = 0; - for( int i = 0; i < _bufnum; i++) - add(); -} - -Buffers::~Buffers() -{ - Glib::Mutex::Lock lock(mutex_); - buffers.clear(); -} - -Buffer* Buffers::get(int index) -{ - Glib::Mutex::Lock lock(mutex_); - return buffers[index]; -} - -void Buffers::add() -{ - Glib::Mutex::Lock lock(mutex_); - id += 1; - buffers.push_back( new Buffer(id) ); -} - -void Buffers::remove(int _id) -{ - Glib::Mutex::Lock lock(mutex_); - int size = buffers.size(); - for( int i = 0; i < size; i++ ) - { - if( buffers[i]->get_id() == _id ) - buffers.erase( buffers.begin()+i ); - } -} \ No newline at end of file diff --git a/frame-server/Buffers.h b/frame-server/Buffers.h deleted file mode 100644 index 9121dd5..0000000 --- a/frame-server/Buffers.h +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -#include "defines.h" -#include "Buffer.h" - -using namespace std; - -class Buffers : public sigc::trackable -{ - public: - Buffers(); - Buffers(int); - - ~Buffers(); - - void add(); - void remove(int); - - Buffer* get(int); - - private: - vector buffers; - int id; - Glib::Mutex mutex_; -}; diff --git a/frame-server/defines.h b/frame-server/defines.h deleted file mode 100644 index 9a32e05..0000000 --- a/frame-server/defines.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __DEFINES_H_ -#define __DEFINES_H_ -#define BUFLEN 1024 -#define WIDTH 12 -#define HEIGHT 7 -#define SEGWIDTH 12 - -// not used for simplicity -//#define SEGHEIGHT 1 - -struct segment_t { - char r,g,b; -}; - -struct frame_t -{ - char windows[HEIGHT][WIDTH]; - segment_t segments[SEGWIDTH]; -}; - -#endif \ No newline at end of file diff --git a/frame-server/maketest b/frame-server/maketest deleted file mode 100755 index 363baeb..0000000 --- a/frame-server/maketest +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -g++ -O2 -pipe -fomit-frame-pointer `pkg-config --libs --cflags glibmm-2.4` `pkg-config --libs --cflags gthread-2.0` -o test Buffer.cpp Buffers.cpp test.cpp \ No newline at end of file diff --git a/frame-server/test b/frame-server/test deleted file mode 100755 index 36bd53b6afc6fad5224502cbb3435e26e9dca3a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18907 zcmeHPe|%KcmA^Cd28I$tfT$o*2OKP^7?O}iey)MZ1R_6-Bv1wQG09Arkt8$Dj~Em* zb_g&XXE$1F-PT%Yu^;wRU1_D3s%;Yz4Yqb0f9%O5*Le$ z#2ASquN6Fqb`)T=B40tYAl3k{xm~d_P6p0M8nR^s5CUZx56uvQk>y2>Mn6~}#KB)F zHW^XqFe2+E-3-tRdN1gVtecT^*1_ll?nB*-<-i#YTGgK-o}BX`>U)Zf@deNr4f<7} z13e`e^4EZ#uHSOh#mMpiVorm%C@9uwP+iiOtzIi-vmKN<0g+{M z5otTpe|PMzKm7W4uN;2*r)SMtaMt3t-!gSQFcCDENlZeVhBzLPHk*#fFa_}(MB4fS zMCyWOO8MsjvOelC6>+q{y3>QScUs0cq-}^}5veZ&b-GZdg!mHRS%_yNW+R@9n1{%A z*%32C7BX0;p&RSlg`TwkscIbaSeCLMd;PAhPS=aa9$fKy$B`Sa&ih63MD`ocznwkH z_2SAcm75<0%ZTs^8?Fc1>YvzfJrJLfL8pF3up@DifdCS}BBOk92EIN+-rE`U=hNh| z{=N+Q&W!SRW$?eALC?*=-^k#fogu#?gZ}3X`o0YMGa2$<%HY2|gMLp2J#9LXzM6|p zZtcKWN5~N;22H?&Y51>EJ`3ZJJ~a^>whVe6>g$bb zgdcb-<}cPqdkc)mO^A(+mlhY4a6lFbRo&DWXi~!wcPOH&LcO9{UE|&44@bNqXM;N& z_J)O8?{D(UvVqzgymb*2E@a_C=7s&6>PBR+f{_^!U&!nBjK~W`^xD_2E?I^GUtJZA zcw0&u0(F~R%|acKTN-T|HNU(_XQc}BBO!O)W_N9ax4d}NY^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;@<@Gy^{e zOG>NW9?F}hEiqCA%NGOhgZ_rS?#`g^1%CWa#r80Gsqdp1^k;$d;3v&G5##w^fv4-= z2R!}mvk6ODE94pWo|v}gQlI<`d=c=C7=K*5S^sL_kLmN#By+a#0_XY9Z8|+je%w9d zSqSn+fv4ZqHXfVnLXmJJT3?SRc~y1RT)9SFSy^4fo7Zaj2;jViR`CBrh!>$EbVE?ar!(j_ZZwNkB>thg_}zB;mUo~rr-+MQ~h zTcs2}h+!$+aHJc{>-hieZvYH`&LH#a2}3vihd%*O9VuBP#9`3R)?hJE1 z(I6cGy^!II`d1+EX@gT-PdAA16$Jy8ADKx1Ucma*MvDyAv@cl5!LNURAkzVddn)aV z7X13akebpb`SA!ta$0|B-^tM3#l>zb{;zafv07cCbz8A2KbnxCrO~#zZjba?{YxA} zzGQr?qE-ye_Qp3APW|LVSy|c#70^mUxYi3JKKlSQ^lvcG8pEd2zcw*cR8HxfQ2nLz fN((r)f_3~kL2V2Dke?c%A8OxwkgoKfSMl5a diff --git a/frame-server/test.cpp b/frame-server/test.cpp deleted file mode 100644 index fe51ad6..0000000 --- a/frame-server/test.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include - -#include "defines.h" -#include "Buffer.h" -#include "Buffers.h" - -#define NUMBUFS 10000 -#define NUMTHREADS 10 - -using namespace std; - - - -Buffers* buffers; - -void reader(void); -void writer(void); - -int main(void) -{ - Glib::thread_init(); - Glib::RefPtr Main = Glib::MainLoop::create(); - - buffers = new Buffers(NUMBUFS); - - vector readers; - vector writers; - - for(int i = 0; i < NUMTHREADS; i++) - { - readers.push_back( Glib::Thread::create( sigc::ptr_fun( &reader), false ) ); - writers.push_back( Glib::Thread::create( sigc::ptr_fun( &writer), false ) ); - } - - Main->run(); - - /*while(1) { - usleep( 10000 ); - }*/ - - return 0; -} - -void reader(void) -{ - bool quit = false; - frame_t frame; - int bufnum = 0; - while( !quit ) - { - bufnum = rand()%NUMBUFS; - frame = buffers->get(bufnum)->get(); -// cout << "read " << bufnum << endl; - usleep( rand()%250 ); - } -} - -void writer(void) -{ - frame_t frame; - bool quit = false; - int bufnum = 0; - while( !quit ) - { - bufnum = rand()%NUMBUFS; - for(int i = 0; i < 7; i++) - { - for(int j = 0; j < 12; j++) - { - frame.windows[i][j] = rand()%255; - } - } - - for(int i = 0; i < 12; i++) - { - frame.segments[i].r = rand()%255; - frame.segments[i].g = rand()%255; - frame.segments[i].b = rand()%255; - } - - buffers->get(bufnum)->set( frame ); -// cout << "wrote " << bufnum << endl; - usleep( rand()%250 ); - } -} \ No newline at end of file