Loading...
Searching...
No Matches
casacore::AipsIO Class Reference
casa package (libcasa_casa) » IO_module

More...

`#include <AipsIO.h>`

## Public Member Functions

| AipsIO ()
| No file attached yet.
| 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 (const std::shared_ptr< ByteIO > &)
| Construct from a stream object derived from ByteIO.
| AipsIO (const std::shared_ptr< TypeIO > &)
| Construct from a stream object derived from TypeIO, thus from a stream on top of ByteIOn doing the possible conversions.
| ~AipsIO ()
| Close if not done yet.
| AipsIO (const AipsIO &)=delete
| Copy constructor and assignment are not allowed.
AipsIO & | operator= (const AipsIO &)=delete
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).
void | open (const std::shared_ptr< ByteIO > &)
| Open by connecting to the given byte stream.
void | open (const std::shared_ptr< TypeIO > &)
| Open by connecting to the given typed byte stream.
void | close ()
| Close file opened.
ByteIO::OpenOption | fileOption () const
| Return the file option.
uInt | putstart (const String &objectType, uInt objectVersion)
| Start putting an object.
uInt | putstart (const Char *objectType, uInt objectVersion)
AipsIO & | operator<< (const Bool &value)
| Put a single value.
AipsIO & | operator<< (const Char &value)
AipsIO & | operator<< (const uChar &value)
AipsIO & | operator<< (const short &value)
AipsIO & | operator<< (const unsigned short &value)
AipsIO & | operator<< (const int &value)
AipsIO & | operator<< (const unsigned int &value)
AipsIO & | operator<< (const Int64 &value)
AipsIO & | operator<< (const uInt64 &value)
AipsIO & | operator<< (const float &value)
AipsIO & | operator<< (const double &value)
AipsIO & | operator<< (const Complex &value)
AipsIO & | operator<< (const DComplex &value)
AipsIO & | operator<< (const String &value)
AipsIO & | operator<< (const Char *value)
AipsIO & | put (uInt nrval, const Bool *values, Bool putNR=True)
| Put an array of values with the given number of values.
AipsIO & | put (uInt nrval, const Char *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const uChar *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const short *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const unsigned short *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const int *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const unsigned int *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const Int64 *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const uInt64 *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const float *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const double *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const Complex *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const DComplex *values, Bool putNR=True)
AipsIO & | put (uInt nrval, const String *values, Bool putNR=True)
template<typename T>
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 & | put (const vector< Bool > &vec)
uInt | putend ()
| End putting an object.
Int64 | getpos ()
| Get and set file-offset.
Int64 | setpos (Int64 offset)
const String & | getNextType ()
| Get the type of the next object stored.
uInt | getstart (const String &objectType)
| Start reading an object.
uInt | getstart (const Char *objectType)
AipsIO & | operator>> (Bool &value)
| Get a single value.
AipsIO & | operator>> (Char &value)
AipsIO & | operator>> (uChar &value)
AipsIO & | operator>> (short &value)
AipsIO & | operator>> (unsigned short &value)
AipsIO & | operator>> (int &value)
AipsIO & | operator>> (unsigned int &value)
AipsIO & | operator>> (Int64 &value)
AipsIO & | operator>> (uInt64 &value)
AipsIO & | operator>> (float &value)
AipsIO & | operator>> (double &value)
AipsIO & | operator>> (Complex &value)
AipsIO & | operator>> (DComplex &value)
AipsIO & | operator>> (String &value)
AipsIO & | get (uInt nrval, Bool *values)
| Read in nrval values into the user-supplied values buffer.
AipsIO & | get (uInt nrval, Char *values)
AipsIO & | get (uInt nrval, uChar *values)
AipsIO & | get (uInt nrval, short *values)
AipsIO & | get (uInt nrval, unsigned short *values)
AipsIO & | get (uInt nrval, int *values)
AipsIO & | get (uInt nrval, unsigned int *values)
AipsIO & | get (uInt nrval, Int64 *values)
AipsIO & | get (uInt nrval, uInt64 *values)
AipsIO & | get (uInt nrval, float *values)
AipsIO & | get (uInt nrval, double *values)
AipsIO & | get (uInt nrval, Complex *values)
AipsIO & | get (uInt nrval, DComplex *values)
AipsIO & | get (uInt nrval, String *values)
template<typename T>
AipsIO & | get (vector< T > &vec)
| Get a vector as an array of values (similar to getnew).
AipsIO & | get (vector< Bool > &vec)
AipsIO & | getnew (uInt &nrval, Bool *&values)
| Read in values as written by the function put.
AipsIO & | getnew (uInt &nrval, Char *&values)
AipsIO & | getnew (uInt &nrval, uChar *&values)
AipsIO & | getnew (uInt &nrval, short *&values)
AipsIO & | getnew (uInt &nrval, unsigned short *&values)
AipsIO & | getnew (uInt &nrval, int *&values)
AipsIO & | getnew (uInt &nrval, unsigned int *&values)
AipsIO & | getnew (uInt &nrval, Int64 *&values)
AipsIO & | getnew (uInt &nrval, uInt64 *&values)
AipsIO & | getnew (uInt &nrval, float *&values)
AipsIO & | getnew (uInt &nrval, double *&values)
AipsIO & | getnew (uInt &nrval, Complex *&values)
AipsIO & | getnew (uInt &nrval, DComplex *&values)
AipsIO & | getnew (uInt &nrval, String *&values)
uInt | getend ()
| End reading an object.

