You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
2 years ago
|
#ifndef ACTIVATION_CODE_H
|
||
|
#define ACTIVATION_CODE_H
|
||
|
|
||
|
|
||
|
#include "singleton.h"
|
||
|
#include <string>
|
||
|
|
||
|
class ActivationCode : public Singleton<ActivationCode>
|
||
|
{
|
||
|
public:
|
||
|
const std::string & eigen_value() const;
|
||
|
const std::string & activation_code_lhs() const;
|
||
|
|
||
|
public:
|
||
|
bool check(const std::string & terminal_number);
|
||
|
bool store(const std::string & terminal_number, const std::string & activation_code);
|
||
|
|
||
|
public:
|
||
|
void calc(
|
||
|
const std::string & terminal_number,
|
||
|
const std::string & eigen_value,
|
||
|
std::string & activation_code
|
||
|
);
|
||
|
void calc(
|
||
|
const std::string & terminal_number,
|
||
|
const std::string & eigen_value,
|
||
|
std::string & activation_code,
|
||
|
const int & days_to_live
|
||
|
);
|
||
|
int get_life(const std::string& activation_code);
|
||
|
|
||
|
private:
|
||
|
ActivationCode();
|
||
|
~ActivationCode();
|
||
|
|
||
|
private:
|
||
|
ActivationCode(const ActivationCode &);
|
||
|
ActivationCode & operator = (const ActivationCode &);
|
||
|
|
||
|
private:
|
||
|
friend class Singleton<ActivationCode>;
|
||
|
|
||
|
private:
|
||
|
std::string m_eigen_value;
|
||
|
std::string m_activation_code_lhs;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif // ACTIVATION_CODE_H
|
||
|
|