#include "Prozess.h" // Inhalt der Klasse Prozess aus Prozess.h // Konstruktor Prozess::Prozess( EditorKlientV *klient, int aktion, Array< void* > *args, ProzessReturn *r ) : Thread() { this->k = klient; ak = aktion; this->args = args; ret = r; ref = 1; start(); } // Destruktor Prozess::~Prozess() { args->release(); k->release(); } // nicht constant void Prozess::thread() { k->lock(); Klient *c = k->zKlient(); c->sendeEncrypted( "\x7", 1 ); char ret = 0; c->getNachrichtEncrypted( &ret, 1 ); if( ret == 1 ) { c->sendeEncrypted( "\xF", 1 ); char ret = 0; c->getNachrichtEncrypted( &ret, 1 ); if( ret == 1 ) { switch( ak ) { case 0: init(); break; case 1: sitzungWiederherstellen(); break; case 2: sitzungVerwerfen(); break; } } } if( ret == 3 ) { char byte = 0; c->getNachrichtEncrypted( &byte, 1 ); char *f = new char[ byte + 1 ]; f[ byte ] = 0; c->getNachrichtEncrypted( f, byte ); Text fehler = f; delete[] f; Array< void* > args; args.add( (void*)&fehler ); if( this->ret ) this->ret->prozessEnd( ak, 0, args ); } k->unlock(); run = 0; } // Reference Counting Prozess *Prozess::getThis() { ref++; return this; } Prozess *Prozess::release() { ref--; if( !ref ) delete this; return 0; } // privat void Prozess::init() // aktion = 0 { } void Prozess::sitzungWiederherstellen() // aktion = 1 { } void Prozess::sitzungVerwerfen() // aktion = 2 { }