## Private Member Functions

void | openInit (ByteIO::OpenOption)
| Initialize everything for the open.
void | testput ()
| Test if put is possible (throw exception if not).
void | testget ()
| Test if get is possible (throw exception if not).
void | testgetLength ()
| Test if get did not exceed object.
void | testputerr ()
| Throw exception for testput.
void | testgeterr ()
| Throw exception for testget.
void | testgeterrLength ()
| Throw exception for testgetLength.

## Private Attributes

Int | opened_p
| 1 = file was opened by AipsIO 0 = file not opened -1 = file opened by user (=fd passed)
ByteIO::OpenOption | fopt_p
| File open option.
int | swput_p
| <0 = not opened for put 0 = no putstart done >0 = put is possible
int | swget_p
| <0 = not opened for get 0 = no getstart done >0 = get is possible
uInt | level_p
| Nested object level.
uInt | maxlev_p
| Current size of objlen and objptr.
Block< uInt > | objlen_p
| Object length at each level.
Block< uInt > | objtln_p
| Object length to be read at each level.
Block< Int64 > | objptr_p
| Offset of length at each level.
Bool | hasCachedType_p
| True = the object type has already been read.
String | objectType_p
| The cached object type.
std::shared_ptr< ByteIO > | file_p
| The file object.
std::shared_ptr< TypeIO > | io_p
| The actual IO object.
Bool | seekable_p
| Is the file is seekable?

## Static Private Attributes

static const uInt | magicval_p
| magic value to check sync.

## Detailed Description

AipsIO is the object persistency mechanism of Casacore

### Intended use:

Public interface

### Review Status

Reviewed By:
  ghunt
Date Reviewed:
  95Feb21

### Etymology

AipsIO is simply the conventional shorthand for "AIPS++ input/output". Note that Casacore is the successor of the old AIPS++ project.

### Synopsis

AipsIO is a class designed to do I/O for objects. It reads/writes the data using a class derived from TypeIO. For instance, class CanonicalIO can be used to read/write the data in canonical format.

The TypeIO class in its turn uses a class derived from ByteIO to determine where the data has to be written.

An object is written by writing all its data members. It will be preceeded by a header containing type and version. The I/O can be done via de overloaded << and >> operators to write or read a single item (e.g., an int or an object). These operators are already defined for all built-in data types and for Complex, DComplex, String, and Bool. Since each enumeration is a specific type, it is hard to handle them. Casting to Bool (which is also an enumerated type) is a possibility, but that assumes that each enumerated type has the same size (which is probably true for all compilers). Another possibility is to store it in an int when writing. Reading can be done the opposite way, although the ARM says that an int cannot be assigned to an enumerated type.

There are also functions put, get and getnew to write or read an array of values. These functions are defined for the same data types as << and >> (so one can write, for example, an array of Strings). AipsIO.put (nr, arr) writes nr values from the given array. AipsIO.get (nr, arr) reads nr values into the given user-supplied array. AipsIO.getnew (&nr, &arr) reads the number of values written into a new array allocated on the heap. It returns the nr of values read and a pointer to the array. The data must be read back in the same order as it was written.

The functions putstart(type,version) and putend() must be called before resp. after writing all values of the object. It stores the given type and version of the object. Similarly getstart(type) and getend() must be called. getstart checks the type and returns the version. By using the version the read function of the object can convert older versions of the object (which may still reside on disk) to the latest version. The function getNextType is available to get the type of the next object stored. This can be used to check the type or to open (i.e. issue a getstart) in the correct way.

