casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TaQLStyle.h
Go to the documentation of this file.
00001 //# TaQLStyle.h: Class with static members defining the TaQL style
00002 //# Copyright (C) 2006
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: TaQLStyle.h 20967 2010-09-27 11:06:03Z gervandiepen $
00027 
00028 #ifndef TABLES_TAQLSTYLE_H
00029 #define TABLES_TAQLSTYLE_H
00030 
00031 //# Includes
00032 #include <casa/BasicSL/String.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary>
00037 // Class with static members defining the TaQL style.
00038 // </summary>
00039 
00040 // <use visibility=local>
00041 
00042 // <reviewed reviewer="" date="" tests="">
00043 // </reviewed>
00044 
00045 // <synopsis>
00046 // Originally TaQL was developed to use the Glish style of indexing.
00047 // This meant 1-based indices, axes in Fortran order, and end is inclusive
00048 // in start:end.
00049 // On the other hand the Python style is the opposite.
00050 // In order to let the user choose between styles, one can define the
00051 // style in a TaQL command.
00052 // The default style is Glish.
00053 //
00054 // The class is also used to tell the TaQL execution engine if timings
00055 // of the various parts of the TaQL command need to be done.
00056 // </synopsis> 
00057 
00058 class TaQLStyle
00059 {
00060 public:
00061   // Default style is Glish and no timings.
00062   explicit TaQLStyle (uInt origin=1)
00063     : itsOrigin  (origin),
00064       itsEndExcl (False),
00065       itsCOrder  (False),
00066       itsDoTiming(False)
00067     {}
00068 
00069   // Reset to the default Glish style and no timings.
00070   void reset();
00071 
00072   // Set the style according to the (case-insensitive) value.
00073   // Possible values are Glish, Python, Base0, Base1, FortranOrder, Corder,
00074   // InclEnd, and ExclEnd.
00075   void set (const String& value);
00076 
00077   // Get the various style values.
00078   // <group>
00079   uInt origin() const
00080     { return itsOrigin; }
00081   Bool isEndExcl() const
00082     { return itsEndExcl; }
00083   Bool isCOrder() const
00084     { return itsCOrder; }
00085   // </group>
00086 
00087   // Set if timing needs to be done.
00088   void setTiming (Bool doTiming)
00089     { itsDoTiming = doTiming; }
00090 
00091   // Should timing be done?
00092   Bool doTiming() const
00093     { return itsDoTiming; }
00094 
00095 private:
00096   uInt itsOrigin;
00097   Bool itsEndExcl;
00098   Bool itsCOrder;
00099   Bool itsDoTiming;
00100 };
00101 
00102 
00103 } //# NAMESPACE CASA - END
00104 
00105 #endif