1//////////////////////////////////////////////////////////////////////////////// 2// // 3// This software is supplied under the terms of a license agreement or // 4// nondisclosure agreement with Mitov Software and may not be copied // 5// or disclosed except in accordance with the terms of that agreement. // 6// Copyright(c) 2002-2016 Mitov Software. All Rights Reserved. // 7// // 8//////////////////////////////////////////////////////////////////////////////// 9 10#ifndef _MITOV_PRIORITY_ENCODER_h 11#define _MITOV_PRIORITY_ENCODER_h 12 13#include <Mitov.h> 14 15namespace Mitov 16{ 17template<int C_NUM_INPUTS>class PriorityEncoder :publicMitov::BasicCommonMultiInput<bool,uint32_t, C_NUM_INPUTS> 18{ 19typedefMitov::BasicCommonMultiInput<bool,uint32_t, C_NUM_INPUTS> inherited; 20 21protected: 22virtualuint32_tCalculateOutput() override 23{ 24for(uint32_t i = C_NUM_INPUTS; i--; ) 25if(inherited::InputPins[ i ].Value ) 26return i; 27 28return0; 29} 30 31}; 32//--------------------------------------------------------------------------- 33} 34 35#endif