NeXus  1
Public Member Functions | List of all members
NeXus::File Class Reference

The Object that allows access to the information in the file. More...

#include <bindings/cpp/NeXusFile.hpp>

Collaboration diagram for NeXus::File:
Collaboration graph

Public Member Functions

std::pair< std::string, std::string > getNextEntry ()
 
AttrInfo getNextAttr ()
 
 File (const std::string &filename, const NXaccess access=NXACC_READ)
 Create a new File. More...
 
 File (const char *filename, const NXaccess access=NXACC_READ)
 Create a new File. More...
 
 File (NXhandle handle, bool close_handle=false)
 Use an existing handle returned from NXopen() More...
 
 ~File ()
 Destructor. More...
 
void close ()
 Close the file before the constructor is called. More...
 
void flush ()
 Flush the file. More...
 
template<typename NumT >
void malloc (NumT *&data, const Info &info)
 
template<typename NumT >
void free (NumT *&data)
 
void makeGroup (const std::string &name, const std::string &class_name, bool open_group=false)
 Create a new group. More...
 
void openGroup (const std::string &name, const std::string &class_name)
 Open an existing group. More...
 
void openPath (const std::string &path)
 Open the NeXus object with the path specified. More...
 
void openGroupPath (const std::string &path)
 Open the group in which the NeXus object with the specified path exists. More...
 
std::string getPath ()
 Get the path into the current file. More...
 
void closeGroup ()
 Close the currently open group. More...
 
void makeData (const std::string &name, NXnumtype type, const std::vector< int > &dims, bool open_data=false)
 
void makeData (const std::string &name, NXnumtype type, const std::vector< int64_t > &dims, bool open_data=false)
 Create a data field with the specified information. More...
 
template<typename NumT >
void makeData (const std::string &name, const NXnumtype type, const NumT length, bool open_data=false)
 Create a 1D data field with the specified information. More...
 
void writeData (const std::string &name, const std::string &value)
 Create a 1D data field, insert the data, and close the data. More...
 
void writeData (const std::string &name, const char *value)
 Create a 1D data field, insert the data, and close the data. More...
 
template<typename NumT >
void writeData (const std::string &name, const std::vector< NumT > &value)
 Create a 1D data field, insert the data, and close the data. More...
 
template<typename NumT >
void writeData (const std::string &name, const NumT &value)
 Create a 1D data field, insert the data, and close the data. More...
 
template<typename NumT >
void writeData (const std::string &name, const std::vector< NumT > &value, const std::vector< int > &dims)
 Create a n-dimension data field, insert the data, and close the data. More...
 
template<typename NumT >
void writeData (const std::string &name, const std::vector< NumT > &value, const std::vector< int64_t > &dims)
 Create a n-dimension data field, insert the data, and close the data. More...
 
template<typename NumT >
void writeExtendibleData (const std::string &name, std::vector< NumT > &value)
 Create a 1D data field with an unlimited dimension, insert the data, and close the data. More...
 
template<typename NumT >
void writeExtendibleData (const std::string &name, std::vector< NumT > &value, const int64_t chunk)
 Create a 1D data field with an unlimited dimension, insert the data, and close the data. More...
 
template<typename NumT >
void writeExtendibleData (const std::string &name, std::vector< NumT > &value, std::vector< int64_t > &dims, std::vector< int64_t > &chunk)
 Create a 1D data field with an unlimited dimension, insert the data, and close the data. More...
 
template<typename NumT >
void writeUpdatedData (const std::string &name, std::vector< NumT > &value)
 Updates the data written into an already-created data vector. More...
 
template<typename NumT >
void writeUpdatedData (const std::string &name, std::vector< NumT > &value, std::vector< int64_t > &dims)
 Updates the data written into an already-created data vector. More...
 
void makeCompData (const std::string &name, const NXnumtype type, const std::vector< int > &dims, const NXcompression comp, const std::vector< int > &bufsize, bool open_data=false)
 
void makeCompData (const std::string &name, const NXnumtype type, const std::vector< int64_t > &dims, const NXcompression comp, const std::vector< int64_t > &bufsize, bool open_data=false)
 Create a field with compression. More...
 
template<typename NumT >
void writeCompData (const std::string &name, const std::vector< NumT > &value, const std::vector< int > &dims, const NXcompression comp, const std::vector< int > &bufsize)
 
template<typename NumT >
void writeCompData (const std::string &name, const std::vector< NumT > &value, const std::vector< int64_t > &dims, const NXcompression comp, const std::vector< int64_t > &bufsize)
 Create a compressed data, insert the data, and close it. More...
 
void openData (const std::string &name)
 
void closeData ()
 Close the currently open data. More...
 
void putData (const void *data)
 
template<typename NumT >
void putData (const std::vector< NumT > &data)
 