When implementing a class, one should also define the operators << and >> for the class to allow users to write or read an object in this simple way (e.g., as io >> obj; to read an object). One has to define the friend functions:

friend AipsIO& operator<< (AipsIO&, const YourClass&);
friend AipsIO& operator>> (AipsIO&, YourClass&);
casacore::AipsIO::AipsIO
AipsIO()
No file attached yet.
casacore::AipsIO::operator<<
AipsIO & operator<<(const Bool &value)
Put a single value.
casacore::AipsIO::operator>>
AipsIO & operator>>(Bool &value)
Get a single value.

since they cannot be stored in the class itself. The type of an object is usually passed as the class name.

AipsIO& operator<< (AipsIO& ios, const YourClass& object) {
ios.putstart ("YourClass", version);
ios <<....;
ios.putend ();
}
casacore::AipsIO::putend
uInt putend()
End putting an object.
casacore::AipsIO::putstart
uInt putstart(const String &objectType, uInt objectVersion)
Start putting an object.

The functions getpos() and setpos(offset) can be used to get and set the offset in the file to a given point. They can be used to point to a position in the file where an object must be written or read. Obviously these functions are to be used by a storage manager and are not for public use. Someday they should be made private with a friend defined.

### Example

MyClass myObject(...); // some object
AipsIO ios("file.name", ByteIO::New); // create new file
ios << myObject; // write object
MyClass myObject2;
ios >> myObject2; // read it back
casacore::ByteIO::New
@ New
read/write; create file if not exist.
Definition ByteIO.h:70

This example creates an object, writes it to AipsIO and reads it back into another object. The shift functions for MyClass could be defined as follows:

AipsIO& operator<< (AipsIO& ios, const MyClass& myObject)
{
ios.putstart ("MyClass", 1); // MyClass version 1
ios <<...; // write all data members
ios.putend();
}
AipsIO& operator>> (AipsIO& ios, const MyClass& myObject)
{
// If needed, delete current data members first.
// Now read in the object.
uInt version = ios.getstart ("MyClass");
ios >>...; // read all data members
ios.getend();
}
casacore::AipsIO
Definition AipsIO.h:167
casacore::AipsIO::getstart
uInt getstart(const String &objectType)
Start reading an object.
casacore::AipsIO::getend
uInt getend()
End reading an object.
casacore::uInt
unsigned int uInt
Definition aipstype.h:49

In this example the version is not used. In more complex objects it will probably be used when data members get added or changed in future versions of a software system.

Definition at line 166 of file AipsIO.h.

## Constructor & Destructor Documentation

## AipsIO() [1/5]

casacore::AipsIO::AipsIO | ( |  | ) |

No file attached yet.

