MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/systemic/ProcScheduler.hh
2024-06-07 11:12:56 +03:00

59 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!\file
* \brief \todo Описание файла.
*/
/*
* ProcScheduler.h
*
* Created on: 21 мая 2019 г.
* Author: titov
*/
#ifndef SOURCE_SYSTEMIC_PROCSCHEDULER_H_
#define SOURCE_SYSTEMIC_PROCSCHEDULER_H_
#include "IProcessor.hh"
#include <cstddef>
#include <stdint.h>
namespace systemic {
class ProcScheduler {
private:
IProcessor * * const processors;
const std::size_t size;
public:
typedef unsigned short ProcessorId;
typedef unsigned short Id;
struct ProcessParameter {
uint16_t priority;
uint16_t period;
uint16_t phase;
uint16_t controlled:1;
uint16_t reserved:15;
// ProcessParameter() : priority(0), period(1), phase(0), controlled(false), reserved() {}
};
bool registerProcess( ProcessorId processor_id, IProcess & proc, ProcessParameter parameters );
bool addProcessor( IProcessor * processor, ProcessorId processor_id );
ProcScheduler( IProcessor * * providers, std::size_t size );
};
template<std::size_t num>
struct ProcSchedulerBox {
IProcessor * records[num];
ProcScheduler manager;
ProcSchedulerBox( ) :
records(), manager( records, num ) {}
};
}
#endif /* SOURCE_SYSTEMIC_PROCSCHEDULER_H_ */