1 /* Copyright 2016-present Facebook, Inc.
2  * Licensed under the Apache License, Version 2.0 */
3 
4 #include "QueryableView.h"
5 
6 namespace watchman {
~QueryableView()7 QueryableView::~QueryableView() {}
8 
9 /** Perform a time-based (since) query and emit results to the supplied
10    * query context */
timeGenerator(w_query *,struct w_query_ctx *) const11 void QueryableView::timeGenerator(w_query*, struct w_query_ctx*) const {
12   throw QueryExecError("timeGenerator not implemented");
13 }
14 
15 /** Walks all files with the suffix(es) configured in the query */
suffixGenerator(w_query *,struct w_query_ctx *) const16 void QueryableView::suffixGenerator(w_query*, struct w_query_ctx*) const {
17   throw QueryExecError("suffixGenerator not implemented");
18 }
19 
20 /** Walks files that match the supplied set of paths */
pathGenerator(w_query *,struct w_query_ctx *) const21 void QueryableView::pathGenerator(w_query*, struct w_query_ctx*) const {
22   throw QueryExecError("pathGenerator not implemented");
23 }
24 
globGenerator(w_query *,struct w_query_ctx *) const25 void QueryableView::globGenerator(w_query*, struct w_query_ctx*) const {
26   throw QueryExecError("globGenerator not implemented");
27 }
28 
allFilesGenerator(w_query *,struct w_query_ctx *) const29 void QueryableView::allFilesGenerator(w_query*, struct w_query_ctx*) const {
30   throw QueryExecError("allFilesGenerator not implemented");
31 }
32 
getLastAgeOutTickValue() const33 uint32_t QueryableView::getLastAgeOutTickValue() const {
34   return 0;
35 }
36 
getLastAgeOutTimeStamp() const37 time_t QueryableView::getLastAgeOutTimeStamp() const {
38   return 0;
39 }
40 
ageOut(w_perf_t &,std::chrono::seconds)41 void QueryableView::ageOut(w_perf_t&, std::chrono::seconds) {}
startThreads(const std::shared_ptr<w_root_t> &)42 void QueryableView::startThreads(const std::shared_ptr<w_root_t>&) {}
signalThreads()43 void QueryableView::signalThreads() {}
wakeThreads()44 void QueryableView::wakeThreads() {}
45 
isVCSOperationInProgress() const46 bool QueryableView::isVCSOperationInProgress() const {
47   static const std::vector<w_string> lockFiles{".hg/wlock", ".git/index.lock"};
48   return doAnyOfTheseFilesExist(lockFiles);
49 }
50 }
51