void putAttr (const AttrInfo &info, const void *data)
 Put the supplied data as an attribute into the currently open data. More...
 
template<typename NumT >
void putAttr (const std::string &name, const NumT value)
 Put the supplied data as an attribute into the currently open data. More...
 
void putAttr (const char *name, const char *value)
 Put a string as an attribute in the file. More...
 
void putAttr (const std::string &name, const std::string value)
 Put a string as an attribute in the file. More...
 
void putSlab (void *data, std::vector< int > &start, std::vector< int > &size)
 
void putSlab (void *data, std::vector< int64_t > &start, std::vector< int64_t > &size)
 Insert an array as part of a data in the final file. More...
 
template<typename NumT >
void putSlab (std::vector< NumT > &data, std::vector< int > &start, std::vector< int > &size)
 
template<typename NumT >
void putSlab (std::vector< NumT > &data, std::vector< int64_t > &start, std::vector< int64_t > &size)
 Insert an array as part of a data in the final file. More...
 
template<typename NumT >
void putSlab (std::vector< NumT > &data, int start, int size)
 Insert a number as part of a data in the final file. More...
 
template<typename NumT >
void putSlab (std::vector< NumT > &data, int64_t start, int64_t size)
 Insert a number as part of a data in the final file. More...
 
NXlink getDataID ()
 
void makeLink (NXlink &link)
 Create a link in the current location to the supplied id. More...
 
void makeNamedLink (const std::string &name, NXlink &link)
 Create a link with a new name. More...
 
void openSourceGroup ()
 Open the original copy of this group or data as declared by the "target" attribute. More...
 
void getData (void *data)
 Put the currently open data in the supplied pointer. More...
 
template<typename NumT >
std::vector< NumT > * getData ()
 Allocate memory and return the data as a vector. More...
 
template<typename NumT >
void getData (std::vector< NumT > &data)
 Put data into the supplied vector. More...
 
void getDataCoerce (std::vector< int > &data)
 Get data and coerce into an int vector. More...
 
void getDataCoerce (std::vector< double > &data)
 Get data and coerce into a vector of doubles. More...
 
bool isDataInt ()
 Return true if the data opened is of one of the int data types, 32 bits or less. More...
 
template<typename NumT >
void readData (const std::string &dataName, std::vector< NumT > &data)
 Put data into the supplied vector. More...
 
template<typename NumT >
void readData (const std::string &dataName, NumT &data)
 Put data into the supplied value. More...
 
void readData (const std::string &dataName, std::string &data)
 Put data into the supplied string. More...
 
std::string getStrData ()
 
Info getInfo ()
 
std::map< std::string, std::string > getEntries ()
 Return the entries available in the current place in the file. More...
 
void getEntries (std::map< std::string, std::string > &result)
 Return the entries available in the current place in the file, but avoids the map copy of getEntries(). More...
 
void getSlab (void *data, const std::vector< int > &start, const std::vector< int > &size)
 
void getSlab (void *data, const std::vector< int64_t > &start, const std::vector< int64_t > &size)
 Get a section of data from the file. More...
 
std::vector< AttrInfogetAttrInfos ()
 
bool hasAttr (const std::string &name)
 
void getAttr (const AttrInfo &info, void *data, int length=-1)
 Get the value of the attribute specified by the AttrInfo supplied. More...
 
template<typename NumT >
NumT getAttr (const AttrInfo &info)
 Get the value of an attribute that is a scalar number. More...
 
template<typename NumT >
void getAttr (const std::string &name, NumT &value)
 Get the value of an attribute that is a scalar number. More...
 
std::string getStrAttr (const AttrInfo &info)
 Get the value of a string attribute. More...
 
NXlink getGroupID ()
 
bool sameID (NXlink &first, NXlink &second)
 Determine whether or not two links refer to the same data or group. More...
 
void printLink (NXlink &link)
 Diagnostic print of the link information. More...
 
void setNumberFormat (NXnumtype &type, const std::string &format)
 Set the number format used for a particular type when using the xml base. More...
 
std::string inquireFile (const int buff_length=NX_MAXPATHLEN)
 Find out the name of the file this object is holding onto. More...
 
std::string isExternalGroup (const std::string &name, const std::string &type, const unsigned buff_length=NX_MAXNAMELEN)
 Determine Whether or not a supplied group is external. More...
 
void linkExternal (const std::string &name, const std::string &type, const std::string &url)
 Create a link to a group in an external file. More...
 
bool isDataSetOpen ()
 This function checksi if we are in an open dataset. More...
 
TypeMapgetTypeMap ()
 Create a multimap with the data types as keys and the associated paths as values. More...
 
template<>
void getAttr (const std::string &name, std::string &value)
 

Detailed Description

The Object that allows access to the information in the file.

Definition at line 109 of file NeXusFile.hpp.

Constructor & Destructor Documentation

