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_DIGITALS_TO_UNSIGNED_h 11#define _MITOV_DIGITALS_TO_UNSIGNED_h 12 13#include <Mitov.h> 14 15namespace Mitov 16{ 17template<int C_NUM_INPUTS>class DigitalsToUnsigned :publicMitov::BasicCommonMultiInput<bool,uint32_t, C_NUM_INPUTS> 18{ 19typedefMitov::BasicCommonMultiInput<bool,uint32_t, C_NUM_INPUTS> inherited; 20 21protected: 22virtualuint32_tCalculateOutput() override 23{ 24uint32_t AValue =0; 25for(uint32_t i = C_NUM_INPUTS; i--; ) 26if(inherited::InputPins[ i ].Value ) 27 AValue |= ((uint32_t)1) << i; 28 29return AValue; 30} 31 32}; 33//--------------------------------------------------------------------------- 34} 35 36#endif