Aruna
Performer.h
Go to the documentation of this file.
1
//
2
// Created by noeel on 15-04-20.
3
//
4
5
#ifndef ARUNA_PERFORMER_H
6
#define ARUNA_PERFORMER_H
7
8
#include <cstdint>
9
#include "
aruna/sis/sisTypes.h
"
10
#include <pthread.h>
11
#include <
aruna/log.h
>
12
13
namespace
aruna
{
14
namespace
sis {
15
class
Performer
{
16
private
:
17
status_t
status
;
18
protected
:
19
// update thread
20
pthread_t
thread
;
21
pthread_cond_t
do_update_con
;
22
pthread_mutex_t
do_update_mut
;
23
//
24
log::channel_t
*
log
;
25
char
log_tag
[10] =
"SIS perf"
;
26
// use set_update()
27
bool
do_update
=
false
;
28
29
// update thread handlers
30
void
update_handler
();
31
32
static
void
*
_update_handler
(
void
*_this);
33
34
// set to true to cancel creation of update thread.
35
bool
interrupt_based
=
false
;
36
public
:
40
uint32_t
update_ms
= 500;
41
45
Performer
();
46
47
~Performer
();
48
49
// TODO actions to bring system back to a secure state
50
// virtual void action() = 0;
51
// virtual void action_abort() = 0;
52
57
virtual
status_t
*
update_status
() = 0;
58
63
void
set_update
(
bool
do_update);
64
65
};
66
67
}
68
}
69
70
#endif //ARUNA_PERFORMER_H
aruna
Definition:
comm.cpp:14
aruna::sis::Performer::~Performer
~Performer()
Definition:
Performer.cpp:64
aruna::sis::Performer::status
status_t status
Definition:
Performer.h:17
sisTypes.h
aruna::sis::Performer::update_handler
void update_handler()
Definition:
Performer.cpp:36
aruna::sis::Performer::do_update_con
pthread_cond_t do_update_con
Definition:
Performer.h:21
aruna::sis::Performer::log_tag
char log_tag[10]
Definition:
Performer.h:25
aruna::sis::Performer::interrupt_based
bool interrupt_based
Definition:
Performer.h:35
aruna::sis::Performer::do_update_mut
pthread_mutex_t do_update_mut
Definition:
Performer.h:22
aruna::sis::Performer::log
log::channel_t * log
Definition:
Performer.h:24
aruna::sis::Performer::set_update
void set_update(bool do_update)
Use to pauze and resume the update process.
Definition:
Performer.cpp:57
aruna::log::channel_t
Definition:
log.h:25
aruna::sis::Performer
Definition:
Performer.h:15
aruna::sis::Performer::update_ms
uint32_t update_ms
update frequency
Definition:
Performer.h:40
aruna::sis::Performer::_update_handler
static void * _update_handler(void *_this)
Definition:
Performer.cpp:31
aruna::sis::Performer::update_status
virtual status_t * update_status()=0
Perform check to see if system is secure and return updated status.
aruna::sis::Performer::thread
pthread_t thread
Definition:
Performer.h:20
aruna::sis::Performer::do_update
bool do_update
Definition:
Performer.h:27
aruna::sis::status_t
status that is to be reported to the watcher
Definition:
sisTypes.h:36
aruna::sis::Performer::Performer
Performer()
Performs check to see if the system is in a secure state.
Definition:
Performer.cpp:16
log.h
include
aruna
sis
Performer.h
Generated by
1.8.13