Field3D
|
#include <Field3DFile.h>
Classes | |
struct | LayerInfo |
Public Types | |
typedef std::map< std::string, std::string > | GroupMembershipMap |
Public Member Functions | |
void | clear () |
Clear the data structures and close the file. | |
bool | close () |
Closes the file. No need to call this unless you specifically want to close the file early. It will close once the File object goes out of scope. | |
FieldMetadata & | metadata () |
accessor to the m_metadata class | |
const FieldMetadata & | metadata () const |
Read only access to the m_metadata class. | |
virtual void | metadataHasChanged (const std::string &) |
This function should implemented by concrete classes to get the callback when metadata changes. | |
Constructors & destructor | |
Field3DFileBase () | |
virtual | ~Field3DFileBase ()=0 |
Pure virtual destructor to ensure we never instantiate this class. | |
Retreiving partition and layer names | |
void | getPartitionNames (std::vector< std::string > &names) const |
Gets the names of all the partitions in the file. | |
void | getScalarLayerNames (std::vector< std::string > &names, const std::string &partitionName) const |
Gets the names of all the scalar layers in a given partition. | |
void | getVectorLayerNames (std::vector< std::string > &names, const std::string &partitionName) const |
Gets the names of all the vector layers in a given partition. | |
Convenience methods for partitionName | |
void | addGroupMembership (const GroupMembershipMap &groupMembers) |
Add to the group membership. | |
Debug | |
void | printHierarchy () const |
Protected Types | |
typedef std::map< std::string, int > | PartitionCountMap |
typedef std::vector< File::Partition::Ptr > | PartitionList |
Protected Member Functions | |
Convenience methods | |
File::Partition::Ptr | getPartition (const std::string &partitionName) const |
Returns a pointer to the given partition. | |
virtual void | closeInternal ()=0 |
Closes the file if open. | |
File::Partition::Ptr | partition (const std::string &partitionName) |
Returns a pointer to the given partition. | |
File::Partition::Ptr | partition (const std::string &partitionName) const |
Returns a pointer to the given partition. | |
void | getIntPartitionNames (std::vector< std::string > &names) const |
Gets the names of all the -internal- partitions in the file. | |
void | getIntScalarLayerNames (std::vector< std::string > &names, const std::string &intPartitionName) const |
Gets the names of all the scalar layers in a given partition, but assumes that partition name is the -internal- partition name. | |
void | getIntVectorLayerNames (std::vector< std::string > &names, const std::string &intPartitionName) const |
Gets the names of all the vector layers in a given partition, but assumes that partition name is the -internal- partition name. | |
int | numIntPartitions (const std::string &partitionName) const |
Returns the number of internal partitions for a given partition name. | |
std::string | makeIntPartitionName (const std::string &partitionsName, int i) const |
Makes an internal partition name given the external partition name. Effectively just tacks on .X to the name, where X is the number. | |
std::string | intPartitionName (const std::string &partitionName, const std::string &layerName, FieldRes::Ptr field) |
Returns a unique partition name given the requested name. This ensures that partitions with matching mappings get the same name but each subsequent differing mapping gets a new, separate name. | |
std::string | removeUniqueId (const std::string &partitionName) const |
Strips any unique identifiers from the partition name and returns the original name. | |
Protected Attributes | |
GroupMembershipMap | m_groupMembership |
Keeps track of group membership for each layer of partition name. The key is the "group" and the value is a space separated list of "partitionName.0:Layer1 partitionName.1:Layer0 ..." | |
boost::shared_ptr< Field3DFileHDF5Base > | m_hdf5Base |
HDF5 fallback. | |
std::vector< LayerInfo > | m_layerInfo |
This stores layer info. | |
FieldMetadata | m_metadata |
metadata | |
PartitionCountMap | m_partitionCount |
Contains a counter for each partition name. This is used to keep multiple fields with the same name unique in the file. | |
std::vector< std::string > | m_partitionNames |
This stores partition names. | |
PartitionList | m_partitions |
Vector of partitions. | |
Private Member Functions | |
Field3DFileBase (const Field3DFileBase &) | |
void | operator= (const Field3DFileBase &) |
Provides some common functionality for Field3DInputFile and Field3DOutputFile. It hold the partition->layer data structures, but knows nothing about how to actually get them to/from disk.
Definition at line 210 of file Field3DFile.h.
typedef std::map<std::string, std::string> Field3DFileBase::GroupMembershipMap |
Definition at line 228 of file Field3DFile.h.
|
protected |
Definition at line 311 of file Field3DFile.h.
|
protected |
Definition at line 312 of file Field3DFile.h.
Field3DFileBase::Field3DFileBase | ( | ) |
Definition at line 405 of file Field3DFile.cpp.
|
pure virtual |
Pure virtual destructor to ensure we never instantiate this class.
Definition at line 413 of file Field3DFile.cpp.
References m_groupMembership, and m_partitions.
|
private |
void Field3DFileBase::clear | ( | ) |
Clear the data structures and close the file.
Definition at line 616 of file Field3DFile.cpp.
References closeInternal(), m_groupMembership, m_hdf5Base, and m_partitions.
Referenced by Field3DInputFile::open().
bool Field3DFileBase::close | ( | ) |
Closes the file. No need to call this unless you specifically want to close the file early. It will close once the File object goes out of scope.
Definition at line 630 of file Field3DFile.cpp.
References closeInternal(), and m_hdf5Base.
Referenced by Field3DInputFile::open().
void Field3DFileBase::getPartitionNames | ( | std::vector< std::string > & | names | ) | const |
Gets the names of all the partitions in the file.
Definition at line 492 of file Field3DFile.cpp.
References FIELD3D_MTX_T, m_hdf5Base, m_partitions, and removeUniqueId().
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::load(), Field3DInputFile::readProxyScalarLayers(), and Field3DInputFile::readProxyVectorLayers().
void Field3DFileBase::getScalarLayerNames | ( | std::vector< std::string > & | names, |
const std::string & | partitionName ) const |
Gets the names of all the scalar layers in a given partition.
Definition at line 514 of file Field3DFile.cpp.
References FIELD3D_MTX_T, m_hdf5Base, makeIntPartitionName(), numIntPartitions(), and partition().
Referenced by Field3DInputFile::readProxyScalarLayers().
void Field3DFileBase::getVectorLayerNames | ( | std::vector< std::string > & | names, |
const std::string & | partitionName ) const |
Gets the names of all the vector layers in a given partition.
Definition at line 539 of file Field3DFile.cpp.
References FIELD3D_MTX_T, m_hdf5Base, makeIntPartitionName(), numIntPartitions(), and partition().
Referenced by Field3DInputFile::readProxyVectorLayers().
void Field3DFileBase::addGroupMembership | ( | const GroupMembershipMap & | groupMembers | ) |
Add to the group membership.
Definition at line 674 of file Field3DFile.cpp.
References FIELD3D_MTX_T, m_groupMembership, and m_hdf5Base.
|
inline |
accessor to the m_metadata class
Definition at line 276 of file Field3DFile.h.
Referenced by Field3DInputFile::readMetadata(), and Field3DOutputFile::writeMetadata().
|
inline |
Read only access to the m_metadata class.
Definition at line 285 of file Field3DFile.h.
This function should implemented by concrete classes to
get the callback when metadata changes.
Reimplemented from MetadataCallback.
Definition at line 295 of file Field3DFile.h.
void Field3DFileBase::printHierarchy | ( | ) | const |
Definition at line 1320 of file Field3DFile.cpp.
References FIELD3D_MTX_T, and m_partitions.
|
inlineprotected |
Returns a pointer to the given partition.
Definition at line 321 of file Field3DFile.h.
Closes the file if open.
Implemented in Field3DInputFile, and Field3DOutputFile.
|
protected |
Returns a pointer to the given partition.
Referenced by Field3DOutputFile::createNewPartition(), getIntScalarLayerNames(), getIntVectorLayerNames(), getScalarLayerNames(), getVectorLayerNames(), Field3DInputFile::readLayer(), Field3DInputFile::readPartitionAndLayerInfo(), Field3DInputFile::readProxyLayer(), and Field3DOutputFile::writeLayer().
|
protected |
Returns a pointer to the given partition.
|
protected |
Gets the names of all the -internal- partitions in the file.
Definition at line 564 of file Field3DFile.cpp.
References FIELD3D_MTX_T, and m_partitions.
Referenced by Field3DInputFile::readLayers(), Field3DInputFile::readLayers(), and Field3DInputFile::readProxyLayer().
|
protected |
Gets the names of all the scalar layers in a given partition, but assumes that partition name is the -internal- partition name.
Definition at line 577 of file Field3DFile.cpp.
References FIELD3D_MTX_T, intPartitionName(), partition(), and Msg::print().
Referenced by Field3DInputFile::readLayers(), Field3DInputFile::readLayers(), and Field3DInputFile::readProxyLayer().
|
protected |
Gets the names of all the vector layers in a given partition, but assumes that partition name is the -internal- partition name.
Definition at line 597 of file Field3DFile.cpp.
References FIELD3D_MTX_T, intPartitionName(), partition(), and Msg::print().
Referenced by Field3DInputFile::readProxyLayer().
Returns the number of internal partitions for a given partition name.
Definition at line 644 of file Field3DFile.cpp.
References FIELD3D_MTX_T, and m_partitions.
Referenced by getScalarLayerNames(), and getVectorLayerNames().
|
protected |
Makes an internal partition name given the external partition name. Effectively just tacks on .X to the name, where X is the number.
Definition at line 665 of file Field3DFile.cpp.
References FIELD3D_MTX_T.
Referenced by getScalarLayerNames(), getVectorLayerNames(), Field3DOutputFile::incrementPartitionName(), and intPartitionName().
|
protected |
Returns a unique partition name given the requested name. This ensures that partitions with matching mappings get the same name but each subsequent differing mapping gets a new, separate name.
Definition at line 422 of file Field3DFile.cpp.
References FIELD3D_MTX_T, m_partitionCount, m_partitions, makeIntPartitionName(), and removeUniqueId().
Referenced by getIntScalarLayerNames(), getIntVectorLayerNames(), Field3DInputFile::readLayer(), and Field3DOutputFile::writeLayer().
|
protected |
Strips any unique identifiers from the partition name and returns the original name.
Definition at line 479 of file Field3DFile.cpp.
Referenced by getPartitionNames(), Field3DOutputFile::incrementPartitionName(), intPartitionName(), Field3DInputFile::readLayer(), Field3DInputFile::readLayers(), and Field3DInputFile::readProxyLayer().
|
private |
|
protected |
This stores layer info.
Definition at line 368 of file Field3DFile.h.
|
protected |
Vector of partitions.
Definition at line 371 of file Field3DFile.h.
Referenced by clear(), Field3DOutputFile::createNewPartition(), getIntPartitionNames(), getPartitionNames(), intPartitionName(), numIntPartitions(), printHierarchy(), Field3DInputFile::readPartitionAndLayerInfo(), and ~Field3DFileBase().
|
protected |
This stores partition names.
Definition at line 373 of file Field3DFile.h.
|
protected |
Contains a counter for each partition name. This is used to keep multiple fields with the same name unique in the file.
Definition at line 377 of file Field3DFile.h.
Referenced by Field3DOutputFile::incrementPartitionName(), and intPartitionName().
|
protected |
Keeps track of group membership for each layer of partition name. The key is the "group" and the value is a space separated list of "partitionName.0:Layer1 partitionName.1:Layer0 ..."
Definition at line 382 of file Field3DFile.h.
Referenced by addGroupMembership(), clear(), Field3DOutputFile::writeGroupMembership(), and ~Field3DFileBase().
|
protected |
metadata
Definition at line 385 of file Field3DFile.h.
|
protected |
HDF5 fallback.
Definition at line 388 of file Field3DFile.h.
Referenced by addGroupMembership(), clear(), close(), Field3DOutputFile::create(), getPartitionNames(), getScalarLayerNames(), getVectorLayerNames(), and Field3DInputFile::open().