summaryrefslogtreecommitdiffstats
path: root/c++/src/H5FcreatProp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5FcreatProp.cpp')
-rw-r--r--c++/src/H5FcreatProp.cpp151
1 files changed, 73 insertions, 78 deletions
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp
index 9b0fecc..4bbebfd 100644
--- a/c++/src/H5FcreatProp.cpp
+++ b/c++/src/H5FcreatProp.cpp
@@ -27,7 +27,7 @@ namespace H5 {
// in "H5PredType.cpp" for information.
// Initialize a pointer for the constant
-FileCreatPropList* FileCreatPropList::DEFAULT_ = 0;
+FileCreatPropList *FileCreatPropList::DEFAULT_ = 0;
//--------------------------------------------------------------------------
// Function: FileCreatPropList::getConstant
@@ -39,13 +39,13 @@ FileCreatPropList* FileCreatPropList::DEFAULT_ = 0;
// object, throw a PropListIException. This scenario should not happen.
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
-FileCreatPropList* FileCreatPropList::getConstant()
+FileCreatPropList *
+FileCreatPropList::getConstant()
{
// Tell the C library not to clean up, H5Library::termH5cpp will call
// H5close - more dependency if use H5Library::dontAtExit()
- if (!IdComponent::H5dontAtexit_called)
- {
- (void) H5dont_atexit();
+ if (!IdComponent::H5dontAtexit_called) {
+ (void)H5dont_atexit();
IdComponent::H5dontAtexit_called = true;
}
@@ -54,8 +54,9 @@ FileCreatPropList* FileCreatPropList::getConstant()
if (DEFAULT_ == 0)
DEFAULT_ = new FileCreatPropList(H5P_FILE_CREATE);
else
- throw PropListIException("FileCreatPropList::getConstant", "FileCreatPropList::getConstant is being invoked on an allocated DEFAULT_");
- return(DEFAULT_);
+ throw PropListIException("FileCreatPropList::getConstant",
+ "FileCreatPropList::getConstant is being invoked on an allocated DEFAULT_");
+ return (DEFAULT_);
}
//--------------------------------------------------------------------------
@@ -64,7 +65,8 @@ FileCreatPropList* FileCreatPropList::getConstant()
// points to.
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
-void FileCreatPropList::deleteConstants()
+void
+FileCreatPropList::deleteConstants()
{
if (DEFAULT_ != 0)
delete DEFAULT_;
@@ -73,7 +75,7 @@ void FileCreatPropList::deleteConstants()
//--------------------------------------------------------------------------
// Purpose Constant for default property
//--------------------------------------------------------------------------
-const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant();
+const FileCreatPropList &FileCreatPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
@@ -91,7 +93,7 @@ FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {}
///\param original - IN: FileCreatPropList instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList( original ) {}
+FileCreatPropList::FileCreatPropList(const FileCreatPropList &original) : PropList(original) {}
//--------------------------------------------------------------------------
// Function: FileCreatPropList overloaded constructor
@@ -115,13 +117,12 @@ FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id)
/// Any (or even all) of the output arguments can be null pointers.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const
+void
+FileCreatPropList::getVersion(unsigned &super, unsigned &freelist, unsigned &stab, unsigned &shhdr) const
{
herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getVersion",
- "H5Pget_version failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::getVersion", "H5Pget_version failed");
}
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -136,13 +137,12 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned
/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setUserblock(hsize_t size) const
+void
+FileCreatPropList::setUserblock(hsize_t size) const
{
herr_t ret_value = H5Pset_userblock(id, size);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::setUserblock",
- "H5Pset_userblock failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::setUserblock", "H5Pset_userblock failed");
}
}
@@ -153,16 +153,15 @@ void FileCreatPropList::setUserblock(hsize_t size) const
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-hsize_t FileCreatPropList::getUserblock() const
+hsize_t
+FileCreatPropList::getUserblock() const
{
hsize_t userblock_size;
- herr_t ret_value = H5Pget_userblock(id, &userblock_size);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getUserblock",
- "H5Pget_userblock failed");
+ herr_t ret_value = H5Pget_userblock(id, &userblock_size);
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::getUserblock", "H5Pget_userblock failed");
}
- return(userblock_size);
+ return (userblock_size);
}
//--------------------------------------------------------------------------
@@ -177,13 +176,12 @@ hsize_t FileCreatPropList::getUserblock() const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const
+void
+FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const
{
herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::setSizes",
- "H5Pset_sizes failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::setSizes", "H5Pset_sizes failed");
}
}
@@ -195,13 +193,12 @@ void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const
+void
+FileCreatPropList::getSizes(size_t &sizeof_addr, size_t &sizeof_size) const
{
herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getSizes",
- "H5Pget_sizes failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::getSizes", "H5Pget_sizes failed");
}
}
@@ -217,13 +214,12 @@ void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const
+void
+FileCreatPropList::setSymk(unsigned ik, unsigned lk) const
{
herr_t ret_value = H5Pset_sym_k(id, ik, lk);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::setSymk",
- "H5Pset_sym_k failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed");
}
}
@@ -238,13 +234,12 @@ void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const
+void
+FileCreatPropList::getSymk(unsigned &ik, unsigned &lk) const
{
herr_t ret_value = H5Pget_sym_k(id, &ik, &lk);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getSymk",
- "H5Pget_sym_k failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed");
}
}
@@ -259,13 +254,12 @@ void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setIstorek(unsigned ik) const
+void
+FileCreatPropList::setIstorek(unsigned ik) const
{
herr_t ret_value = H5Pset_istore_k(id, ik);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::setIstorek",
- "H5Pset_istore_k failed");
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::setIstorek", "H5Pset_istore_k failed");
}
}
@@ -279,16 +273,15 @@ void FileCreatPropList::setIstorek(unsigned ik) const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-unsigned FileCreatPropList::getIstorek() const
+unsigned
+FileCreatPropList::getIstorek() const
{
unsigned ik;
- herr_t ret_value = H5Pget_istore_k(id, &ik);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getIstorek",
- "H5Pget_istore_k failed");
+ herr_t ret_value = H5Pget_istore_k(id, &ik);
+ if (ret_value < 0) {
+ throw PropListIException("FileCreatPropList::getIstorek", "H5Pget_istore_k failed");
}
- return(ik);
+ return (ik);
}
//--------------------------------------------------------------------------
@@ -309,13 +302,14 @@ unsigned FileCreatPropList::getIstorek() const
/// API in the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
-void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const
+void
+FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist,
+ hsize_t threshold) const
{
herr_t ret_value = H5Pset_file_space_strategy(id, strategy, persist, threshold);
- if (ret_value < 0)
- {
+ if (ret_value < 0) {
throw PropListIException("FileCreatPropList::setFileSpaceStrategy",
- "H5Pset_file_space_strategy failed");
+ "H5Pset_file_space_strategy failed");
}
}
@@ -329,13 +323,14 @@ void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbo
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
-void FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const
+void
+FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t &strategy, hbool_t &persist,
+ hsize_t &threshold) const
{
herr_t ret_value = H5Pget_file_space_strategy(id, &strategy, &persist, &threshold);
- if (ret_value < 0)
- {
+ if (ret_value < 0) {
throw PropListIException("FileCreatPropList::getFileSpaceStrategy",
- "H5Pget_file_space_strategy failed");
+ "H5Pget_file_space_strategy failed");
}
}
@@ -346,13 +341,13 @@ void FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hb
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
-void FileCreatPropList::setFileSpacePagesize(hsize_t fsp_psize) const
+void
+FileCreatPropList::setFileSpacePagesize(hsize_t fsp_psize) const
{
herr_t ret_value = H5Pset_file_space_page_size(id, fsp_psize);
- if (ret_value < 0)
- {
+ if (ret_value < 0) {
throw PropListIException("FileCreatPropList::setFileSpacePagesize",
- "H5Pset_file_space_page_size failed");
+ "H5Pset_file_space_page_size failed");
}
}
@@ -364,16 +359,16 @@ void FileCreatPropList::setFileSpacePagesize(hsize_t fsp_psize) const
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
-hsize_t FileCreatPropList::getFileSpacePagesize() const
+hsize_t
+FileCreatPropList::getFileSpacePagesize() const
{
hsize_t fsp_psize = 0;
- herr_t ret_value = H5Pget_file_space_page_size(id, &fsp_psize);
- if (ret_value < 0)
- {
+ herr_t ret_value = H5Pget_file_space_page_size(id, &fsp_psize);
+ if (ret_value < 0) {
throw PropListIException("FileCreatPropList::getFileSpacePagesize",
- "H5Pget_file_space_page_size failed");
+ "H5Pget_file_space_page_size failed");
}
- return(fsp_psize);
+ return (fsp_psize);
}
//--------------------------------------------------------------------------
@@ -383,4 +378,4 @@ hsize_t FileCreatPropList::getFileSpacePagesize() const
//--------------------------------------------------------------------------
FileCreatPropList::~FileCreatPropList() {}
-} // end namespace
+} // namespace H5