Guitar
RepositoryModel.h
Go to the documentation of this file.
1 #ifndef REPOSITORYMODEL_H
2 #define REPOSITORYMODEL_H
3 
4 #include "BranchLabel.h"
5 #include "GitCommandCache.h"
6 #include "GitObjectManager.h"
7 
8 typedef QList<Git::Tag> TagList;
9 typedef QList<Git::Branch> BranchList;
10 typedef QList<BranchLabel> BranchLabelList;
11 
13  std::mutex *mutex_ = nullptr;
14 
16  std::map<Git::Hash, BranchList> branch_map;
17  std::map<Git::Hash, TagList> tag_map;
18  std::map<int, BranchLabelList> label_map;
19 
20  std::map<QString, Git::Diff> diff_cache;
22 
24 
25  RepositoryData(std::mutex *mutex)
26  : mutex_(mutex)
27  , object_cache(mutex)
28  {}
29 };
30 
32  struct D {
33  std::optional<Git::CommitItemList> commit_log;
34  std::optional<std::map<Git::Hash, BranchList>> branch_map;
35  std::optional<std::map<Git::Hash, TagList>> tag_map;
36  std::optional<std::map<int, BranchLabelList>> label_map;
37  };
38  std::shared_ptr<D> p;
40  : p(std::make_shared<D>())
41  {}
43  : p(std::make_shared<D>(*r.p))
44  {}
45 };
46 Q_DECLARE_METATYPE(CommitLogExchangeData)
47 
48 #endif // REPOSITORYMODEL_H
QList< Git::Branch > BranchList
Definition: RepositoryModel.h:9
QList< BranchLabel > BranchLabelList
Definition: RepositoryModel.h:10
QList< Git::Tag > TagList
Definition: RepositoryModel.h:8
Definition: GitCommandCache.h:9
Definition: GitObjectManager.h:41
Definition: Git.h:143
Definition: Git.h:726
Definition: RepositoryModel.h:32
std::optional< std::map< Git::Hash, TagList > > tag_map
Definition: RepositoryModel.h:35
std::optional< std::map< Git::Hash, BranchList > > branch_map
Definition: RepositoryModel.h:34
std::optional< Git::CommitItemList > commit_log
Definition: RepositoryModel.h:33
std::optional< std::map< int, BranchLabelList > > label_map
Definition: RepositoryModel.h:36
Definition: RepositoryModel.h:31
CommitLogExchangeData(CommitLogExchangeData const &r)
Definition: RepositoryModel.h:42
CommitLogExchangeData()
Definition: RepositoryModel.h:39
std::shared_ptr< D > p
Definition: RepositoryModel.h:38
Definition: RepositoryModel.h:12
std::mutex * mutex_
Definition: RepositoryModel.h:13
std::map< QString, Git::Diff > diff_cache
Definition: RepositoryModel.h:20
GitCommandCache git_command_cache
Definition: RepositoryModel.h:23
Git::CommitItemList commit_log
Definition: RepositoryModel.h:15
std::map< Git::Hash, TagList > tag_map
Definition: RepositoryModel.h:17
RepositoryData(std::mutex *mutex)
Definition: RepositoryModel.h:25
GitObjectCache object_cache
Definition: RepositoryModel.h:21
std::map< int, BranchLabelList > label_map
Definition: RepositoryModel.h:18
std::map< Git::Hash, BranchList > branch_map
Definition: RepositoryModel.h:16