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. More... | |
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. More... | |
FieldMetadata< Field3DFileBase > & | metadata () |
accessor to the m_metadata class More... | |
const FieldMetadata< Field3DFileBase > & | metadata () const |
Read only access to the m_metadata class. More... | |
virtual void | metadataHasChanged (const std::string &) |
This function should implemented by concrete classes to get the callback when metadata changes. More... | |
Constructors & destructor | |
Field3DFileBase () | |
virtual | ~Field3DFileBase ()=0 |
Pure virtual destructor to ensure we never instantiate this class. More... | |
Retreiving partition and layer names | |
void | getPartitionNames (std::vector< std::string > &names) const |
Gets the names of all the partitions in the file. More... | |
void | getScalarLayerNames (std::vector< std::string > &names, const std::string &partitionName) const |
Gets the names of all the scalar layers in a given partition. More... | |
void | getVectorLayerNames (std::vector< std::string > &names, const std::string &partitionName) const |
Gets the names of all the vector layers in a given partition. More... | |
File::Partition::Ptr | getPartition (const std::string &partitionName) const |
Returns a pointer to the given partition. More... | |
Convenience methods for partitionName | |
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. More... | |
std::string | removeUniqueId (const std::string &partitionName) const |
Strips any unique identifiers from the partition name and returns the original name. More... | |
void | addGroupMembership (const GroupMembershipMap &groupMembers) |
Add to the group membership. More... | |
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 | |
void | closeInternal () |
Closes the file if open. More... | |
File::Partition::Ptr | partition (const std::string &partitionName) |
Returns a pointer to the given partition. More... | |
File::Partition::Ptr | partition (const std::string &partitionName) const |
Returns a pointer to the given partition. More... | |
void | getIntPartitionNames (std::vector< std::string > &names) const |
Gets the names of all the -internal- partitions in the file. More... | |
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. More... | |
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. More... | |
int | numIntPartitions (const std::string &partitionName) const |
Returns the number of internal partitions for a given partition name. More... | |
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. More... | |
Protected Attributes | |
hid_t | m_file |
The hdf5 id of the current file. Will be -1 if no file is open. More... | |
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 ...". More... | |
std::vector< LayerInfo > | m_layerInfo |
This stores layer info. More... | |
FieldMetadata< Field3DFileBase > | m_metadata |
metadata More... | |
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. More... | |
std::vector< std::string > | m_partitionNames |
This stores partition names. More... | |
PartitionList | m_partitions |
Vector of partitions. More... | |
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 236 of file Field3DFile.h.
typedef std::map<std::string, std::string> Field3DFileBase::GroupMembershipMap |
Definition at line 254 of file Field3DFile.h.
|
protected |
Definition at line 343 of file Field3DFile.h.
|
protected |
Definition at line 344 of file Field3DFile.h.
Field3DFileBase::Field3DFileBase | ( | ) |
Definition at line 274 of file Field3DFile.cpp.
References g_hdf5Mutex.
|
pure virtual |
Pure virtual destructor to ensure we never instantiate this class.
Definition at line 292 of file Field3DFile.cpp.
References close().
|
private |
void Field3DFileBase::clear | ( | ) |
Clear the data structures and close the file.
Definition at line 471 of file Field3DFile.cpp.
References closeInternal(), m_groupMembership, and m_partitions.
Referenced by Field3DInputFile::open(), and Field3DInputFile::~Field3DInputFile().
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 480 of file Field3DFile.cpp.
References closeInternal().
Referenced by Field3DInputFile::open(), and ~Field3DFileBase().
void Field3DFileBase::getPartitionNames | ( | std::vector< std::string > & | names | ) | const |
Gets the names of all the partitions in the file.
Definition at line 370 of file Field3DFile.cpp.
References m_partitions, and removeUniqueId().
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::load().
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 387 of file Field3DFile.cpp.
References makeIntPartitionName(), numIntPartitions(), and partition().
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 405 of file Field3DFile.cpp.
References makeIntPartitionName(), numIntPartitions(), and partition().
|
inline |
Returns a pointer to the given partition.
Definition at line 291 of file Field3DFile.h.
std::string Field3DFileBase::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.
Definition at line 300 of file Field3DFile.cpp.
References m_partitionCount, m_partitions, makeIntPartitionName(), partition(), and removeUniqueId().
std::string Field3DFileBase::removeUniqueId | ( | const std::string & | partitionName | ) | const |
Strips any unique identifiers from the partition name and returns the original name.
Definition at line 357 of file Field3DFile.cpp.
Referenced by getPartitionNames(), Field3DOutputFile::incrementPartitionName(), intPartitionName(), and Field3DInputFile::readGroupMembership().
void Field3DFileBase::addGroupMembership | ( | const GroupMembershipMap & | groupMembers | ) |
Add to the group membership.
Definition at line 535 of file Field3DFile.cpp.
References m_groupMembership.
|
inline |
accessor to the m_metadata class
Definition at line 318 of file Field3DFile.h.
Referenced by Field3DInputFile::readMetadata(), and Field3DOutputFile::writeMetadata().
|
inline |
Read only access to the m_metadata class.
Definition at line 322 of file Field3DFile.h.
|
inlinevirtual |
This function should implemented by concrete classes to get the callback when metadata changes.
Definition at line 327 of file Field3DFile.h.
void Field3DFileBase::printHierarchy | ( | ) | const |
Definition at line 1547 of file Field3DFile.cpp.
References m_partitions.
|
protected |
Closes the file if open.
Definition at line 489 of file Field3DFile.cpp.
References g_hdf5Mutex, m_file, Msg::print(), and Msg::SevWarning.
Referenced by clear(), close(), and Field3DOutputFile::create().
|
protected |
Returns a pointer to the given partition.
Referenced by getIntScalarLayerNames(), getIntVectorLayerNames(), getScalarLayerNames(), getVectorLayerNames(), intPartitionName(), and Field3DInputFile::readPartitionAndLayerInfo().
|
protected |
Returns a pointer to the given partition.
|
protected |
Gets the names of all the -internal- partitions in the file.
Definition at line 423 of file Field3DFile.cpp.
References m_partitions.
|
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 436 of file Field3DFile.cpp.
References partition(), and Msg::print().
|
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 454 of file Field3DFile.cpp.
References partition(), and Msg::print().
|
protected |
Returns the number of internal partitions for a given partition name.
Definition at line 505 of file Field3DFile.cpp.
References 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 526 of file Field3DFile.cpp.
Referenced by getScalarLayerNames(), getVectorLayerNames(), Field3DOutputFile::incrementPartitionName(), and intPartitionName().
|
private |
|
protected |
This stores layer info.
Definition at line 384 of file Field3DFile.h.
Referenced by Field3DInputFile::parseLayer(), and Field3DInputFile::readPartitionAndLayerInfo().
|
protected |
The hdf5 id of the current file. Will be -1 if no file is open.
Definition at line 387 of file Field3DFile.h.
Referenced by closeInternal(), Field3DOutputFile::create(), Field3DInputFile::open(), Field3DInputFile::readGroupMembership(), Field3DInputFile::readPartitionAndLayerInfo(), Field3DOutputFile::writeGlobalMetadata(), and Field3DOutputFile::writeGroupMembership().
|
protected |
Vector of partitions.
Definition at line 389 of file Field3DFile.h.
Referenced by clear(), getIntPartitionNames(), getPartitionNames(), intPartitionName(), numIntPartitions(), printHierarchy(), and Field3DInputFile::readPartitionAndLayerInfo().
|
protected |
This stores partition names.
Definition at line 391 of file Field3DFile.h.
Referenced by Field3DInputFile::parsePartition(), and Field3DInputFile::readPartitionAndLayerInfo().
|
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 395 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 400 of file Field3DFile.h.
Referenced by addGroupMembership(), clear(), Field3DInputFile::readGroupMembership(), and Field3DOutputFile::writeGroupMembership().
|
protected |
metadata
Definition at line 403 of file Field3DFile.h.