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

44 lines
1.1 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.cpp
*
* Created on: 21 мая 2019 г.
* Author: titov
*/
#include "ProcScheduler.hh"
bool systemic::ProcScheduler::addProcessor( IProcessor * processor,
ProcessorId processor_id ) {
bool result = false;
if( processor_id < size and not processors[processor_id] )
result = ( processors[processor_id] = processor );
return result;
}
systemic::ProcScheduler::ProcScheduler( IProcessor * * providers, std::size_t size ) :
processors(providers), size(size) {}
bool systemic::ProcScheduler::registerProcess( ProcessorId processor_id,
IProcess & proc,
ProcessParameter parameters ) {
bool result = false;
if( processor_id < size and processors[processor_id] ) {
processors[processor_id]->reqisterProcess( parameters.priority, parameters.period, parameters.phase, parameters.controlled, proc );
result = true;
}
return result;
}