NeXus::File::File ( const std::string &  filename,
const NXaccess  access = NXACC_READ 
)

Create a new File.

Parameters
filenameThe name of the file to open.
accessHow to access the file.

Definition at line 177 of file NeXusFile.cpp.

NeXus::File::File ( const char *  filename,
const NXaccess  access = NXACC_READ 
)

Create a new File.

Parameters
filenameThe name of the file to open.
accessHow to access the file.

Definition at line 181 of file NeXusFile.cpp.

References NXopen().

Here is the call graph for this function:

NeXus::File::File ( NXhandle  handle,
bool  close_handle = false 
)

Use an existing handle returned from NXopen()

Parameters
handleHandle to connect to
close_handleShould the handle be closed on destruction

Definition at line 174 of file NeXusFile.cpp.

NeXus::File::~File ( )

Destructor.

This does close the file.

Definition at line 198 of file NeXusFile.cpp.

References NXclose().

Here is the call graph for this function:

Member Function Documentation

void NeXus::File::close ( )

Close the file before the constructor is called.

Definition at line 208 of file NeXusFile.cpp.

References NXclose().

Here is the call graph for this function:

void NeXus::File::closeData ( )
void NeXus::File::closeGroup ( )

Close the currently open group.

Definition at line 297 of file NeXusFile.cpp.

References NXclosegroup().

Referenced by linkExternal(), NeXus::Stream::operator<<(), and NeXus::Stream::operator>>().

Here is the call graph for this function:

void NeXus::File::flush ( )

Flush the file.

Definition at line 218 of file NeXusFile.cpp.

References NXflush().

Here is the call graph for this function:

template<typename NumT >
template void File::free ( NumT *&  data)

Definition at line 1334 of file NeXusFile.cpp.

References getAttr(), getData(), makeData(), malloc(), NXDLL_EXPORT, putAttr(), putSlab(), readData(), writeCompData(), writeData(), writeExtendibleData(), and writeUpdatedData().

Here is the call graph for this function:

void NeXus::File::getAttr ( const AttrInfo info,
void *  data,
int  length = -1 
)

Get the value of the attribute specified by the AttrInfo supplied.

Parameters
infoDesignation of which attribute to read.
dataThe pointer to put the attribute value in.
lengthThe length of the attribute. If this is "-1" then the information in the supplied AttrInfo object will be used.

Definition at line 1064 of file NeXusFile.cpp.

References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXgetattr(), and NeXus::AttrInfo::type.

Referenced by free(), getAttr(), getStrAttr(), and NeXus::Stream::AttrHolder< NumT >::readFromFile().

Here is the call graph for this function:

template<typename NumT >
NumT NeXus::File::getAttr ( const AttrInfo info)

Get the value of an attribute that is a scalar number.

Parameters
infoDesignation of which attribute to read.
Template Parameters
NumTnumeric data type of result
Returns
The attribute value.

Definition at line 1094 of file NeXusFile.cpp.

References getAttr().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::getAttr ( const std::string &  name,
NumT &  value 
)

Get the value of an attribute that is a scalar number.

Parameters
[in]nameName of attribute to read
[out]valueThe read attribute value.
Template Parameters
NumTnumeric data type of value

Definition at line 1111 of file NeXusFile.cpp.

References NeXus::AttrInfo::length, NeXus::AttrInfo::name, and NeXus::AttrInfo::type.

template<>
void NeXus::File::getAttr ( const std::string &  name,
std::string &  value 
)

<

Todo:
need to find correct length of attribute

Definition at line 1101 of file NeXusFile.cpp.

References getStrAttr(), NeXus::AttrInfo::length, NeXus::AttrInfo::name, and NeXus::AttrInfo::type.

Here is the call graph for this function:

vector< AttrInfo > NeXus::File::getAttrInfos ( )
Returns
Information about all attributes on the data that is currently open.

Definition at line 1149 of file NeXusFile.cpp.

References getNextAttr(), and NeXus::AttrInfo::name.

Here is the call graph for this function:

void NeXus::File::getData ( void *  data)

Put the currently open data in the supplied pointer.

Parameters
dataThe pointer to copy the data to.

Definition at line 711 of file NeXusFile.cpp.

References NXgetdata().

Referenced by NeXus::Stream::DataHolder< NumT >::readFromFile().

Here is the call graph for this function:

template<typename NumT >
template vector< char > * File::getData ( )

Allocate memory and return the data as a vector.

Since this does call "new vector<NumT>" the caller is responsible for calling "delete".

Template Parameters
NumTnumeric data type of result
Returns
The data as a vector.

Definition at line 722 of file NeXusFile.cpp.

References NeXus::Info::dims, getInfo(), and NeXus::Info::type.

Referenced by free(), getData(), getDataCoerce(), getStrData(), and readData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::getData ( std::vector< NumT > &  data)

