Mercurial > octave-nkf
diff src/oct-stream.cc @ 4946:48a39e2b2ab7
[project @ 2004-08-31 17:27:04 by jwe]
author | jwe |
---|---|
date | Tue, 31 Aug 2004 17:27:05 +0000 |
parents | 44046bbaa52c |
children | 25c2664861bc |
line wrap: on
line diff
--- a/src/oct-stream.cc Tue Aug 31 15:09:17 2004 +0000 +++ b/src/oct-stream.cc Tue Aug 31 17:27:05 2004 +0000 @@ -2770,61 +2770,6 @@ rep->close (); } -// XXX FIXME XXX -- these trait classes probably belong somehwere else... - -template <typename T> -class -octave_type_traits -{ -public: - typedef T val_type; -}; - -#define OCTAVE_TYPE_TRAIT(T, VAL_T) \ - template <> \ - class \ - octave_type_traits<T> \ - { \ - public: \ - typedef VAL_T val_type; \ - } - -OCTAVE_TYPE_TRAIT (octave_int8, octave_int8::val_type); -OCTAVE_TYPE_TRAIT (octave_uint8, octave_uint8::val_type); -OCTAVE_TYPE_TRAIT (octave_int16, octave_int16::val_type); -OCTAVE_TYPE_TRAIT (octave_uint16, octave_uint16::val_type); -OCTAVE_TYPE_TRAIT (octave_int32, octave_int32::val_type); -OCTAVE_TYPE_TRAIT (octave_uint32, octave_uint32::val_type); -OCTAVE_TYPE_TRAIT (octave_int64, octave_int64::val_type); -OCTAVE_TYPE_TRAIT (octave_uint64, octave_uint64::val_type); - -template <typename T> -class octave_array_type_traits -{ -public: - typedef T element_type; -}; - -#define OCTAVE_ARRAY_TYPE_TRAIT(T, ELT_T) \ - template <> \ - class \ - octave_array_type_traits<T> \ - { \ - public: \ - typedef ELT_T element_type; \ - } - -OCTAVE_ARRAY_TYPE_TRAIT (charNDArray, char); -OCTAVE_ARRAY_TYPE_TRAIT (int8NDArray, octave_int8); -OCTAVE_ARRAY_TYPE_TRAIT (uint8NDArray, octave_uint8); -OCTAVE_ARRAY_TYPE_TRAIT (int16NDArray, octave_int16); -OCTAVE_ARRAY_TYPE_TRAIT (uint16NDArray, octave_uint16); -OCTAVE_ARRAY_TYPE_TRAIT (int32NDArray, octave_int32); -OCTAVE_ARRAY_TYPE_TRAIT (uint32NDArray, octave_uint32); -OCTAVE_ARRAY_TYPE_TRAIT (int64NDArray, octave_int64); -OCTAVE_ARRAY_TYPE_TRAIT (uint64NDArray, octave_uint64); -OCTAVE_ARRAY_TYPE_TRAIT (NDArray, double); - template <class RET_T, class READ_T> octave_value do_read (octave_stream& strm, int nr, int nc, int block_size,