1 |
// Command |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#ifndef _Command_hpp_ |
8 |
#define _Command_hpp_ |
9 |
|
10 |
#include <cxx/platform.hpp> |
11 |
|
12 |
#ifdef MENES_PRAGMA_ONCE |
13 |
#pragma once |
14 |
#endif |
15 |
|
16 |
#include <api/locks.hpp> |
17 |
#include <api/path.hpp> |
18 |
#include <ext/queues.hpp> |
19 |
|
20 |
#include "Subversion/Client.hpp" |
21 |
#include "Url.hpp" |
22 |
|
23 |
struct Command : public ext::ReferenceCounted { |
24 |
const api::Path root; |
25 |
operator cse::String() const { return root.GetPath(); } |
26 |
protected: |
27 |
Command(const cse::String &root) : root(api::Path(root).GetRealPath()) {} |
28 |
}; |
29 |
|
30 |
class CommandRunner |
31 |
{ |
32 |
protected: |
33 |
const cse::String &sitemap, &base; |
34 |
ext::Queue<Url> &queue; |
35 |
api::ThreadMutex &queueLock; |
36 |
Subversion::Client client; |
37 |
CommandRunner(const cse::String &sitemap, const cse::String &base, ext::Queue<Url> &queue, api::ThreadMutex &queueLock) : sitemap(sitemap), base(base), queue(queue), queueLock(queueLock) {} |
38 |
}; |
39 |
|
40 |
#endif//_Command_hpp_ |