31#include <casacore/casa/aips.h>
32#include <casacore/casa/Containers/Block.h>
33#include <casacore/casa/BasicSL/String.h>
34#include <casacore/casa/BasicSL/Complex.h>
35#include <casacore/casa/IO/ByteIO.h>
36#include <casacore/casa/vector.h>
179 uInt filebufSize=65536,
180 const std::shared_ptr<MultiFileBase>& = std::shared_ptr<MultiFileBase>());
187 explicit AipsIO (
const std::shared_ptr<ByteIO>&);
191 explicit AipsIO (
const std::shared_ptr<TypeIO>&);
204 uInt filebufSize=65536,
205 const std::shared_ptr<MultiFileBase>& = std::shared_ptr<MultiFileBase>());
213 void open (
const std::shared_ptr<ByteIO>&);
217 void open (
const std::shared_ptr<TypeIO>&);
285 { *
this <<
uInt(vec.size());
286 for (
typename vector<T>::const_iterator iter=vec.begin();
287 iter!=vec.end(); ++iter) {
366 for (
typename vector<T>::iterator iter=vec.begin();
367 iter!=vec.end(); ++iter) {
AipsIO & put(uInt nrval, const unsigned int *values, Bool putNR=True)
AipsIO & get(uInt nrval, uInt64 *values)
uInt getstart(const Char *objectType)
AipsIO & get(uInt nrval, Int64 *values)
AipsIO & put(uInt nrval, const Char *values, Bool putNR=True)
uInt getstart(const String &objectType)
Start reading an object.
ByteIO::OpenOption fileOption() const
Return the file option.
void testput()
Test if put is possible (throw exception if not).
std::shared_ptr< ByteIO > file_p
The file object.
AipsIO & getnew(uInt &nrval, uInt64 *&values)
AipsIO()
No file attached yet.
AipsIO(const std::shared_ptr< ByteIO > &)
Construct from a stream object derived from ByteIO.
AipsIO & put(uInt nrval, const DComplex *values, Bool putNR=True)
AipsIO & getnew(uInt &nrval, Complex *&values)
AipsIO & get(uInt nrval, unsigned int *values)
uInt level_p
Nested object level.
AipsIO & get(uInt nrval, unsigned short *values)
String objectType_p
The cached object type.
ByteIO::OpenOption fopt_p
File open option.
AipsIO(const String &fileName, ByteIO::OpenOption=ByteIO::Old, uInt filebufSize=65536, const std::shared_ptr< MultiFileBase > &=std::shared_ptr< MultiFileBase >())
Construct and open/create a file with the given name.
AipsIO & put(uInt nrval, const unsigned short *values, Bool putNR=True)
void testgetLength()
Test if get did not exceed object.
Int64 getpos()
Get and set file-offset.
Bool hasCachedType_p
True = the object type has already been read.
int swget_p
<0 = not opened for get 0 = no getstart done >0 = get is possible
AipsIO & get(uInt nrval, float *values)
uInt putend()
End putting an object.
AipsIO & put(uInt nrval, const String *values, Bool putNR=True)
Bool seekable_p
Is the file is seekable?
AipsIO & getnew(uInt &nrval, Char *&values)
AipsIO & getnew(uInt &nrval, uChar *&values)
AipsIO & get(uInt nrval, Complex *values)
AipsIO & get(uInt nrval, double *values)
void testputerr()
Throw exception for testput.
AipsIO & getnew(uInt &nrval, short *&values)
AipsIO & put(const vector< Bool > &vec)
AipsIO & operator=(const AipsIO &)=delete
AipsIO & put(uInt nrval, const Int64 *values, Bool putNR=True)
Int opened_p
1 = file was opened by AipsIO 0 = file not opened -1 = file opened by user (=fd passed)
void open(const std::shared_ptr< ByteIO > &)
Open by connecting to the given byte stream.
AipsIO & getnew(uInt &nrval, DComplex *&values)
uInt maxlev_p
Current size of objlen and objptr.
AipsIO & operator<<(const Bool &value)
Put a single value.
AipsIO & put(uInt nrval, const uInt64 *values, Bool putNR=True)
AipsIO & get(uInt nrval, String *values)
AipsIO & put(uInt nrval, const Complex *values, Bool putNR=True)
std::shared_ptr< TypeIO > io_p
The actual IO object.
AipsIO & getnew(uInt &nrval, unsigned short *&values)
const String & getNextType()
Get the type of the next object stored.
uInt putstart(const Char *objectType, uInt objectVersion)
AipsIO & getnew(uInt &nrval, String *&values)
void testgeterrLength()
Throw exception for testgetLength.
AipsIO & get(vector< T > &vec)
Get a vector as an array of values (similar to getnew).
void open(const String &fileName, ByteIO::OpenOption=ByteIO::Old, uInt filebufSize=65536, const std::shared_ptr< MultiFileBase > &=std::shared_ptr< MultiFileBase >())
Open/create file (either a regular file or a MultiFileBase virtual file).
Int64 setpos(Int64 offset)
AipsIO & operator>>(Bool &value)
Get a single value.
AipsIO & get(uInt nrval, int *values)
AipsIO & get(uInt nrval, DComplex *values)
uInt putstart(const String &objectType, uInt objectVersion)
Start putting an object.
AipsIO & getnew(uInt &nrval, unsigned int *&values)
AipsIO & getnew(uInt &nrval, int *&values)
AipsIO & get(uInt nrval, Char *values)
AipsIO & getnew(uInt &nrval, Bool *&values)
Read in values as written by the function put.
AipsIO & get(uInt nrval, Bool *values)
Read in nrval values into the user-supplied values buffer.
AipsIO(const std::shared_ptr< TypeIO > &)
Construct from a stream object derived from TypeIO, thus from a stream on top of ByteIOn doing the po...
~AipsIO()
Close if not done yet.
AipsIO & getnew(uInt &nrval, double *&values)
AipsIO & get(vector< Bool > &vec)
Block< uInt > objlen_p
Object length at each level.
Block< uInt > objtln_p
Object length to be read at each level.
AipsIO & put(uInt nrval, const int *values, Bool putNR=True)
AipsIO & put(uInt nrval, const double *values, Bool putNR=True)
AipsIO & put(uInt nrval, const float *values, Bool putNR=True)
AipsIO & put(uInt nrval, const short *values, Bool putNR=True)
void testgeterr()
Throw exception for testget.
AipsIO & get(uInt nrval, uChar *values)
void testget()
Test if get is possible (throw exception if not).
int swput_p
<0 = not opened for put 0 = no putstart done >0 = put is possible
AipsIO & put(uInt nrval, const Bool *values, Bool putNR=True)
Put an array of values with the given number of values.
AipsIO & put(const vector< T > &vec)
Put a vector as an array of values For standard types it has the same result as put with putNR=True.
AipsIO & getnew(uInt &nrval, float *&values)
AipsIO(const AipsIO &)=delete
Copy constructor and assignment are not allowed.
uInt getend()
End reading an object.
AipsIO & getnew(uInt &nrval, Int64 *&values)
AipsIO & get(uInt nrval, short *values)
AipsIO & put(uInt nrval, const uChar *values, Bool putNR=True)
void openInit(ByteIO::OpenOption)
Initialize everything for the open.
static const uInt magicval_p
magic value to check sync.
void open(const std::shared_ptr< TypeIO > &)
Open by connecting to the given typed byte stream.
Block< Int64 > objptr_p
Offset of length at each level.
void close()
Close file opened.
OpenOption
Define the possible ByteIO open options.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned long long uInt64