Put data into the supplied vector.

The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.

Parameters
dataWhere to put the data.
Template Parameters
NumTnumeric data type of data

Definition at line 752 of file NeXusFile.cpp.

References NeXus::Info::dims, getData(), getInfo(), and NeXus::Info::type.

Here is the call graph for this function:

void NeXus::File::getDataCoerce ( std::vector< int > &  data)

Get data and coerce into an int vector.

Exceptions
Exceptionif the data is actually a float or another type that cannot be coerced to an int.
Parameters
data:: vector to be filled.

Definition at line 775 of file NeXusFile.cpp.

References getData(), getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.

Here is the call graph for this function:

void NeXus::File::getDataCoerce ( std::vector< double > &  data)

Get data and coerce into a vector of doubles.

Exceptions
Exceptionif the data cannot be coerced to a double.
Parameters
data:: vector to be filled.

Definition at line 820 of file NeXusFile.cpp.

References NeXus::FLOAT32, NeXus::FLOAT64, getData(), getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.

Here is the call graph for this function:

NXlink NeXus::File::getDataID ( )
Returns
The id of the data used for linking.

Definition at line 664 of file NeXusFile.cpp.

References NXgetdataID().

Here is the call graph for this function:

map< string, string > NeXus::File::getEntries ( )

Return the entries available in the current place in the file.

Definition at line 987 of file NeXusFile.cpp.

Referenced by linkExternal().

void NeXus::File::getEntries ( std::map< std::string, std::string > &  result)

Return the entries available in the current place in the file, but avoids the map copy of getEntries().

Parameters
resultThe map that will be filled with the entries

Definition at line 994 of file NeXusFile.cpp.

References getNextEntry().

Here is the call graph for this function:

NXlink NeXus::File::getGroupID ( )
Returns
The id of the group used for linking.

Definition at line 1179 of file NeXusFile.cpp.

References NXgetgroupID().

Here is the call graph for this function:

Info NeXus::File::getInfo ( )
Returns
The Info structure that describes the currently open data.

Definition at line 949 of file NeXusFile.cpp.

References NeXus::Info::dims, and NeXus::Info::type.

Referenced by getData(), getDataCoerce(), getStrData(), and isDataInt().

AttrInfo NeXus::File::getNextAttr ( )
Returns
Information about the next attribute.

Definition at line 1040 of file NeXusFile.cpp.

References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXgetnextattr(), and NeXus::AttrInfo::type.

Referenced by getAttrInfos(), and hasAttr().

Here is the call graph for this function:

pair< string, string > NeXus::File::getNextEntry ( )
Returns
A pair of the next entry available in a listing.

Definition at line 966 of file NeXusFile.cpp.

References NXgetnextentry().

Referenced by getEntries().

Here is the call graph for this function:

std::string NeXus::File::getPath ( )

Get the path into the current file.

Returns
A unix like path string pointing to the current position in the file

Definition at line 284 of file NeXusFile.cpp.

References NXgetpath().

Here is the call graph for this function:

void NeXus::File::getSlab ( void *  data,
const std::vector< int > &  start,
const std::vector< int > &  size 
)

Parameters
dataThe pointer to insert that data into.
startThe offset into the file's data block to start the read from.
sizeThe size of the block to read from the file.

Definition at line 1011 of file NeXusFile.cpp.

void NeXus::File::getSlab ( void *  data,
const std::vector< int64_t > &  start,
const std::vector< int64_t > &  size 
)

Get a section of data from the file.

Parameters
dataThe pointer to insert that data into.
startThe offset into the file's data block to start the read from.
sizeThe size of the block to read from the file.

Definition at line 1016 of file NeXusFile.cpp.

string NeXus::File::getStrAttr ( const AttrInfo info)

Get the value of a string attribute.

Parameters
infoWhich attribute to read.
Returns
The value of the attribute.

Definition at line 1121 of file NeXusFile.cpp.

References NeXus::CHAR, getAttr(), NeXus::AttrInfo::length, and NeXus::AttrInfo::type.

Referenced by getAttr().

Here is the call graph for this function:

string NeXus::File::getStrData ( )
Returns
String data from the file.

Definition at line 920 of file NeXusFile.cpp.

References NeXus::Info::dims, getData(), getInfo(), and NeXus::Info::type.

Referenced by readData().

Here is the call graph for this function:

TypeMap * NeXus::File::getTypeMap ( )

Create a multimap with the data types as keys and the associated paths as values.

Returns
The multimap of the opened file.

Definition at line 1315 of file NeXusFile.cpp.

References openPath().

Here is the call graph for this function:

bool NeXus::File::hasAttr ( const std::string &  name)
Returns
true if the current point in the file has the named attribute
Parameters
namethe name of the attribute to look for.

Definition at line 1163 of file NeXusFile.cpp.

