 |
ewmscp
..
|
Go to the documentation of this file. 1 #ifndef __followRequestProvider_h__
2 #define __followRequestProvider_h__
27 copyRequest::clock_type::time_point timestamp,
30 auto now = copyRequest::clock_type::now();
31 if (timestamp > now) {
32 if (timestamp - now > std::chrono::milliseconds(10)) {
34 srcPath,
"createRequest",
35 "fixing future timestamp ",
36 std::chrono::duration_cast<std::chrono::duration<double>>(timestamp - now).count(),
"s");
47 fileInWork.updateExecTime(timestamp);
54 && advisedDelay != copyRequest::clock_type::duration::zero()) {
65 virtual void handleMove(
const std::string& srcPath,
66 const std::string& dstPath,
67 const std::string& fromPath,
68 const std::string& origPath,
70 copyRequest::clock_type::time_point timestamp);
71 virtual void handleOther(
const std::string& srcPath,
72 const std::string& dstPath,
74 copyRequest::clock_type::time_point timestamp,
75 bool requestForRemoval);
86 void processSources(
const std::vector<std::string>& sources)
override;
void enqueueOrAppend(const std::string &srcPath, copyRequest::fileInWork::slotTypes type, copyRequest::clock_type::time_point timestamp, Types ... args)
class for defining the location of a error message in the source code.
class specialisation for options of type bool
virtual void handleMove(const std::string &srcPath, const std::string &dstPath, const std::string &fromPath, const std::string &origPath, const singleMap &mapEntry, copyRequest::clock_type::time_point timestamp)
const std::string & getSuffix() const
static options::single< bool > mayDelete
generic provider of copy requests
bool isFollowMode() const override
copyRequest::timedQueue & delayedRequests
fileInWork::slotTypes getSlotType() const
void enRegister(std::unique_ptr< copyRequest::base > &request)
register a request in the fileInWork list
fileInWork & getFileInWork()
create a new fileInWork instance in the map.
void markForQueueing(std::unique_ptr< copyRequest::base > &request)
static options::single< bool > nullDelimiter
outputHandler::base * OutputHandler
followRequestProvider(decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler)
void enqueue(std::unique_ptr< T > &item)
copyRequest::simpleQueue & requests
void processSources(const std::vector< std::string > &sources) override
void enqueue(std::unique_ptr< T > &item, typename clock_type::time_point when)
clock_type::duration getAdvisedDelay() const
returns the advised delay
void emit(level aLogLevel, const location &loc, const std::string &aObject, const std::string &aAction, const Args &... args)
function to create and enqueue a message, this is the only way that messages should be created!
#define timerInst(subfunc)
slotTypes getLatestRequestType() const
std::pair< std::string, std::string > singleMap
inputHandler::base * InputHandler
virtual void followStream(std::istream &stream)=0
static bool adviseDelay(clock_type::duration dt, const std::string &suffix)
update the advised delay in the map.
virtual void handleOther(const std::string &srcPath, const std::string &dstPath, const singleMap &mapEntry, copyRequest::clock_type::time_point timestamp, bool requestForRemoval)
~followRequestProvider() override=default
void setWaitTime(clock_type::duration aWaitTime)