HOPS
HOPS class reference
MHO_LegacyRootCodeGenerator.hh
Go to the documentation of this file.
1 #ifndef MHO_LegacyRootCodeGenerator_HH__
2 #define MHO_LegacyRootCodeGenerator_HH__
3 
4 #include <ctime>
5 #include <string>
6 #include <vector>
7 
8 namespace hops
9 {
10 
19 /* [a-z]x6 before this unix clock and [0-9A-Z]x6 after it */
20 #define HOPS_ROOT_BREAK (1519659904)
21 
26 {
27  public:
30 
36  std::string GetCode();
37 
47  std::vector< std::string > GetCodes(std::size_t N);
48 
49  //THESE FUNCTIONS ARE PUBLIC FOR REFERENCE/TESTING BUT SHOULD NOT BE USED
50 
59  int root_id_delta(time_t now);
60 
67  std::string root_id_later(time_t now);
68 
79  std::string root_id(int year, int day, int hour, int min, int sec);
80 
92  std::string root_id_break(time_t now, int year, int day, int hour, int min, int sec);
93 
94  private:
95  time_t fNow;
96  int fYear;
97  int fDay;
98  int fHour;
99  int fMin;
100  int fSec;
101 };
102 
103 } // namespace hops
104 
105 #endif
Class MHO_LegacyRootCodeGenerator.
Definition: MHO_LegacyRootCodeGenerator.hh:26
std::string root_id(int year, int day, int hour, int min, int sec)
Calculates and returns a root ID string based on input time parameters.
Definition: MHO_LegacyRootCodeGenerator.cc:75
std::string root_id_later(time_t now)
Generates a root ID string based on the input time_t value.
Definition: MHO_LegacyRootCodeGenerator.cc:47
std::string root_id_break(time_t now, int year, int day, int hour, int min, int sec)
Determines and returns root ID based on time parameters and comparison with HOPS_ROOT_BREAK.
Definition: MHO_LegacyRootCodeGenerator.cc:112
std::vector< std::string > GetCodes(std::size_t N)
Getter for multiple root codes get a pre-assigned sequential list of N root codes to avoid collisions...
Definition: MHO_LegacyRootCodeGenerator.cc:19
virtual ~MHO_LegacyRootCodeGenerator()
Definition: MHO_LegacyRootCodeGenerator.hh:29
MHO_LegacyRootCodeGenerator()
Definition: MHO_LegacyRootCodeGenerator.hh:28
std::string GetCode()
get a single code corresponding to the current time
Definition: MHO_LegacyRootCodeGenerator.cc:6
int root_id_delta(time_t now)
Calculates and returns delta value based on current time comparison with the HOPS_ROOT_BREAK time ess...
Definition: MHO_LegacyRootCodeGenerator.cc:39
#define min(a, b)
Definition: max555.c:9
Definition: MHO_AdhocFlagging.hh:18