(omt_version 5 0)
#  %W% %G%  

(omt_module
 (key 1)
 (anno target_file IO_1.cc)
 (name IO_1)
 (language C++)
 (fcode_max 1002)
 (omt_model
  (omt_class
   (key 3)
   (anno description "This is the base class for Sink and Source")
   (name BaseSinkSource)
   (method
    (key 169)
    (anno description "This functions returns a reference to itsTypeIO")
    (name getTypeIO)
    (type TypeIO))
   (method
    (key 177)
    (anno description "This function sets the position on the given offset.
The seek option defines from which file position the seek is done.")
    (name seek)
    (type Long)
    (arglist
     (arg
      (key 178)
      (name offset))
     (arg
      (key 179)
      (name SeekOption)))
    (genheader "Long BaseSinkSource::seek (void* offset,void* seekOption)
"))
   (method
    (key 180)
    (anno description "This function checks if one can read a device")
    (anno const YES)
    (name isReadable)
    (type Bool)
    (genheader "Bool BaseSinkSource::isReadable ()
"))
   (method
    (key 181)
    (anno const YES)
    (anno description "This function checks if one can write a device")
    (name isWritable)
    (type Bool))
   (method
    (key 182)
    (anno const YES)
    (anno description "This function checks if one can seek in a device")
    (name isSeekable)
    (type Bool)))
  (omt_class
   (key 8)
   (anno description "This class is made to do the type dependant IO.

This class is a baseclass which can be derived from.
The functions in this class are virtual functions to read and to write bytes from or to a file.
The derived classes represent a typical IO like RawIO, AsciiIO or CanonicalIO.
In these derived classes there could be a translation, if  needed, before the data is written to a file.
If it is necessary there could be made more derived classes like IBMIO each for specific IO.
")
   (name TypeIO)
   (method
    (key 191)
    (anno description Constructor)
    (arglist
     (arg
      (key 223)
      (name ByteIO*))))
   (method
    (key 193)
    (anno virtual_method YES)
    (anno description "These functions write a stream of bytes.
")
    (name write)
    (type uInt)
    (arglist
     (arg
      (key 194)
      (name nvalues))
     (arg
      (key 195)
      (name " value*"))))
   (method
    (key 196)
    (anno virtual_method YES)
    (anno description "These functions read a stream of bytes.")
    (name read)
    (type uInt)
    (arglist
     (arg
      (key 197)
      (name nvalues))
     (arg
      (key 198)
      (name value*))))
   (method
    (key 199)
    (anno description "This function sets the position on the given offset.
The seek option defines from which file position the seek is done.")
    (name seek)
    (type Long)
    (arglist
     (arg
      (key 200)
      (name offset))
     (arg
      (key 201)
      (name SeekOption))))
   (method
    (key 202)
    (anno const YES)
    (anno description "This function checks if one can read a device")
    (name isReadable)
    (type Bool))
   (method
    (key 203)
    (anno const YES)
    (anno description "This function checks if one can write a device")
    (name isWritable)
    (type Bool))
   (method
    (key 204)
    (anno const YES)
    (anno description "This function checks if one can seek in a device")
    (name isSeekable)
    (type Bool)))
  (omt_class
   (key 20)
   (anno description "A ByteSink is a place where bytes are written to")
   (name ByteSink)
   (method
    (key 170)
    (anno description "constructor, TypeIO should be given.")
    (arglist
     (arg
      (key 224)
      (name TypeIO*))))
   (method
    (key 172)
    (anno description "These functions write one variable")
    (name operator<<)
    (type ByteSink)
    (arglist
     (arg
      (key 246)
      (name value))))
   (method
    (key 174)
    (anno description "These functions write an array of variables")
    (name write)
    (type void)
    (arglist
     (arg
      (key 175)
      (name nvalues))
     (arg
      (key 176)
      (name value*)))))
  (omt_class
   (key 21)
   (anno description "A source is a place where one can read bytes from.")
   (name ByteSource)
   (method
    (key 184)
    (anno description "constructor, TypeIO should be given.")
    (arglist
     (arg
      (key 333)
      (name TypeIO*))))
   (method
    (key 186)
    (anno description "These functions read one variable.
The buffer should contain enough space to read the value.")
    (name operator>>)
    (type ByteSource)
    (arglist
     (arg
      (key 259)
      (name value))))
   (method
    (key 188)
    (anno description "These functions read an array of variables.
the buffer should contain enough space to read the values.")
    (name read)
    (type void)
    (arglist
     (arg
      (key 189)
      (name nvalues))
     (arg
      (key 190)
      (name value*)))))
  (omt_class
   (key 22)
   (anno description "This class is the base class for writing streams of bytes to a device.

The derived class should be each for a particular device.
This class also contains virtual functions for checking if the device is readable, writable or seekable.
The derived classes could be regularFileIO, StringIO or TapeIO.
RegularFileIO is implemented now, other derived classes can be added easy later.")
   (name ByteIO)
   (method
    (key 141)
    (anno virtual_method YES)
    (anno description "These functions read or write streams of bytes to a particular device")
    (name write)
    (type void)
    (arglist
     (arg
      (key 163)
      (name size))
     (arg
      (key 164)
      (name buf*))))
   (method
    (key 144)
    (anno virtual_method YES)
    (anno description "")
    (name read)
    (type void)
    (arglist
     (arg
      (key 165)
      (name size))
     (arg
      (key 166)
      (name buf*))))
   (method
    (key 147)
    (anno description "This function sets the position on the given offset.
The seek option defines from which file position the seek is done.")
    (name seek)
    (type Long)
    (arglist
     (arg
      (key 148)
      (name offset))
     (arg
      (key 149)
      (name SeekOption))))
   (method
    (key 150)
    (anno virtual_method YES)
    (anno const YES)
    (anno description "This function checks if one can read a device")
    (name isReadable)
    (type Bool))
   (method
    (key 151)
    (anno virtual_method YES)
    (anno const YES)
    (anno description "This function checks if one can write a device")
    (name isWritable)
    (type Bool))
   (method
    (key 152)
    (anno virtual_method YES)
    (anno const YES)
    (anno description "This function checks if one can seek in a device")
    (name isSeekable)
    (type "Bool ")))
  (omt_class
   (key 19)
   (anno description "This class is made to do the OS- and device-independent IO .

With this class it is possible to do IO without making specific translations for each kind or type of file. 
This class uses the class TypeIO to do the specific translations and the class TypeIO uses the class ByteIO to write it to a specific file or device. 
This class should be constructed with a TypeIO. 
The variable itsTypeIO is stored in the BaseSinkSource class. 
Reading or writing only should be done with the Sink or Source  class. 
For a description of specific functions you should look in  Sink, Source or the Base SinkSource.

Example:
// main 
// {
//	Bool* bool = new Bool(True);
// 	RegularFileIO regularFileIO (Path(\"test.dat\"));
//	CanonicalIO canonicalIO(&regularFileIO);
//	SinkSource  sinkSource(&canonicalIO);
//	sinkSource << *bool;    // Write a boolean
//	sinkSource >> *bool;    // Read a boolean
//	cout << bool << endl;   // Print the boolean  
// }
")
   (name ByteSinkSource)
   (method
    (key 205)
    (anno description "constructor, TypeIO should be given.")
    (arglist
     (arg
      (key 226)
      (name TypeIO*)))))
  (omt_class
   (key 80)
   (anno description "This class is made to do canonical IO with a device.
This class translates the data, when needed, so it is made possible to do IO with different devices.")
   (name CanonicalIO)
   (method
    (key 213)
    (anno description "Constructor.

Sets itsByteIO and allocates memory for itsBuffer with a length of bufferLength. 
The buffer is initialy 100 bytes long but it can be made smaller or longer by giving another value for bufferLength.")
    (arglist
     (arg
      (key 231)
      (name ByteIO*))
     (arg
      (key 232)
      (name bufferLength))))
   (field
    (key 87)
    (anno cxx_field_access private)
    (anno description "")
    (name itsBuffer)
    (type char*))
   (field
    (key 88)
    (anno cxx_field_access private)
    (anno description "")
    (name itsBufferLength)
    (type uInt)))
  (omt_class
   (key 89)
   (anno cxx_field_access private)
   (anno description "This class is made to do Raw IO with a device. 
This class translates the data, when needed, so it is made possible to do IO with different devices.")
   (name RawIO)
   (method
    (key 216)
    (anno description "Constructor, sets itsByteIO.")
    (arglist
     (arg
      (key 233)
      (name ByteIO*)))))
  (omt_class
   (key 237)
   (anno cxx_field_access private)
   (anno description "")
   (name AipsIO)
   (method
    (key 238)
    (anno description "Construct and open/create a file with the given name.
The actual IO is done via a TypeIO object using a filebuf with a buffer of the given size.")
    (arglist
     (arg
      (key 308)
      (name fileName))
     (arg
      (key 309)
      (name ByteIO)
      (type OpenOption))
     (arg
      (key 310)
      (name filebufSize))))
   (method
    (key 242)
    (anno description "Construct and open by connecting to the given file descriptor.
The actual IO is done via a filebuf object with a buffer of the given size.")
    (arglist
     (arg
      (key 311)
      (name TypeIO*))
     (arg
      (key 312)
      (name ByteIO)
      (type OpenOption))))
   (method
    (key 313)
    (anno description "")
    (arglist
     (arg
      (key 314)
      (name ByteIO*))
     (arg
      (key 315)
      (name ByteIO)
      (type OpenOption))))
   (method
    (key 316)
    (anno description "")
    (name open)
    (arglist
     (arg
      (key 317)
      (name fileName))
     (arg
      (key 318)
      (name ByteIO)
      (type OpenOption))
     (arg
      (key 319)
      (name filebufSize))))
   (method
    (key 320)
    (anno description "")
    (arglist
     (arg
      (key 321)
      (name TypeIO*))
     (arg
      (key 322)
      (name ByteIO)
      (type OpenOption))))
   (method
    (key 323)
    (anno description "")
    (arglist
     (arg
      (key 324)
      (name ByteIO*))
     (arg
      (key 325)
      (name ByteIO)
      (type OpenOption))))
   (method
    (key 326)
    (anno description "")
    (name close))
   (method
    (key 256)
    (anno description "Return the file option.")
    (name fileOption)
    (type ByteIO::OpenOption))
   (method
    (key 257)
    (anno description "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 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.
")
    (name putstart)
    (type uInt)
    (arglist
     (arg
      (key 263)
      (name objectType))
     (arg
      (key 264)
      (name objectVersion))))
   (method
    (key 265)
    (anno description "Put a single value.")
    (name operator<<)
    (type AipsIO)
    (arglist
     (arg
      (key 266)
      (name value))))
   (method
    (key 267)
    (anno description "Put an array of values with the given number of values.
If the flag putNr is set, the number of values is put first.")
    (name put)
    (type AipsIO)
    (arglist
     (arg
      (key 268)
      (name nrval))
     (arg
      (key 269)
      (name values*))
     (arg
      (key 270)
      (name putNR))))
   (method
    (key 271)
    (anno description "End putting an object.
It returns the object length (including possible nested objects).")
    (name putend)
    (type uInt))
   (method
    (key 272)
    (anno description "Get and set file-offset.")
    (name getpos)
    (type long))
   (method
    (key 327)
    (anno description "")
    (name setpos)
    (type Long)
    (arglist
     (arg
      (key 328)
      (name offset))))
   (method
    (key 274)
    (anno description "Get the type of the next object stored.
This is not possible if a put is in progress.")
    (name getNextType)
    (type String))
   (method
    (key 275)
    (anno description "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.")
    (name getstart)
    (type uInt)
    (arglist
     (arg
      (key 276)
      (name objectType))))
   (method
    (key 277)
    (anno description "Get a single value.")
    (name operator>>)
    (type AipsIO)
    (arglist
     (arg
      (key 278)
      (name value))))
   (method
    (key 279)
    (anno description "Read in nrval values into the user-supplied values buffer.
The buffer must be long enough.")
    (name get)
    (type AipsIO)
    (arglist
     (arg
      (key 280)
      (name nrval))
     (arg
      (key 281)
      (name values*))))
   (method
    (key 282)
    (anno description "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.
Although the buffer is allocated by this function, the user has to delete it (using delete [] values).")
    (name getnew)
    (type AipsIO)
    (arglist
     (arg
      (key 283)
      (name nrval))
     (arg
      (key 284)
      (name values*))))
   (method
    (key 285)
    (anno description "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.")
    (name getend)
    (type uInt)))
  (omt_class
   (key 334)
   (anno description "Class to do conversion in a polymorphic way.")
   (name ConversionIO)
   (method
    (key 335)
    (anno description "")
    (arglist
     (arg
      (key 336)
      (name DataConversion*))
     (arg
      (key 337)
      (name ByteIO*))
     (arg
      (key 338)
      (name bufferLength))))
   (field
    (key 339)
    (anno cxx_field_access private)
    (anno description "")
    (name itsBuffer)
    (type char*))
   (field
    (key 340)
    (anno cxx_field_access private)
    (anno description "")
    (name itsBufferLength)
    (type uInt))
   (field
    (key 341)
    (anno cxx_field_access private)
    (anno description "")
    (name itsSizeT)
    (type uInt))
   (field
    (key 342)
    (anno cxx_field_access private)
    (anno description "")
    (name itsCopyT)
    (type Bool)))
  (omt_class
   (key 343)
   (anno description "")
   (name DataConversion))
  (generalization_relation
   (key 24)
   (superclass 21)
   (subclasses 19))
  (binary_association
   (key 9)
   (anno role1_is_class NO)
   (anno role2_is_class NO)
   (anno description "")
   (name itsTypeIO)
   (role
    (key 10)
    (primary 3)
    (mult 1 2))
   (role
    (key 11)
    (primary 8)
    (is_arrow)
    (mult 1 2)))
  (generalization_relation
   (key 23)
   (superclass 20)
   (subclasses 19))
  (binary_association
   (key 344)
   (anno role1_is_class NO)
   (anno role2_is_class NO)
   (anno description "")
   (name itsByteIO)
   (role
    (key 345)
    (primary 8)
    (mult 1 2))
   (role
    (key 346)
    (primary 22)
    (is_arrow)
    (mult 1 2)))
  (binary_association
   (key 329)
   (anno role1_is_class NO)
   (anno role2_is_class NO)
   (anno description "")
   (name file_p)
   (role
    (key 330)
    (primary 237)
    (mult 1 2))
   (role
    (key 331)
    (primary 22)
    (is_arrow)
    (mult 1 2)))
  (generalization_relation
   (key 347)
   (superclass 8)
   (subclasses 89 80 334))
  (generalization_relation
   (key 118)
   (anno cxx_rel_virtual YES)
   (anno description "")
   (superclass 3)
   (subclasses 21 20))
  (binary_association
   (key 300)
   (anno role1_is_class NO)
   (anno role2_is_class NO)
   (anno description "The actual IO object.")
   (name io_p)
   (role
    (key 301)
    (primary 237)
    (mult 1 2))
   (role
    (key 302)
    (primary 8)
    (is_arrow)
    (mult 1 2)))
  (binary_association
   (key 348)
   (anno role1_is_class NO)
   (anno role2_is_class NO)
   (anno description "")
   (name itsConversion)
   (role
    (key 349)
    (primary 334)
    (mult 1 2))
   (role
    (key 350)
    (primary 343)
    (is_arrow)
    (mult 1 2)))
  (generalization_order
   (subclass 19)
   (generalizations 23 24)))
 (omt_image
  (sheet
   (key 2)
   (anno description "")
   (name OM)
   (model_type Object)
   (width 720)
   (height 790)
   (background_color white)
   (foreground_color black)
   (ClassBox
    (key 245)
    (represents 237)
    (frame
     (loc 6 5)
     (dimensions 276 304)))
   (ClassBox
    (key 13)
    (represents 3)
    (frame
     (loc 413 5)
     (dimensions 181 109)))
   (ClassBox
    (key 121)
    (represents 20)
    (frame
     (loc 519 152)
     (dimensions 169 83)))
   (ClassBox
    (key 125)
    (represents 21)
    (frame
     (loc 308 152)
     (dimensions 185 83)))
   (ClassBox
    (key 126)
    (represents 19)
    (frame
     (loc 452 273)
     (dimensions 107 57)))
   (sheet_comment
    (key 25)
    (text "")
    (loc 235 504))
   (ClassBox
    (key 29)
    (represents 22)
    (frame
     (loc 226 660)
     (dimensions 181 122)))
   (ClassBox
    (key 120)
    (represents 89)
    (frame
     (loc 210 531)
     (dimensions 69 57)))
   (ClassBox
    (key 119)
    (represents 80)
    (frame
     (loc 291 531)
     (dimensions 142 83)))
   (ClassBox
    (key 351)
    (represents 334)
    (frame
     (loc 447 531)
     (dimensions 241 109)))
   (ClassBox
    (key 12)
    (represents 8)
    (frame
     (loc 226 358)
     (dimensions 181 135)))
   (ClassBox
    (key 352)
    (represents 343)
    (frame
     (loc 518 686)
     (dimensions 104 44)))
   (GeneralizationImage
    (key 131)
    (represents 24)
    (supernode 125
     (408 236)
     (408 262))
    (node 126
     (506 264)
     (506 272)))
   (GeneralizationImage
    (key 130)
    (represents 23)
    (supernode 121
     (602 236)
     (602 262))
    (node 126
     (506 264)
     (506 272)))
   (GeneralizationImage
    (key 153)
    (represents 118)
    (supernode 13
     (506 115)
     (506 141))
    (node 121
     (606 143)
     (606 151))
    (node 125
     (409 143)
     (409 151)))
   (AssociationImage
    (key 306)
    (represents 300)
    (nodes 245 12)
    (points
     (125 310)
     (125 368)
     (225 368))
    (arc_name 125 329 1))
   (AssociationImage
    (key 332)
    (represents 329)
    (nodes 245 29)
    (points
     (76 310)
     (76 679)
     (225 679))
    (arc_name 76 329 5))
   (AssociationImage
    (key 14)
    (represents 9)
    (nodes 13 12)
    (points
     (595 55)
     (713 55)
     (713 367)
     (408 367))
    (arc_name 644 55 7))
   (AssociationImage
    (key 353)
    (represents 344)
    (nodes 12 29)
    (points
     (225 384)
     (139 384)
     (139 667)
     (225 667))
    (arc_name 139 402 1))
   (GeneralizationImage
    (key 354)
    (represents 347)
    (supernode 12
     (316 494)
     (316 521))
    (node 120
     (244 523)
     (244 530))
    (node 119
     (362 523)
     (362 530))
    (node 351
     (567 523)
     (567 530)))
   (AssociationImage
    (key 355)
    (represents 348)
    (nodes 351 352)
    (points
     (568 641)
     (568 685))
    (arc_name 568 663 1))))
 (savekey_max 355))
