12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /***************************************************************************
- * E-Com Technology Ltd.
- *
- * ECOMPACS DICOM Network Transport Libraries * Version 0.1 Beta
- ***************************************************************************/
- #pragma once
- #ifndef __IOManipulate__
- #define __IOManipulate__
- template <class stype, class vtype>
- class fcn_obj
- {
- public:
- fcn_obj (stype & (*f) (stype &, vtype), vtype v):
- func (f), val (v)
- {
- }
- stype & operator () (stype & s) const
- {
- return (*func) (s, val);
- }
- private:
- stype & (*func) (stype &, vtype);
- vtype val;
- };
- template <class stype, class vtype>
- stype & operator << (stype & ofile, const fcn_obj <stype, vtype> (im))
- {
- return im (ofile);
- }
- template <class stype, class vtype>
- stype & operator >> (stype & ifile, const fcn_obj <stype, vtype> (im))
- {
- return im (ifile);
- }
- #endif
|