00001 //# Copyright (C) 2009 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This library is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU Library General Public License as published by 00006 //# the Free Software Foundation; either version 2 of the License, or (at your 00007 //# option) any later version. 00008 //# 00009 //# This library is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 //# License for more details. 00013 //# 00014 //# You should have received a copy of the GNU Library General Public License 00015 //# along with this library; if not, write to the Free Software Foundation, 00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 00026 #ifndef CACHETHREAD_H_ 00027 #define CACHETHREAD_H_ 00028 00029 #include <plotms/Threads/BackgroundThread.h> 00030 #include <plotms/PlotMS/PlotMSSelection.h> 00031 #include <plotms/PlotMS/PlotMSAveraging.h> 00032 #include <plotms/PlotMS/PlotMSTransformations.h> 00033 #include <plotms/PlotMS/PlotMSCalibration.h> 00034 00035 namespace casa { 00036 00037 class PlotMSCacheBase; 00038 class PlotMSPlot; 00039 00040 class CacheThread : public BackgroundThread { 00041 public: 00042 CacheThread(); 00043 void setLoad( bool load ); 00044 void setSetupPlot( bool usePlot ); 00045 void setPlot( PlotMSPlot* plot ); 00046 virtual PlotMSPlot* getPlot(); 00047 void setCacheBase( PlotMSCacheBase* cacheBase ); 00048 void setAxes( vector<PMS::Axis> axes ); 00049 void setAxesData( int size ); 00050 void setAxesData( vector<PMS::DataColumn> cachedData ); 00051 void setName( String msName ); 00052 void setSelection( PlotMSSelection selection ); 00053 void setAveraging( PlotMSAveraging averaging ); 00054 void setTransformations( PlotMSTransformations transforms ); 00055 void setCalibration( PlotMSCalibration calibration ); 00056 virtual ~CacheThread(); 00057 protected: 00058 virtual bool doWork(); 00059 virtual void finished(){} 00060 private: 00061 CacheThread( const CacheThread& other ); 00062 CacheThread operator=( const CacheThread& other ); 00063 00064 //Log error, set status, and do clean up when an 00065 //exception is thrown. 00066 void handleError(String message ); 00067 00068 bool itsLoad; 00069 bool itsSetupPlot; 00070 PlotMSCacheBase* itsCache; 00071 vector<PMS::Axis> workAxes; 00072 vector<PMS::DataColumn> itsAxesData; 00073 String itsMSName; 00074 PlotMSSelection itsSelection; 00075 PlotMSAveraging itsAveraging; 00076 PlotMSTransformations itsTransformations; 00077 PlotMSCalibration itsCalibration; 00078 PlotMSPlot* itsPlot; 00079 }; 00080 00081 } /* namespace casa */ 00082 #endif /* CACHETHREAD_H_ */