casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VWBT.h
Go to the documentation of this file.
00001 //# VWBT.h: This file contains the interface definition of the VWBT class.
00002 //#
00003 //#  CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
00004 //#  Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
00005 //#  Copyright (C) European Southern Observatory, 2011, All rights reserved.
00006 //#
00007 //#  This library is free software; you can redistribute it and/or
00008 //#  modify it under the terms of the GNU Lesser General Public
00009 //#  License as published by the Free software Foundation; either
00010 //#  version 2.1 of the License, or (at your option) any later version.
00011 //#
00012 //#  This library is distributed in the hope that it will be useful,
00013 //#  but WITHOUT ANY WARRANTY, without even the implied warranty of
00014 //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //#  Lesser General Public License for more details.
00016 //#
00017 //#  You should have received a copy of the GNU Lesser General Public
00018 //#  License along with this library; if not, write to the Free Software
00019 //#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00020 //#  MA 02111-1307  USA
00021 //# $Id: $
00022 
00023 #ifndef VWBT_H_
00024 #define VWBT_H_
00025 
00026 #include <synthesis/MSVis/VisibilityIterator.h>
00027 #include <synthesis/MSVis/AsynchronousTools.h>
00028 using namespace casa::async;
00029 
00030 namespace casa { //# NAMESPACE CASA - BEGIN
00031 
00032 class VWBT : public casa::async::Thread {
00033 
00034 public:
00035 
00036         VWBT(VisibilityIterator *visibilityIterator,
00037          casa::async::Mutex * msAccessMutex,
00038          bool groupRows);
00039 
00040         ~VWBT ();
00041 
00042         void start();
00043         void terminate ();
00044         bool isWriting() { return writing_p;}
00045 
00046         // We just want a de-referenced copy
00047         void setFlag(Cube<Bool> flagCube);
00048 
00049 protected:
00050 
00051         void * run ();
00052 
00053         void initialize();
00054         bool next();
00055 
00056 
00057 private:
00058         
00059         // State parameters
00060         volatile Bool terminationRequested_p;
00061         Bool threadTerminated_p;
00062         Bool writing_p;
00063 
00064         // Writing members
00065         VisibilityIterator * visibilityIterator_p;
00066         casa::async::Mutex * msAccessMutex_p;
00067         Cube<Bool> * flagCube_p;
00068 
00069         // Configuration parameters
00070         Bool groupRows_p;
00071 };
00072 
00073 } //# NAMESPACE CASA - END
00074 
00075 #endif /* VWBT_H_ */
00076