#include <DataFile.h>
Inherited by ICLIB::DataFile1D, and ICLIB::DataFile2D.
Inheritance diagram for ICLIB::DataFile:

Public Types | |
| typedef std::vector< std::pair< std::string, Values > > | ValuesMap |
Public Member Functions | |
| virtual | ~DataFile () |
| void | clear () |
| virtual void | load (const std::string &filename)=0 |
| virtual void | save (const std::string &filename)=0 |
| const Values & | getValues (const std::string &key) const |
| void | setValues (const std::string &key, const Values &data) |
| virtual void | getArrayValues (vector< double > &array, int &xdim, int &ydim)=0 |
| virtual void | setArrayValues (const vector< double > &array, int xdim, int ydim)=0 |
Protected Attributes | |
| ValuesMap | mValues |
| Values | mEmpty |
| std::string | mFilename |
Definition at line 15 of file DataFile.h.
|
|
Definition at line 18 of file DataFile.h. |
|
|
Definition at line 20 of file DataFile.h.
|
|
|
Definition at line 22 of file DataFile.h. References mValues. Referenced by ICLIB::DataFile2D::load(), and ICLIB::DataFile1D::load(). 00022 { mValues.clear(); }
|
|
||||||||||||||||
|
Implemented in ICLIB::DataFile1D, and ICLIB::DataFile2D. |
|
|
Definition at line 5 of file DataFile.cpp. 00005 { 00006 ValuesMap::const_iterator it; 00007 for(it=mValues.begin(); it!=mValues.end() && it->first!=key; ++it); 00008 if(it==mValues.end()) { 00009 std::ostringstream err; 00010 err << "Could not find data for '" << key << "' in file '" << mFilename << "'"; 00011 throw ParseException ( mFilename, 00012 "DataFile::getValues", 00013 __FILE__, 00014 __LINE__); 00015 00016 00017 /*Tango::Except::throw_exception( 00018 static_cast<const char*>("TANGO_DEVICE_ERROR"), 00019 static_cast<const char*>(err.str().c_str()), 00020 static_cast<const char*>("DataFile::getValues"));*/ 00021 } 00022 else 00023 return it->second; 00024 }
|
|
|
Implemented in ICLIB::DataFile1D, and ICLIB::DataFile2D. |
|
|
Implemented in ICLIB::DataFile1D, and ICLIB::DataFile2D. |
|
||||||||||||||||
|
Implemented in ICLIB::DataFile1D, and ICLIB::DataFile2D. |
|
||||||||||||
|
Definition at line 26 of file DataFile.cpp. References mValues. 00026 { 00027 bool found = false; 00028 ValuesMap::iterator it; 00029 for(it=mValues.begin(); it!=mValues.end() && it->first!=key; ++it); 00030 if(it==mValues.end()) { 00031 ValuesMap::value_type empty; 00032 mValues.push_back(empty); 00033 mValues.back().first=key; 00034 mValues.back().second=data; 00035 } 00036 else 00037 it->second=data; 00038 }
|
|
|
Definition at line 34 of file DataFile.h. |
|
|
Definition at line 35 of file DataFile.h. Referenced by ICLIB::DataFile1D::DataFile1D(), ICLIB::DataFile2D::DataFile2D(), ICLIB::DataFile2D::load(), and ICLIB::DataFile1D::load(). |
|
|
Definition at line 33 of file DataFile.h. Referenced by clear(), ICLIB::DataFile1D::getArrayValues(), ICLIB::DataFile2D::save(), ICLIB::DataFile1D::save(), and setValues(). |
1.4.5