References getNextAttr(), and NeXus::AttrInfo::name.

Here is the call graph for this function:

string NeXus::File::inquireFile ( const int  buff_length = NX_MAXPATHLEN)

Find out the name of the file this object is holding onto.

Parameters
buff_lengthThe size of the buffer to use for reading the name.
Returns
The name of the file.

Definition at line 1228 of file NeXusFile.cpp.

References NXinquirefile().

Here is the call graph for this function:

bool NeXus::File::isDataInt ( )

Return true if the data opened is of one of the int data types, 32 bits or less.

Definition at line 901 of file NeXusFile.cpp.

References getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.

Here is the call graph for this function:

bool NeXus::File::isDataSetOpen ( )

This function checksi if we are in an open dataset.

Returns
true if we are currently in an open dataset else false

Definition at line 673 of file NeXusFile.cpp.

References NXgetdataID().

Referenced by NeXus::Stream::operator<<(), and NeXus::Stream::operator>>().

Here is the call graph for this function:

string NeXus::File::isExternalGroup ( const std::string &  name,
const std::string &  type,
const unsigned  buff_length = NX_MAXNAMELEN 
)

Determine Whether or not a supplied group is external.

Parameters
nameThe name of the group to check.
typeThe type of the group to check.
buff_lengthThe size of the buffer to use for reading the url.
Returns
The url to the external group.

Definition at line 1243 of file NeXusFile.cpp.

References NXisexternalgroup().

Here is the call graph for this function:

void NeXus::File::linkExternal ( const std::string &  name,
const std::string &  type,
const std::string &  url 
)

Create a link to a group in an external file.

Parameters
nameThe name for the group in this file.
typeThe type for the group in this file.
urlThe url to the group in the external file.

Definition at line 1266 of file NeXusFile.cpp.

References closeGroup(), getEntries(), NXlinkexternal(), and openGroup().

Here is the call graph for this function:

void NeXus::File::makeCompData ( const std::string &  name,
const NXnumtype  type,
const std::vector< int > &  dims,
const NXcompression  comp,
const std::vector< int > &  bufsize,
bool  open_data = false 
)

Parameters
nameThe name of the data to create.
typeThe primitive type for the data.
dimsThe dimensions of the data.
compThe compression algorithm to use.
bufsizeThe size of the compression buffer to use.
open_dataWhether or not to open the data after creating it.

Definition at line 446 of file NeXusFile.cpp.

Referenced by writeCompData(), and writeExtendibleData().

void NeXus::File::makeCompData ( const std::string &  name,
const NXnumtype  type,
const std::vector< int64_t > &  dims,
const NXcompression  comp,
const std::vector< int64_t > &  bufsize,
bool  open_data = false 
)

Create a field with compression.

Parameters
nameThe name of the data to create.
typeThe primitive type for the data.
dimsThe dimensions of the data.
compThe compression algorithm to use.
bufsizeThe size of the compression buffer to use.
open_dataWhether or not to open the data after creating it.

Definition at line 452 of file NeXusFile.cpp.

References openData().

Here is the call graph for this function:

void NeXus::File::makeData ( const std::string &  name,
NXnumtype  type,
const std::vector< int > &  dims,
bool  open_data = false 
)

Parameters
nameThe name of the field to create (i.e. "distance").
typeThe primative type of the field (i.e. "NeXus::FLOAT32").
dimsThe dimensions of the field.
open_dataWhether or not to open the data after creating it.

Definition at line 304 of file NeXusFile.cpp.

Referenced by free(), makeData(), and writeData().

void NeXus::File::makeData ( const std::string &  name,
NXnumtype  type,
const std::vector< int64_t > &  dims,
bool  open_data = false 
)

Create a data field with the specified information.

Parameters
nameThe name of the field to create (i.e. "distance").
typeThe primative type of the field (i.e. "NeXus::FLOAT32").
dimsThe dimensions of the field.
open_dataWhether or not to open the data after creating it.

Definition at line 309 of file NeXusFile.cpp.

References openData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::makeData ( const std::string &  name,
const NXnumtype  type,
const NumT  length,
bool  open_data = false 
)

Create a 1D data field with the specified information.

Parameters
nameThe name of the field to create (i.e. "distance").
typeThe primative type of the field (i.e. "NeXus::FLOAT32").
lengthThe number of elements in the field.
open_dataWhether or not to open the data after creating it.

Definition at line 335 of file NeXusFile.cpp.

References makeData().

Here is the call graph for this function:

void NeXus::File::makeGroup ( const std::string &  name,
const std::string &  class_name,
bool  open_group = false 
)

Create a new group.

Parameters
nameThe name of the group to create (i.e. "entry").
class_nameThe type of group to create (i.e. "NXentry").
open_groupWhether or not to automatically open the group after creating it.

