#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Core/IO/Tap.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2002, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVL_DPTAP_HEADER #define RAVL_DPTAP_HEADER 1 /////////////////////////////////////////////////// //! docentry="Ravl.Core.Data Processing.Taps" //! rcsid="$Id: Tap.hh,v 1.2 2002/08/08 16:03:11 craftit Exp $" //! file="Ravl/Core/IO/Tap.hh" //! lib=RavlIO //! author="Charles Galambos" //! date="15/10/1998" #include "Ravl/DP/Process.hh" #include "Ravl/DP/Port.hh" namespace RavlN { //! userlevel=Develop //: Tap process body. template class DPTapBodyC : public DPProcessBodyC { public: DPTapBodyC(const DPOPortC &nOut) : out(nOut) {} //: Constructor. DataT Apply(const DataT &dat) { out.Put(dat); return dat; } //: Apply. IntT ApplyArray(const SArray1dC &in,SArray1dC &outarr) { IntT ret = out.PutArray(in); outarr = in; // this may break something if a copy is expected to the output ? return ret; } //: Apply to an array. protected: DPOPortC out; }; //! userlevel=Normal //: Tap process. template class DPTapC : public DPProcessC { public: DPTapC(const DPOPortC &out) : DPProcessC(*new DPTapBodyC(out)) {} //: Constructor. }; //////////////////////////////////// template DPProcessC DPTap(const DPOPortC &aport) { return DPTapC(aport); } } #endif