My Project
Public Member Functions
NeutronReadBinaryData< T > Class Template Reference

Read a binary data file. More...

#include <NeutronReadBinaryData.hh>

List of all members.

Public Member Functions

 NeutronReadBinaryData (string _SwapFlag="None")
vector< T > ReadData (string Filename)
void PrintData (string FileName)
vector< UInt4 > PutUInt4Vector (string Filename)
vector< Double > PutDoubleVector (string Filename)
PyObject * PutDoubleList (string FileName)
PyObject * PutUInt4List (string FileName)
UInt8 ReadData (string FileName, T *&array)

Detailed Description

template<class T>
class NeutronReadBinaryData< T >

Read a binary data file.

This template class reads a binary data file, and provide its data as a array and vector. The dimensions of the reading binary file is not required to read, it is obtained from the data type and the size of the target file.

Because this template is designed to read the whole of file, if the size of target file is large, the reading procedure is rather slow. If you want to read the section of the target file, you can use "NeutronReadBinaryDataSection".


Constructor & Destructor Documentation

template<class T >
NeutronReadBinaryData< T >::NeutronReadBinaryData ( string  _SwapFlag = "None")

The mean of the argument is swap-flag. The argument should be selected from "NoSwap", "Swap", "big" and "little", and its default value is "None".

If you selected "Swap", the byte-order of the target binary file is changed in this class. When the argument is "NoSwap", the byte-order of it is not changed.

If the byte-order of the target file is "little-endian", you must set the argument as "little". The architecture of the computer running "Manyo-Lib" is obtained in this constructor, and the argument is compared with the architecture. This method will decide whether the byte-order should be changed or not.

When the byte-order of the target file is "big-endian", you must set the argument as "big".


Member Function Documentation

template<class T >
void NeutronReadBinaryData< T >::PrintData ( string  FileName)

The content of "FileName" is dumped to the standard-output.

template<class T >
PyObject * NeutronReadBinaryData< T >::PutDoubleList ( string  FileName)

Returns a python list object. The content of the return object is the same as the PutDoubleVector(string).

template<class T >
vector< Double > NeutronReadBinaryData< T >::PutDoubleVector ( string  Filename)

Returns a vector<Double>. The content of the vector is the same as the vector returned by the method of "vector<T> ReadData(Char*)".

template<class T >
PyObject * NeutronReadBinaryData< T >::PutUInt4List ( string  FileName)

Returns a python list object. The content of the return object is the same as the PutUInt4Vector(string).

template<class T >
vector< UInt4 > NeutronReadBinaryData< T >::PutUInt4Vector ( string  Filename)

Returns a vector<UInt4>. The content of the vector is the same as the vector returned by the method of "vector<T> ReadData(Char*)".

template<class T >
vector< T > NeutronReadBinaryData< T >::ReadData ( string  Filename)

The "FileName" is the name of the target binary file. The data length of "FileName" is checked and obtained automatically using the data type of "T" and the file size.

template<class T >
UInt8 NeutronReadBinaryData< T >::ReadData ( string  FileName,
T *&  array 
)

The "FileName" is the name of the target binary file. The data length of "FileName" is checked automatically using the data type of "T" and its file size. The second argument is the pointer of the array whose value should be NULL. The pointer will be assigned to the pointer of the array obtained and produced by this method. The returned value of this method is the size of the array.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends