ndmspc 0.20250304.0
Loading...
Searching...
No Matches
GitlabEvent.h
1#ifndef GitlabEvent_H
2#define GitlabEvent_H
3
4#include <TObject.h>
5#include <TH1S.h>
6#include <TClonesArray.h>
7#include <TDatime.h>
8#include "GitlabTrack.h"
9#include <nlohmann/json.hpp>
10using json = nlohmann::json;
11
12namespace Ndmspc {
13namespace Gitlab {
20
21class Event : public TObject {
22
23 public:
24 Event();
25 Event(Long64_t id);
26 virtual ~Event();
27
65
69
73
77
78 Long64_t GetID() const { return fID; }
79 TDatime GetDateTime() const { return fDateTime; }
80
81 void SetID(Long64_t id) { fID = id; }
82 void SetTimeDate(Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec);
83
84 Long64_t GetNIssues() const { return fNIssues; }
85 Track * GetIssue(Long64_t id) { return (Track *)fIssues->At(id); }
86 Track * AddIssue();
87
88 Long64_t GetNMergeRequests() const { return fNMergeRequests; }
89 Track * GetMergeRequest(Long64_t id) { return (Track *)fMergeRequests->At(id); }
91
93 TH1S * GetListOfAuthors() const { return fAuthors; }
95 TH1S * GetListOfProjects() const { return fProjects; }
97 TH1S * GetListOfMilestones() const { return fMilestones; }
99 void ShrinkMappingHistograms(bool verbose = true);
100
101 bool FillGitlabFromJson(std::string issues, std::string mergrerequests);
102 bool FillIssuesFromJson(const json root);
103 bool FillMergeRequestsFromJson(const json root);
104
105 virtual void Print(Option_t * option = "") const;
106 virtual void Clear(Option_t * option = "");
107
108 private:
109 Long64_t fID;
110 TDatime fDateTime;
111 Int_t fNIssues;
113
115 TClonesArray * fIssues; //->
117 TClonesArray * fMergeRequests; //->
118
119 TH1S * fAuthors{nullptr};
120 TH1S * fProjects{nullptr};
121 TH1S * fMilestones{nullptr};
122
123 // TODO
125 Event(const Event &);
126 Event & operator=(const Event &);
127
128 std::string ParseProjectName(std::string in, char d = '!') const;
129 // void FillAuthorProjectAxis(std::string author, std::string project);
130 void ShrinkHistogram(const char * name, TH1 * h, bool verbose);
131
133 ClassDef(Event, 1);
135}; // namespace TObject
136} // namespace Gitlab
137} // namespace Ndmspc
138#endif
virtual void Print(Option_t *option="") const
bool FillIssuesFromJson(const json root)
TH1S * GetListOfAuthors() const
Returns authors histogram.
Definition GitlabEvent.h:93
void SetTimeDate(Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec)
TH1S * GetListOfMilestones() const
Returns milestones histogram.
Definition GitlabEvent.h:97
bool FillMergeRequestsFromJson(const json root)
TH1S * GetListOfProjects() const
Returns projects histogram.
Definition GitlabEvent.h:95
Int_t fNIssues
Number of Issues.
TDatime fDateTime
Time of event.
Long64_t GetID() const
Event ID.
Definition GitlabEvent.h:78
Long64_t fID
ID of event.
std::string ParseProjectName(std::string in, char d='!') const
not implemented
TClonesArray * fIssues
Array with all issues.
Long64_t GetNMergeRequests() const
Definition GitlabEvent.h:88
virtual void Clear(Option_t *option="")
TH1S * fAuthors
List of authors in current event.
Event(const Event &)
Copy constructor.
Long64_t GetNIssues() const
Definition GitlabEvent.h:84
TDatime GetDateTime() const
Event date and time.
Definition GitlabEvent.h:79
void ShrinkMappingHistograms(bool verbose=true)
Shrinks histogram.
Track * GetIssue(Long64_t id)
Definition GitlabEvent.h:85
Event & operator=(const Event &)
not implemented
Int_t fNMergeRequests
Number of MergeRequests.
bool FillGitlabFromJson(std::string issues, std::string mergrerequests)
TH1S * fProjects
List of projects in current event.
void ShrinkHistogram(const char *name, TH1 *h, bool verbose)
TH1S * fMilestones
List of milestones in current event.
void SetID(Long64_t id)
Definition GitlabEvent.h:81
TClonesArray * fMergeRequests
Array with all merge requests.
Track * GetMergeRequest(Long64_t id)
Definition GitlabEvent.h:89