aboutsummaryrefslogtreecommitdiff
path: root/src/tracking/change_tracker.h
blob: 24251e502adf298d682bfb73e8011c5ed0085c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef CHANGE_SRC_TRACKING_CHANGE_TRACKER_H_
#define CHANGE_SRC_TRACKING_CHANGE_TRACKER_H_

#include <unordered_map>

#include <boost/process.hpp>

#include "utility/logger.h"

namespace tracking {

class ChangeTracker {
	public:
		ChangeTracker(utility::Logger*, const std::string&);
		ChangeTracker(utility::Logger*);
		~ChangeTracker();

		bool is_tracked(const std::string&) const;

		bool track(const std::string&);

	private:
		const std::string      diff_cmd_;
		utility::Logger* const logger_;

		std::unordered_map<
			std::string, std::unique_ptr<boost::process::child>
		> children_;

};

}

#endif  // CHANGE_SRC_TRACKING_CHANGE_TRACKER_H_