ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/DecentralizedMedia.hpp
Revision: 540
Committed: 2005-07-01T23:56:04-07:00 (19 years, 11 months ago) by douglas
File size: 1467 byte(s)
Log Message:
Ketchup and locking!

File Contents

# Content
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 #include <menes-xml/nodeset.hpp>
19
20 #include "BeepRemote.hpp"
21 #include "MediaFolder.hpp"
22 #include "Share.hpp"
23
24 class DecentralizedMedia : public waf::Server
25 {
26 public:
27 BeepRemote bmp;
28 private:
29 _P<api::Thread> block;
30 _P<api::Process> process;
31 mutable _P<dbi::Connection> connection;
32 const ext::RedBlackSet<cse::String>& extensions;
33 mta::ReaderWriterLock sharesLock;
34 ext::RedBlackMap<cse::String, _P<Share> > sharesByPath;
35 ext::RedBlackMap<api::Address, ext::RedBlackMap<cse::String, _P<Share> > > sharesByHost;
36 void Media(ios::Reader& media, const api::Address& host = api::InternetAddress());
37 void Media(const _P<xml::Node>& folder, const api::Path& path, const api::Path& root);
38 int Destroy() { return process->Join(); }
39 protected:
40 virtual void Process(const net::Http::Request& request, net::Http::Response& response);
41 public:
42 DecentralizedMedia(const ext::RedBlackSet<cse::String>& extensions, const ext::RedBlackSet<api::Path>& locals);
43 virtual ~DecentralizedMedia();
44 _L<cse::String> GetArtists() const;
45 _L<cse::String> GetTitles() const;
46 _L<cse::String> GetAlbums() const;
47 _L<cse::String> GetGenres() const;
48 _L<MediaFolder> GetFolders() const;
49 };
50
51 #endif//_DecentralizedMedia_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id