summaryrefslogtreecommitdiffstats
path: root/c++/src/H5FcreatProp.C
blob: 41ec360efc341257863caf436a4cf0d54902bf84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <string>

#include "H5Include.h"
#include "H5RefCounter.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
#include "H5PropList.h"
#include "H5FcreatProp.h"

#ifndef H5_NO_NAMESPACE
namespace H5 {
#endif

const FileCreatPropList FileCreatPropList::DEFAULT( H5P_DEFAULT );

// Creates a file create property list
FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {}

// Copy constructor: makes a copy of the original FileCreatPropList object;
FileCreatPropList::FileCreatPropList( const FileCreatPropList& orig ) : PropList( orig ) {}

// Copies a file create property list using assignment statement
// Notes: can this be inherited from PropList??? and copy or operator=???
FileCreatPropList& FileCreatPropList::operator=( const FileCreatPropList& rhs )
{
   copy (rhs);
   return( *this );
}

void FileCreatPropList::getVersion( 
			int& boot, int& freelist, int& stab, int& shhdr ) const
{
   herr_t ret_value = H5Pget_version( id, &boot, &freelist, &stab, &shhdr );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
}

void FileCreatPropList::setUserblock( hsize_t size ) const
{
   herr_t ret_value = H5Pset_userblock( id, size);
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
}

hsize_t FileCreatPropList::getUserblock() const
{
   hsize_t userblock_size;
   herr_t ret_value = H5Pget_userblock( id, &userblock_size );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
   return( userblock_size );
}

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();
   }
}

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();
   }
}

void FileCreatPropList::setSymk( int ik, int lk ) const
{
   herr_t ret_value = H5Pset_sym_k( id, ik, lk );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
}

void FileCreatPropList::getSymk( int& ik, int& lk ) const
{
   herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
}

void FileCreatPropList::setIstorek( int ik ) const
{
   herr_t ret_value = H5Pset_istore_k( id, ik );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
}
int FileCreatPropList::getIstorek() const
{
   int ik;
   herr_t ret_value = H5Pget_istore_k( id, &ik );
   if( ret_value < 0 )
   {
      throw PropListIException();
   }
   return( ik );
}

// Default destructor
FileCreatPropList::~FileCreatPropList() {}

#ifndef H5_NO_NAMESPACE
} // end namespace
#endif
="hl com"> if( ret_value < 0 ) { throw PropListIException(); } } void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const { setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); } void FileAccPropList::getSplit( size_t meta_ext_size, string& meta_ext, FileAccPropList& meta_plist, size_t raw_ext_size, string& raw_ext, FileAccPropList& raw_plist ) const { hid_t meta_plist_id, raw_plist_id; // meta-data and raw-data plist ids char* meta_ext_C = new char[meta_ext_size]; // meta-data extension in C char* raw_ext_C = new char[raw_ext_size]; // raw-data extension in C herr_t ret_value = H5Pget_split( id, meta_ext_size, meta_ext_C, &meta_plist_id, raw_ext_size, raw_ext_C, &raw_plist_id ); if( ret_value < 0 ) { throw PropListIException(); } meta_plist.setId( meta_plist_id ); raw_plist.setId( raw_plist_id ); raw_ext = string( raw_ext_C ); meta_ext = string( raw_ext_C ); delete [] raw_ext_C; delete [] meta_ext_C; } */ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const { herr_t ret_value = H5Pset_alignment( id, threshold, alignment ); if( ret_value < 0 ) { throw PropListIException(); } } void FileAccPropList::getAlignment( hsize_t& threshold, hsize_t& alignment ) const { herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment ); if( ret_value < 0 ) { throw PropListIException(); } } /* MPI_Comm and MPI_Info not declared in serial mode so leave these routines out until C++ API needs to deal with parallel void FileAccPropList::setMpi( MPI_Comm comm, MPI_Info info ) const { herr_t ret_value = H5Pset_mpi( id, comm, info ); if( ret_value < 0 ) { throw PropListIException(); } } void FileAccPropList::getMpi( MPI_Comm& comm, MPI_Info& info ) const { herr_t ret_value = H5Pget_mpi( id, &comm, &info ); if( ret_value < 0 ) return( false ); else return( true ); } */ void FileAccPropList::setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const { herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ); if( ret_value < 0 ) { throw PropListIException(); } } void FileAccPropList::getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const { herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 ); if( ret_value < 0 ) { throw PropListIException(); } } void FileAccPropList::setGcReferences( unsigned gc_ref ) const { herr_t ret_value = H5Pset_gc_references( id, gc_ref ); if( ret_value < 0 ) { throw PropListIException(); } } unsigned FileAccPropList::getGcReferences() const { unsigned gc_ref; // the name of this routine will be changed to H5Pget_gc_references??? herr_t ret_value = H5Pget_gc_references( id, &gc_ref ); if( ret_value < 0 ) { throw PropListIException(); } return( gc_ref ); } FileAccPropList::~FileAccPropList() {} #ifndef H5_NO_NAMESPACE } // end namespace #endif