phaser-server  0.0.2
resultsDb.h
Go to the documentation of this file.
1 #ifndef RESULTS_DB_H
2 #define RESULTS_DB_H
8 #include <oracle.h>
9 class PhaseJob;
10 
15 class ResultsDb
16 { public:
18  ~ResultsDb(void);
20  int GetJobId(void) { return m_job_id; }
22  enum class Outcome_t { Corrected, Measured, Bypass, Skip };
23  int LogResult(time_t, const std::string &, double, Outcome_t,
24  double);
25  static void Apply(const std::vector<unsigned> &);
26 
27  private:
29  class OraDB : public Oracle::Nexus
30  { public:
31  OraDB(Oracle::OracleEnv &);
32  };
33 
34  private:
35  int NextID(Oracle::Nexus &, const char *);
36  static void SetDate(time_t, Oracle::SQL &, int);
37  static void Reject(Oracle::Nexus &, const char *, int, time_t,
38  const char * = "ERROR");
39 
40  private:
41  static Oracle::OracleEnv m_env;
42  int m_job_id;
43 };
44 
45 #endif
A job for processing RF cavities.
Definition: phaseJob.h:17
Log phasing job results to a database.
Definition: resultsDb.h:16
ResultsDb(PhaseJob &)
Construct an instance.
Definition: resultsDb.cpp:44
int GetJobId(void)
Get the job's database identifier.
Definition: resultsDb.h:20
Outcome_t
Apply phase correction outcomes.
Definition: resultsDb.h:22
int LogResult(time_t, const std::string &, double, Outcome_t, double)
Log a cavity phasing completion result.
Definition: resultsDb.cpp:132
~ResultsDb(void)
Destroy an instance by setting the Job-end-date.
Definition: resultsDb.cpp:72
static void Apply(const std::vector< unsigned > &)
Apply phase corrections.
Definition: resultsDb.cpp:200