Definition at line 225 of file NeXusFile.cpp.

References NXmakegroup(), and openGroup().

Referenced by NeXus::Stream::Group::writeToFile().

Here is the call graph for this function:

void NeXus::File::makeLink ( NXlink &  link)

Create a link in the current location to the supplied id.

Parameters
linkThe object (group or data) in the file to link to.

Definition at line 687 of file NeXusFile.cpp.

References NXmakelink().

Here is the call graph for this function:

void NeXus::File::makeNamedLink ( const std::string &  name,
NXlink &  link 
)

Create a link with a new name.

Parameters
nameThe name of this copy of the link.
linkThe object (group or data) in the file to link to.

Definition at line 694 of file NeXusFile.cpp.

References NXmakenamedlink().

Here is the call graph for this function:

template<typename NumT >
template void File::malloc ( NumT *&  data,
const Info info 
)

Definition at line 1324 of file NeXusFile.cpp.

References NeXus::Info::dims, and NeXus::Info::type.

Referenced by free().

void NeXus::File::openData ( const std::string &  name)
Parameters
nameThe name of the data to open.

Definition at line 516 of file NeXusFile.cpp.

References NXopendata().

Referenced by makeCompData(), makeData(), readData(), NeXus::Stream::DataHolder< NumT >::readFromFile(), NeXus::Stream::Data::readFromFile(), NeXus::Stream::Data::writeToFile(), and writeUpdatedData().

Here is the call graph for this function:

void NeXus::File::openGroup ( const std::string &  name,
const std::string &  class_name 
)

Open an existing group.

Parameters
nameThe name of the group to create (i.e. "entry").
class_nameThe type of group to create (i.e. "NXentry").

Definition at line 244 of file NeXusFile.cpp.

References NXopengroup().

Referenced by linkExternal(), makeGroup(), and NeXus::Stream::Group::readFromFile().

Here is the call graph for this function:

void NeXus::File::openGroupPath ( const std::string &  path)

Open the group in which the NeXus object with the specified path exists.

Parameters
pathA unix like path string to a group or field. The path string is a list of group names and SDS names separated with a slash, '/' (i.e. "/entry/sample/name").

Definition at line 272 of file NeXusFile.cpp.

References NXopengrouppath().

Here is the call graph for this function:

void NeXus::File::openPath ( const std::string &  path)

Open the NeXus object with the path specified.

Parameters
pathA unix like path string to a group or field. The path string is a list of group names and SDS names separated with a slash, '/' (i.e. "/entry/sample/name").

Definition at line 260 of file NeXusFile.cpp.

References NXopenpath().

Referenced by getTypeMap().

Here is the call graph for this function:

void NeXus::File::openSourceGroup ( )

Open the original copy of this group or data as declared by the "target" attribute.

Definition at line 704 of file NeXusFile.cpp.

References NXopensourcegroup().

Here is the call graph for this function:

void NeXus::File::printLink ( NXlink &  link)

Diagnostic print of the link information.

Parameters
linkThe link to print to stdout.

Definition at line 1193 of file NeXusFile.cpp.

References NXinitattrdir(), and NXinitgroupdir().

Here is the call graph for this function:

void NeXus::File::putAttr ( const AttrInfo info,
const void *  data 
)

Put the supplied data as an attribute into the currently open data.

Parameters
infoDescription of the attribute to add.
dataThe attribute value.

Definition at line 551 of file NeXusFile.cpp.

References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXputattr(), and NeXus::AttrInfo::type.

Referenced by free(), putAttr(), and NeXus::Stream::AttrHolder< NumT >::writeToFile().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::putAttr ( const std::string &  name,
const NumT  value 
)

Put the supplied data as an attribute into the currently open data.

Parameters
nameName of the attribute to add.
valueThe attribute value.
Template Parameters
NumTnumeric data type of value

Definition at line 570 of file NeXusFile.cpp.

References NeXus::AttrInfo::length, NeXus::AttrInfo::name, putAttr(), and NeXus::AttrInfo::type.

Here is the call graph for this function:

void NeXus::File::putAttr ( const char *  name,
const char *  value 
)

Put a string as an attribute in the file.

Parameters
nameName of the attribute to add.
valueThe attribute value.

Definition at line 578 of file NeXusFile.cpp.

References putAttr().

Here is the call graph for this function:

void NeXus::File::putAttr ( const std::string &  name,
const std::string  value 
)

Put a string as an attribute in the file.

Parameters
nameName of the attribute to add.
valueThe attribute value.

Definition at line 590 of file NeXusFile.cpp.

References NeXus::CHAR, NeXus::AttrInfo::length, NeXus::AttrInfo::name, putAttr(), and NeXus::AttrInfo::type.

Here is the call graph for this function:

void NeXus::File::putData ( const void *  data)
Parameters
dataThe data to put in the file.

