libraries / Mitov / Mitov_MultiMerger.hon commit Added link to project report (97a3ba0)
   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_MULTI_MERGER_h
  11#define _MITOV_MULTI_MERGER_h
  12
  13#include <Mitov.h>
  14
  15namespace Mitov
  16{
  17//---------------------------------------------------------------------------
  18        template<int C_NUM_INPUTS> class MultiMerger : public Mitov::CommonSource
  19        {
  20                typedef Mitov::CommonSource inherited;
  21
  22        public:
  23                OpenWire::SinkPin InputPins[ C_NUM_INPUTS ];
  24
  25        protected:
  26                void DoReceive( void *_Data )
  27                {
  28                        OutputPin.Notify( _Data );
  29                }
  30
  31        protected:
  32                virtual void SystemInit()
  33                {
  34                        inherited::SystemInit();
  35
  36                        for( int i = 0; i < C_NUM_INPUTS; ++i )
  37                                InputPins[ i ].SetCallback( this, (OpenWire::TOnPinReceive)&MultiMerger::DoReceive );
  38                }
  39
  40        };
  41}
  42
  43#endif