Object PKCS#11 C++ Wrapper
Stateful.h
Go to the documentation of this file.
1 #ifndef STATEFUL_H
2 #define STATEFUL_H
3 
4 namespace objck {
16 class Stateful
17 {
18 protected:
22  enum state
23  {
24  DISABLED = 0,
25  ENABLED = 1
26  };
27 
29 
33  void disable()
34  {
35  this->_currentState = Stateful::DISABLED;
36  }
37 
41  void enable()
42  {
43  this->_currentState = Stateful::ENABLED;
44  }
45 public:
49  Stateful(Stateful::state st = Stateful::DISABLED) : _currentState(st){};
50 
54  virtual ~Stateful() throw(){};
55 
61  {
62  return _currentState;
63  };
64 
69  bool isEnabled()
70  {
71  return _currentState == Stateful::ENABLED;
72  };
73 
78  bool isDisabled()
79  {
80  return _currentState == Stateful::DISABLED;
81  };
82 };
83 }/*END NAMESPACE*/
84 #endif /*STATEFUL_H*/
Definition: Stateful.h:25
Definition: Stateful.h:24
Stateful(Stateful::state st=Stateful::DISABLED)
Definition: Stateful.h:49
Stateful::state _currentState
Definition: Stateful.h:28
bool isEnabled()
Definition: Stateful.h:69
Stateful::state getState()
Definition: Stateful.h:60
bool isDisabled()
Definition: Stateful.h:78
state
Definition: Stateful.h:22
void disable()
Definition: Stateful.h:33
virtual ~Stateful()
Definition: Stateful.h:54
void enable()
Definition: Stateful.h:41
Definition: Cryptoki.h:15
Initializable abstract class
Definition: Stateful.h:16