mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 22:02:58 -06:00
40 lines
677 B
C++
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
|