Referenced by AipsIO(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), getnew(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator=(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), put(), and put().

## AipsIO() [2/5]

casacore::AipsIO::AipsIO | ( | const String & | fileName,
|  | ByteIO::OpenOption | = ByteIO::Old,
|  | uInt | filebufSize = 65536,
|  | const std::shared_ptr< MultiFileBase > & | = std::shared_ptr< MultiFileBase >() )

explicit

Construct and open/create a file with the given name.

The actual IO is done via a CanonicalIO object on a regular file using buffered IO with a buffer of the given size.
If the MultiFileBase pointer is not null, a virtual file in the MultiFileBase will be used instead of a regular file.

References casacore::ByteIO::Old.

## AipsIO() [3/5]

casacore::AipsIO::AipsIO | ( | const std::shared_ptr< ByteIO > & |  | ) |

explicit

Construct from a stream object derived from ByteIO.

This can for instance by used to use AipsIO on a file descriptor for which a FilebufIO object has been created. The actual IO is done via a CanonicalIO object on top of it.

## AipsIO() [4/5]

casacore::AipsIO::AipsIO | ( | const std::shared_ptr< TypeIO > & |  | ) |

explicit

Construct from a stream object derived from TypeIO, thus from a stream on top of ByteIOn doing the possible conversions.

## ~AipsIO()

casacore::AipsIO::~AipsIO | ( |  | ) |

Close if not done yet.

## AipsIO() [5/5]

casacore::AipsIO::AipsIO | ( | const AipsIO & |  | ) |

delete

Copy constructor and assignment are not allowed.

References AipsIO().

## Member Function Documentation

## close()

void casacore::AipsIO::close | ( |  | ) |

Close file opened.

## fileOption()

ByteIO::OpenOption casacore::AipsIO::fileOption | ( |  | ) | const

inline

Return the file option.

Definition at line 470 of file AipsIO.h.

References fopt_p.

## get() [1/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | Bool * | values )

Read in nrval values into the user-supplied values buffer.

The buffer must be long enough.

References AipsIO().

## get() [2/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | Char * | values )

References AipsIO().

## get() [3/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | Complex * | values )

References AipsIO().

## get() [4/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | DComplex * | values )

References AipsIO().

## get() [5/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | double * | values )

References AipsIO().

## get() [6/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | float * | values )

References AipsIO().

## get() [7/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | int * | values )

References AipsIO().

## get() [8/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | Int64 * | values )

References AipsIO().

## get() [9/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | short * | values )

References AipsIO().

## get() [10/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | String * | values )

References AipsIO().

## get() [11/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | uChar * | values )

References AipsIO().

## get() [12/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | uInt64 * | values )

References AipsIO().

## get() [13/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | unsigned int * | values )

References AipsIO().

## get() [14/16]

AipsIO & casacore::AipsIO::get | ( | uInt | nrval,
|  | unsigned short * | values )

References AipsIO().

## get() [15/16]

AipsIO & casacore::AipsIO::get | ( | vector< Bool > & | vec | ) |

References AipsIO().

## get() [16/16]

template<typename T>

AipsIO & casacore::AipsIO::get | ( | vector< T > & | vec | ) |

inline

Get a vector as an array of values (similar to getnew).

It resizes the vector as needed.

Definition at line 362 of file AipsIO.h.

References AipsIO().

## getend()

uInt casacore::AipsIO::getend | ( |  | ) |

End reading an object.

It returns the object length (including possible nested objects). It checks if the entire object has been read (to keep the data stream in sync). If not, an exception is thrown.

## getnew() [1/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | Bool *& | values )

Read in values as written by the function put.

It will read the number of values (into nrval), allocate a values buffer of that length and read the values into that buffer. A pointer to the buffer is returned into values. <warn=caution> Although the buffer is allocated by this function, the user has to delete it (using delete [] values;).

References AipsIO().

## getnew() [2/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | Char *& | values )

References AipsIO().

## getnew() [3/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | Complex *& | values )

References AipsIO().

## getnew() [4/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | DComplex *& | values )

References AipsIO().

## getnew() [5/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | double *& | values )

References AipsIO().

## getnew() [6/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | float *& | values )

References AipsIO().

## getnew() [7/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | int *& | values )

References AipsIO().

## getnew() [8/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | Int64 *& | values )

References AipsIO().

## getnew() [9/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | short *& | values )

References AipsIO().

## getnew() [10/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | String *& | values )

References AipsIO().

## getnew() [11/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | uChar *& | values )

References AipsIO().

## getnew() [12/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | uInt64 *& | values )

References AipsIO().

## getnew() [13/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | unsigned int *& | values )

References AipsIO().

## getnew() [14/14]

AipsIO & casacore::AipsIO::getnew | ( | uInt & | nrval,
|  | unsigned short *& | values )

References AipsIO().

## getNextType()

const String & casacore::AipsIO::getNextType | ( |  | ) |

Get the type of the next object stored.

This is not possible if a put is in progress.

## getpos()

Int64 casacore::AipsIO::getpos | ( |  | ) |

Get and set file-offset.

## getstart() [1/2]

uInt casacore::AipsIO::getstart | ( | const Char * | objectType | ) |

## getstart() [2/2]

uInt casacore::AipsIO::getstart | ( | const String & | objectType | ) |

Start reading an object.

It will check if the given type matches the one stored by putstart. It returns the object version which can be used to read in older version of the object correctly.
After all values (inclusing nested objects) of the object have been read, a call to getend has to be done.

## open() [1/3]

void casacore::AipsIO::open | ( | const std::shared_ptr< ByteIO > & |  | ) |

Open by connecting to the given byte stream.

This can for instance by used to use AipsIO on a file descriptor for which a FilebufIO object has been created. The actual IO is done via a CanonicalIO object on top of it. An exception is thrown if the object contains an already open file.

## open() [2/3]

void casacore::AipsIO::open | ( | const std::shared_ptr< TypeIO > & |  | ) |

Open by connecting to the given typed byte stream.

An exception is thrown if the object contains an already open file.

## open() [3/3]

void casacore::AipsIO::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).

An exception is thrown if the object contains an already open file.

References casacore::ByteIO::Old.

## openInit()

