NeXus  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
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

List of all members.

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

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 161 of file NeXusFile.cpp.

NeXus::File::~File ( )

Destructor.

This does close the file.

Definition at line 185 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 195 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 284 of file NeXusFile.cpp.

References NXclosegroup().

Referenced by 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 205 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 1321 of file NeXusFile.cpp.

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 1051 of file NeXusFile.cpp.

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

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

Here is the call graph for this function:

template<typename NumT >
template char 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 1081 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 1098 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 1088 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 1136 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 698 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 709 of file NeXusFile.cpp.

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

Referenced by 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 739 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 762 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 807 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 651 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 974 of file NeXusFile.cpp.

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 981 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 1166 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 936 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 1027 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 953 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 271 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 
)

(void*, const std::vector<int64_t>&, (void*, const std::vector<int64_t>&,

(void*, const std::vector<int64_t>&, const std::vector<int64_t>&) (void*, const std::vector<int64_t>&, const std::vector<int64_t>&)

Definition at line 998 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 1003 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 1108 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 907 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 1302 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 1150 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 1215 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 888 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 660 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 1230 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 1253 of file NeXusFile.cpp.

References NXlinkexternal().

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 
)

(const std::string&, const NXnumtype, (const std::string&, const NXnumtype,

(const std::string&, const NXnumtype, const std::vector<int64_t>&, const NXcompression, const std::vector<int64_t>&, bool) (const std::string&, const NXnumtype, const std::vector<int64_t>&, const NXcompression, const std::vector<int64_t>&, bool)

Definition at line 433 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 439 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 
)

(const std::string&, NXnumtype, (const std::string&, NXnumtype,

(const std::string&, NXnumtype, const std::vector<int64_t>&, bool); (const std::string&, NXnumtype, const std::vector<int64_t>&, bool);

Definition at line 291 of file NeXusFile.cpp.

Referenced by 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 296 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 322 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 212 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 674 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 681 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 1311 of file NeXusFile.cpp.

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

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

Definition at line 503 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 231 of file NeXusFile.cpp.

References NXopengroup().

Referenced by 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 259 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 247 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 691 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 1180 of file NeXusFile.cpp.

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 538 of file NeXusFile.cpp.

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

Referenced by 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 557 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 565 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 577 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 520 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 531 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 
)

(void* data, std::vector<int64_t>& start, (void* data, std::vector<int64_t>& start,

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

Definition at line 588 of file NeXusFile.cpp.

Referenced by 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 594 of file NeXusFile.cpp.

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

(void* data, std::vector<int64_t>& start, (std::vector<NumT>& data, std::vector<int64_t>&,

(void* data, std::vector<int64_t>& start, std::vector<int64_t>& size) (std::vector<NumT>& data, std::vector<int64_t>&, std::vector<int64_t>&)

Definition at line 621 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 629 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 638 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 643 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 863 of file NeXusFile.cpp.

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

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 871 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 881 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 1175 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.

  \param type The primitive type to set the format for.
  \param format The format to use.

Definition at line 1201 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 
)

(const std::string & name, (const std::string & name,

(const std::string & name, const std::vector<NumT> & value, const std::vector<int64_t> & dims, const NXcompression comp, const std::vector<int64_t> & bufsize) (const std::string & name, const std::vector<NumT> & value, const std::vector<int64_t> & dims, const NXcompression comp, const std::vector<int64_t> & bufsize)

Definition at line 482 of file NeXusFile.cpp.

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 489 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 339 of file NeXusFile.cpp.

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

Referenced by 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 335 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 357 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 330 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 363 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 371 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 380 of file NeXusFile.cpp.

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 387 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 398 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.

  \tparam NumT numeric data type of \a value
  \param name :: The name of the field to create.
  \param value :: The vector to put into the file.

Definition at line 415 of file NeXusFile.cpp.

References closeData(), openData(), 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,
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.

  \tparam NumT numeric data type of \a value
  \param name :: The name of the field to create.
  \param value :: The vector to put into the file.
  \param dims :: The dimensions of the data.

Definition at line 423 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: