1 |
// Decentralized Media |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#ifndef _DecentralizedMedia_hpp_ |
8 |
#define _DecentralizedMedia_hpp_ |
9 |
|
10 |
#include <menes/platform.hpp> |
11 |
|
12 |
#ifdef MENES_PRAGMA_ONCE |
13 |
#pragma once |
14 |
#endif |
15 |
|
16 |
#include <menes-api/process.hpp> |
17 |
#include <menes-waf/server.hpp> |
18 |
|
19 |
#include "BeepRemote.hpp" |
20 |
#include "MediaFolder.hpp" |
21 |
|
22 |
class DecentralizedMedia : public waf::Server |
23 |
{ |
24 |
public: |
25 |
BeepRemote bmp; |
26 |
private: |
27 |
_H<api::Thread> block; |
28 |
_H<api::Process> process; |
29 |
const _L<ext::String>& extensions; |
30 |
ext::RedBlackMap<ext::String, ext::String> shares; |
31 |
int Destroy() { return process->Join(); } |
32 |
protected: |
33 |
virtual void Process(const net::Http::Request& request, net::Http::Response& response); |
34 |
public: |
35 |
ext::RedBlackSet<MediaFolder> media; |
36 |
DecentralizedMedia(const _L<ext::String>& extensions, const _L<ext::String>& locals); |
37 |
virtual ~DecentralizedMedia(); |
38 |
}; |
39 |
|
40 |
#endif//_DecentralizedMedia_hpp_ |