ultimatepp/bazaar/SkylarkGuiExample/WebInterface.h
zbych bff0f52f4e Simple application combining web server and gui
git-svn-id: svn://ultimatepp.org/upp/trunk@9909 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-06-07 20:03:42 +00:00

40 lines
677 B
C++

#ifndef _SkylarkGuiExample_WebServer_h_
#define _SkylarkGuiExample_WebServer_h_
#include <Skylark/Skylark.h>
namespace Upp {
template <class Type>
class MTObj{
private:
Mutex m;
Type data;
public:
Type Get() {m.Enter(); Type tmp = data; m.Leave(); return tmp;}
void Set(const Type & _data) {m.Enter(); data = _data; m.Leave();}
};
class WebInterface : public SkylarkApp {
Thread thr;
void WorkThread();
public:
typedef WebInterface CLASSNAME;
WebInterface();
~WebInterface();
void StopServer();
//Shared objects
static MTObj<String> SharedVariable;
static Callback1<String> MessageFromWeb;
};
}
#endif