Definition at line 533 of file NeXusFile.cpp.

References NXputdata().

Referenced by putData(), writeCompData(), and writeData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::putData ( const std::vector< NumT > &  data)
Parameters
dataThe data to put in the file.
Template Parameters
NumTnumeric data type of data

Definition at line 544 of file NeXusFile.cpp.

References putData().

Here is the call graph for this function:

void NeXus::File::putSlab ( void *  data,
std::vector< int > &  start,
std::vector< int > &  size 
)

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.

Definition at line 601 of file NeXusFile.cpp.

Referenced by free(), putSlab(), writeExtendibleData(), and writeUpdatedData().

void NeXus::File::putSlab ( void *  data,
std::vector< int64_t > &  start,
std::vector< int64_t > &  size 
)

Insert an array as part of a data in the final file.

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.

Definition at line 607 of file NeXusFile.cpp.

template<typename NumT >
void NeXus::File::putSlab ( std::vector< NumT > &  data,
std::vector< int > &  start,
std::vector< int > &  size 
)

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.
Template Parameters
NumTnumeric data type of data

Definition at line 634 of file NeXusFile.cpp.

References putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::putSlab ( std::vector< NumT > &  data,
std::vector< int64_t > &  start,
std::vector< int64_t > &  size 
)

Insert an array as part of a data in the final file.

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.
Template Parameters
NumTnumeric data type of data

Definition at line 642 of file NeXusFile.cpp.

References putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::putSlab ( std::vector< NumT > &  data,
int  start,
int  size 
)

Insert a number as part of a data in the final file.

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.
Template Parameters
NumTnumeric data type of data

Definition at line 651 of file NeXusFile.cpp.

References putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::putSlab ( std::vector< NumT > &  data,
int64_t  start,
int64_t  size 
)

Insert a number as part of a data in the final file.

Parameters
dataThe array to put in the file.
startThe starting index to insert the data.
sizeThe size of the array to put in the file.
Template Parameters
NumTnumeric data type of data

Definition at line 656 of file NeXusFile.cpp.

References putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::readData ( const std::string &  dataName,
std::vector< NumT > &  data 
)

Put data into the supplied vector.

The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.

The named data object is opened, loaded, then closed.

Parameters
dataName:: name of the data to open.
data:: Where to put the data.
Template Parameters
NumTnumeric data type of data

Definition at line 876 of file NeXusFile.cpp.

References closeData(), getData(), and openData().

Referenced by free().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::readData ( const std::string &  dataName,
NumT &  data 
)

Put data into the supplied value.

The named data object is opened, loaded, then closed.

Parameters
dataName:: name of the data to open.
data:: Where to put the data.
Template Parameters
NumTnumeric data type of data

Definition at line 884 of file NeXusFile.cpp.

References closeData(), getData(), and openData().

Here is the call graph for this function:

void NeXus::File::readData ( const std::string &  dataName,
std::string &  data 
)

Put data into the supplied string.

The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.

The named data object is opened, loaded, then closed.

Parameters
dataName:: name of the data to open.
data:: Where to put the data.

Definition at line 894 of file NeXusFile.cpp.

References closeData(), getStrData(), and openData().

Here is the call graph for this function:

bool NeXus::File::sameID ( NXlink &  first,
NXlink &  second 
)

Determine whether or not two links refer to the same data or group.

Parameters
firstThe first link information to compare.
secondThe second link information to compare.
Returns
True if the two point at the same data or group.

Definition at line 1188 of file NeXusFile.cpp.

References NXsameID().

Here is the call graph for this function:

void NeXus::File::setNumberFormat ( NXnumtype type,
const std::string &  format 
)

Set the number format used for a particular type when using the xml base.

This is ignore in the other bases.

Parameters
typeThe primitive type to set the format for.
formatThe format to use.

Definition at line 1214 of file NeXusFile.cpp.

References NXsetnumberformat().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeCompData ( const std::string &  name,
const std::vector< NumT > &  value,
const std::vector< int > &  dims,
const NXcompression  comp,
const std::vector< int > &  bufsize 
)

Parameters
nameThe name of the data to create.
valueThe vector to put into the file.
dimsThe dimensions of the data.
compThe compression algorithm to use.
bufsizeThe size of the compression buffer to use.
Template Parameters
NumTnumeric data type of value

Definition at line 495 of file NeXusFile.cpp.

Referenced by free().

template<typename NumT >
void NeXus::File::writeCompData ( const std::string &  name,
const std::vector< NumT > &  value,
const std::vector< int64_t > &  dims,
const NXcompression  comp,
const std::vector< int64_t > &  bufsize 
)

Create a compressed data, insert the data, and close it.

Parameters
nameThe name of the data to create.
valueThe vector to put into the file.
dimsThe dimensions of the data.
compThe compression algorithm to use.
bufsizeThe size of the compression buffer to use.
Template Parameters
NumTnumeric data type of value