void casacore::AipsIO::openInit | ( | ByteIO::OpenOption |  | ) |

private

Initialize everything for the open.

It checks if there is no outstanding open file.

## operator<<() [1/15]

AipsIO & casacore::AipsIO::operator<< | ( | const Bool & | value | ) |

Put a single value.

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [2/15]

AipsIO & casacore::AipsIO::operator<< | ( | const Char & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [3/15]

AipsIO & casacore::AipsIO::operator<< | ( | const Char * | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [4/15]

AipsIO & casacore::AipsIO::operator<< | ( | const Complex & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [5/15]

AipsIO & casacore::AipsIO::operator<< | ( | const DComplex & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [6/15]

AipsIO & casacore::AipsIO::operator<< | ( | const double & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [7/15]

AipsIO & casacore::AipsIO::operator<< | ( | const float & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [8/15]

AipsIO & casacore::AipsIO::operator<< | ( | const int & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [9/15]

AipsIO & casacore::AipsIO::operator<< | ( | const Int64 & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [10/15]

AipsIO & casacore::AipsIO::operator<< | ( | const short & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [11/15]

AipsIO & casacore::AipsIO::operator<< | ( | const String & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [12/15]

AipsIO & casacore::AipsIO::operator<< | ( | const uChar & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [13/15]

AipsIO & casacore::AipsIO::operator<< | ( | const uInt64 & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [14/15]

AipsIO & casacore::AipsIO::operator<< | ( | const unsigned int & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator<<() [15/15]

AipsIO & casacore::AipsIO::operator<< | ( | const unsigned short & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator=()

AipsIO & casacore::AipsIO::operator= | ( | const AipsIO & |  | ) |

delete

References AipsIO().

## operator>>() [1/14]

AipsIO & casacore::AipsIO::operator>> | ( | Bool & | value | ) |

Get a single value.

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [2/14]

AipsIO & casacore::AipsIO::operator>> | ( | Char & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [3/14]

AipsIO & casacore::AipsIO::operator>> | ( | Complex & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [4/14]

AipsIO & casacore::AipsIO::operator>> | ( | DComplex & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [5/14]

AipsIO & casacore::AipsIO::operator>> | ( | double & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [6/14]

AipsIO & casacore::AipsIO::operator>> | ( | float & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [7/14]

AipsIO & casacore::AipsIO::operator>> | ( | int & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [8/14]

AipsIO & casacore::AipsIO::operator>> | ( | Int64 & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [9/14]

AipsIO & casacore::AipsIO::operator>> | ( | short & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [10/14]

AipsIO & casacore::AipsIO::operator>> | ( | String & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [11/14]

AipsIO & casacore::AipsIO::operator>> | ( | uChar & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [12/14]

AipsIO & casacore::AipsIO::operator>> | ( | uInt64 & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [13/14]

AipsIO & casacore::AipsIO::operator>> | ( | unsigned int & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## operator>>() [14/14]

AipsIO & casacore::AipsIO::operator>> | ( | unsigned short & | value | ) |

References AipsIO(), and casacore::NewDelAllocator< T >::value.

## put() [1/16]

AipsIO & casacore::AipsIO::put | ( | const vector< Bool > & | vec | ) |

References AipsIO().

## put() [2/16]

template<typename T>

AipsIO & casacore::AipsIO::put | ( | const vector< T > & | vec | ) |

inline

Put a vector as an array of values For standard types it has the same result as put with putNR=True.

Definition at line 284 of file AipsIO.h.

References AipsIO().

## put() [3/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const Bool * | values,
|  | Bool | putNR = True )

Put an array of values with the given number of values.

If the flag putNr is set, the number of values is put first.

References AipsIO(), and casacore::True.

## put() [4/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const Char * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [5/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const Complex * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [6/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const DComplex * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [7/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const double * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [8/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const float * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [9/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const int * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [10/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const Int64 * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [11/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const short * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [12/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const String * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [13/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const uChar * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [14/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const uInt64 * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [15/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const unsigned int * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## put() [16/16]

AipsIO & casacore::AipsIO::put | ( | uInt | nrval,
|  | const unsigned short * | values,
|  | Bool | putNR = True )

References AipsIO(), and casacore::True.

## putend()

uInt casacore::AipsIO::putend | ( |  | ) |

End putting an object.

It returns the object length (including possible nested objects).

## putstart() [1/2]

uInt casacore::AipsIO::putstart | ( | const Char * | objectType,
|  | uInt | objectVersion )

## putstart() [2/2]

uInt casacore::AipsIO::putstart | ( | const String & | objectType,
|  | uInt | objectVersion )

Start putting an object.

This writes the object type and version. When reading back getstart calls have to be done in the same way. Getstart checks the type and returns the version. The user can use that to correctly read back objects with different versions.
Data in the outermost object cannot be put before a putstart is done. Data in nested objects can be put without an intermediate putstart. However, for complex objects it is recommended to do a putstart to have a better checking.
After all values (inclusing nested objects) of the object have been put, a call to putend has to be done.

## setpos()

Int64 casacore::AipsIO::setpos | ( | Int64 | offset | ) |

References casacore::offset().

## testget()

void casacore::AipsIO::testget | ( |  | ) |

inline private

Test if get is possible (throw exception if not).

Definition at line 483 of file AipsIO.h.

References swget_p, and testgeterr().

## testgeterr()

void casacore::AipsIO::testgeterr | ( |  | ) |

private

Throw exception for testget.

Referenced by testget().

## testgeterrLength()

void casacore::AipsIO::testgeterrLength | ( |  | ) |

private

Throw exception for testgetLength.

Referenced by testgetLength().

## testgetLength()

void casacore::AipsIO::testgetLength | ( |  | ) |

inline private

Test if get did not exceed object.

Definition at line 489 of file AipsIO.h.

References level_p, objlen_p, objtln_p, and testgeterrLength().

## testput()

void casacore::AipsIO::testput | ( |  | ) |

inline private

Test if put is possible (throw exception if not).

testput tests if a put can be done; ie.

if putstart has been done. It throws an exception if not. testget is similar to test if a get can be done.

Definition at line 477 of file AipsIO.h.

References swput_p, and testputerr().

## testputerr()

void casacore::AipsIO::testputerr | ( |  | ) |

private

Throw exception for testput.

Referenced by testput().

## Member Data Documentation

## file_p

std::shared_ptr<ByteIO> casacore::AipsIO::file_p

private

The file object.

Definition at line 458 of file AipsIO.h.

## fopt_p

ByteIO::OpenOption casacore::AipsIO::fopt_p

private

File open option.

Definition at line 434 of file AipsIO.h.

Referenced by fileOption().

## hasCachedType_p

Bool casacore::AipsIO::hasCachedType_p

private

True = the object type has already been read.

Definition at line 454 of file AipsIO.h.

## io_p

std::shared_ptr<TypeIO> casacore::AipsIO::io_p

private

The actual IO object.

Definition at line 460 of file AipsIO.h.

## level_p

uInt casacore::AipsIO::level_p

private

Nested object level.

Definition at line 444 of file AipsIO.h.

Referenced by testgetLength().

## magicval_p

const uInt casacore::AipsIO::magicval_p

static private

magic value to check sync.

Definition at line 464 of file AipsIO.h.

## maxlev_p

uInt casacore::AipsIO::maxlev_p

private

Current size of objlen and objptr.

Definition at line 446 of file AipsIO.h.

## objectType_p

String casacore::AipsIO::objectType_p

private

The cached object type.

Definition at line 456 of file AipsIO.h.

## objlen_p

Block<uInt> casacore::AipsIO::objlen_p

private

Object length at each level.

Definition at line 448 of file AipsIO.h.

Referenced by testgetLength().

## objptr_p

Block<Int64> casacore::AipsIO::objptr_p

private

Offset of length at each level.

Definition at line 452 of file AipsIO.h.

## objtln_p

Block<uInt> casacore::AipsIO::objtln_p

private

Object length to be read at each level.

Definition at line 450 of file AipsIO.h.

Referenced by testgetLength().

## opened_p

Int casacore::AipsIO::opened_p

private

1 = file was opened by AipsIO 0 = file not opened -1 = file opened by user (=fd passed)

Definition at line 432 of file AipsIO.h.

## seekable_p

Bool casacore::AipsIO::seekable_p

private

Is the file is seekable?

Definition at line 462 of file AipsIO.h.

## swget_p

int casacore::AipsIO::swget_p

private

<0 = not opened for get 0 = no getstart done >0 = get is possible

Definition at line 442 of file AipsIO.h.

Referenced by testget().

## swput_p

int casacore::AipsIO::swput_p

private

<0 = not opened for put 0 = no putstart done >0 = put is possible

Definition at line 438 of file AipsIO.h.

Referenced by testput().

The documentation for this class was generated from the following file:

- casa/IO/AipsIO.h