00001 // This is core/vnl/vnl_file_vector.h 00002 #ifndef vnl_file_vector_h_ 00003 #define vnl_file_vector_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Load vnl_vector<T> from file 00010 // \author Andrew W. Fitzgibbon, Oxford RRG 00011 // \date 23 Dec 96 00012 // 00013 // \verbatim 00014 // Modifications 00015 // fsm created by modifying class FileMatrix 00016 // LSB (Manchester) 23/3/01 Tidied documentation 00017 // \endverbatim 00018 // 00019 //----------------------------------------------------------------------------- 00020 00021 #include <vnl/vnl_vector.h> 00022 00023 //: Templated class to load a vector from a file. 00024 template <class T> 00025 class vnl_file_vector : public vnl_vector<T> 00026 { 00027 VCL_SAFE_BOOL_DEFINE; 00028 public: 00029 vnl_file_vector(char const* filename); 00030 00031 operator safe_bool () const 00032 { return (ok_)? VCL_SAFE_BOOL_TRUE : 0; } 00033 bool operator!() const 00034 { return !ok_; } 00035 00036 private: 00037 bool ok_; 00038 }; 00039 00040 #endif // vnl_file_vector_h_