Definition at line 502 of file NeXusFile.cpp.

References closeData(), makeCompData(), and putData().

Here is the call graph for this function:

void NeXus::File::writeData ( const std::string &  name,
const std::string &  value 
)

Create a 1D data field, insert the data, and close the data.

Parameters
nameThe name of the field to create.
valueThe string to put into the file.

Definition at line 352 of file NeXusFile.cpp.

References NeXus::CHAR, closeData(), makeData(), and putData().

Referenced by free(), writeData(), and NeXus::Stream::DataHolder< NumT >::writeToFile().

Here is the call graph for this function:

void NeXus::File::writeData ( const std::string &  name,
const char *  value 
)

Create a 1D data field, insert the data, and close the data.

Parameters
nameThe name of the field to create.
valueThe string to put into the file.

Definition at line 348 of file NeXusFile.cpp.

References writeData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeData ( const std::string &  name,
const std::vector< NumT > &  value 
)

Create a 1D data field, insert the data, and close the data.

Template Parameters
NumTnumeric data type of value
Parameters
nameThe name of the field to create.
valueThe vector to put into the file.

Definition at line 370 of file NeXusFile.cpp.

References writeData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeData ( const std::string &  name,
const NumT &  value 
)

Create a 1D data field, insert the data, and close the data.

Template Parameters
NumTnumeric data type of value
Parameters
nameThe name of the field to create.
valueThe value to put into the file.

Definition at line 343 of file NeXusFile.cpp.

References writeData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeData ( const std::string &  name,
const std::vector< NumT > &  value,
const std::vector< int > &  dims 
)

Create a n-dimension data field, insert the data, and close the data.

Parameters
nameThe name of the field to create.
valueThe data to put into the file.
dimsThe dimensions of the data.
Template Parameters
NumTnumeric data type of value

Definition at line 376 of file NeXusFile.cpp.

References closeData(), makeData(), and putData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeData ( const std::string &  name,
const std::vector< NumT > &  value,
const std::vector< int64_t > &  dims 
)

Create a n-dimension data field, insert the data, and close the data.

Parameters
nameThe name of the field to create.
valueThe data to put into the file.
dimsThe dimensions of the data.
Template Parameters
NumTnumeric data type of value

Definition at line 384 of file NeXusFile.cpp.

References closeData(), makeData(), and putData().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeExtendibleData ( const std::string &  name,
std::vector< NumT > &  value 
)

Create a 1D data field with an unlimited dimension, insert the data, and close the data.

Template Parameters
NumTnumeric data type of value
Parameters
name:: The name of the field to create.
value:: The vector to put into the file.

Definition at line 393 of file NeXusFile.cpp.

Referenced by free().

template<typename NumT >
void NeXus::File::writeExtendibleData ( const std::string &  name,
std::vector< NumT > &  value,
const int64_t  chunk 
)

Create a 1D data field with an unlimited dimension, insert the data, and close the data.

Template Parameters
NumTnumeric data type of value
Parameters
name:: The name of the field to create.
value:: The vector to put into the file.
chunkSize:: chunk size to use when writing

Definition at line 400 of file NeXusFile.cpp.

References closeData(), makeCompData(), NeXus::NONE, and putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeExtendibleData ( const std::string &  name,
std::vector< NumT > &  value,
std::vector< int64_t > &  dims,
std::vector< int64_t > &  chunk 
)

Create a 1D data field with an unlimited dimension, insert the data, and close the data.

Template Parameters
NumTnumeric data type of value
Parameters
name:: The name of the field to create.
value:: The vector to put into the file.
dims:: The dimensions of the data.
chunk:: chunk size to use when writing

Definition at line 411 of file NeXusFile.cpp.

References closeData(), makeCompData(), NeXus::NONE, and putSlab().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeUpdatedData ( const std::string &  name,
std::vector< NumT > &  value 
)

Updates the data written into an already-created data vector.

If the data was created as extendible, it will be resized.

Template Parameters
NumTnumeric data type of value
Parameters
name:: The name of the field to create.
value:: The vector to put into the file.

Definition at line 428 of file NeXusFile.cpp.

References closeData(), openData(), and putSlab().

Referenced by free().

Here is the call graph for this function:

template<typename NumT >
void NeXus::File::writeUpdatedData ( const std::string &  name,
std::vector< NumT > &  value,
std::vector< int64_t > &  dims 
)

Updates the data written into an already-created data vector.

If the data was created as extendible, it will be resized.

Template Parameters
NumTnumeric data type of value
Parameters
name:: The name of the field to create.
value:: The vector to put into the file.
dims:: The dimensions of the data.

Definition at line 436 of file NeXusFile.cpp.

References closeData(), openData(), and putSlab().

Here is the call graph for this function:


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