casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLATapeIO.h
Go to the documentation of this file.
1 //# <VLATapeIO.h>: this defines <VLATapeIO>, which ...
2 //# Copyright (C) 1997,1999,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 //#! ========================================================================
29 //#! Attention! Programmers read this!
30 //#!
31 //#! This file is a template to guide you in creating a header file
32 //#! for your new class. By following this template, you will create
33 //#! a permanent reference document for your class, suitable for both
34 //#! the novice client programmer, the seasoned veteran, and anyone in
35 //#! between. It is essential that you write the documentation portions
36 //#! of this file with as much care as you do the source code.
37 //#!
38 //#! If you are unfamilar with the AIPS++ header style please refer to
39 //#! template-class-h.
40 //#!
41 //#! Replacement Tokens
42 //#! ------------------
43 //#!
44 //#! These are character strings enclosed in angle brackets, on a commented
45 //#! line. Two are found on the first line of this file:
46 //#!
47 //#! <ClassFileName.h> <ClassName>
48 //#!
49 //#! You should remove the angle brackets, and replace the characters within
50 //#! the brackets with names specific to your class. Mimic the capitalization
51 //#! and punctuation of the original. For example, you would change
52 //#!
53 //#! <ClassFileName.h> to LatticeIter.h
54 //#! <ClassName> to LatticeIterator
55 //#!
56 //#! Another replacement token will be found in the "include guard" just
57 //#! a few lines below.
58 //#!
59 //#! #define <AIPS_CLASSFILENAME_H> to #define AIPS_LATTICEITER_H
60 //#!
61 
62 #ifndef NRAO_VLATAPEIO_H
63 #define NRAO_VLATAPEIO_H
64 
65 //# Forward Declarations
66 
67 // <summary>
68 // This class this defines VLATapeIO
69 // </summary>
70 
71 // <use visibility=local> or <use visibility=export>
72 
73 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
74 // </reviewed>
75 
76 // <prerequisite>
77 // <li> SomeClass
78 // <li> SomeOtherClass
79 // <li> some concept
80 // </prerequisite>
81 //
82 // <etymology>
83 // </etymology>
84 //
85 // <synopsis>
86 // </synopsis>
87 //
88 // <example>
89 // </example>
90 //
91 // <motivation>
92 // </motivation>
93 //
94 // <templating arg=T>
95 // <li>
96 // <li>
97 // </templating>
98 //
99 // <thrown>
100 // <li>
101 // <li>
102 // </thrown>
103 //
104 // <todo asof="yyyy/mm/dd">
105 // <li> add this feature
106 // <li> fix this bug
107 // <li> start discussion of this possible extension
108 // </todo>
109 
110 
111 
112 #include <casa/aips.h>
113 #include <casa/BasicSL/String.h>
114 #include <sys/types.h>
115 #include <sys/stat.h>
116 #include <fcntl.h>
117 
118 #include <casa/namespace.h>
119 // kludge for tapes until we do something specific.
120 // It''s pretty much a thin vaneer that sits on top of rmt.
121 
127 
128 class VLATapeIO {
129  public :
130  VLATapeIO() : tapeId(-1){}
131  VLATapeIO(const casacore::String &a) : inOut(O_RDONLY), tPosition(0){
133  }
134  VLATapeIO(const casacore::String &a, casacore::Int rwFlag, casacore::Int tpos) : inOut(rwFlag),
135  tPosition(tpos){
137  }
140  tapeId = rmtopen((casacore::Char *)(a.chars()), b, c);
141  return tapeId;}
142  casacore::Int read(casacore::Char *buf, casacore::uInt nsize){return rmtread(tapeId, buf, nsize);}
143  //casacore::Int write(casacore::Char *buf, casacore::uInt nsize){return rmtwrite(tapeId, buf, nsize);}
146  private :
150 };
151 #endif
Int rmtclose(casacore::Int)
int Int
Definition: aipstype.h:50
Int rmtread(casacore::Int, casacore::Char *, casacore::uInt)
Int rmtopen(casacore::Char *, casacore::Int, casacore::Int)
This class this defines VLATapeIO.
VLATapeIO(const casacore::String &a)
Definition: VLATapeIO.h:131
Int rmtwrite(casacore::Int, casacore::Char *, casacore::uInt)
VLATapeIO(const casacore::String &a, casacore::Int rwFlag, casacore::Int tpos)
Definition: VLATapeIO.h:134
char Char
Definition: aipstype.h:46
~VLATapeIO()
Definition: VLATapeIO.h:138
Int rmtaccess(casacore::Char *, casacore::uInt)
casacore::Int inOut
Definition: VLATapeIO.h:147
casacore::Int close()
Definition: VLATapeIO.h:145
casacore::Int read(casacore::Char *buf, casacore::uInt nsize)
Definition: VLATapeIO.h:142
casacore::Int tapeId
Definition: VLATapeIO.h:148
const Char * chars() const
** Casacore synonym
Definition: String.h:559
casacore::Int access(const casacore::Char *a, casacore::uInt b)
casacore::Int write(casacore::Char *buf, casacore::uInt nsize){return rmtwrite(tapeId, buf, nsize);}
Definition: VLATapeIO.h:144
const Double c
Fundamental physical constants (SI units):
String: the storage and methods of handling collections of characters.
Definition: String.h:223
unsigned int uInt
Definition: aipstype.h:51
casacore::Int tPosition
Definition: VLATapeIO.h:149
casacore::Int open(const casacore::String &a, casacore::Int b, casacore::Int c)
Definition: VLATapeIO.h:139