Пример #1
0
void HDFAtom<std::string>::Create(H5::H5Location &object, std::string atomName) {
    H5::StrType strType(0, H5T_VARIABLE);
    hsize_t defaultDims[] = {1};
    H5::DataSpace defaultDataSpace(1, defaultDims);
    attribute = object.createAttribute(atomName.c_str(), strType, H5::DataSpace(H5S_SCALAR));
    initialized= true;
}
Пример #2
0
 void Create(H5::H5Location &object, const std::string & name, const std::vector<std::string> &vect) {
     hsize_t length = vect.size();
     H5::StrType strType(0,H5T_VARIABLE);
     H5::ArrayType arrayDataType(strType, 1, &length);
     attribute = object.createAttribute(name.c_str(), strType, H5::DataSpace(1, &length));
     attribute.write(strType, &((vect)[0]));    
 }
Пример #3
0
 void Create(H5::H5Location &object, const std::string & name, std::vector<int> &vect) {
     hsize_t length = vect.size();
     H5::ArrayType arrayDataType(H5::PredType::NATIVE_INT, 1, &length);
     attribute = object.createAttribute(name.c_str(), H5::PredType::NATIVE_INT, H5::DataSpace(1, &length));
     attribute.write(H5::PredType::NATIVE_INT, &((vect)[0]));    
 }
Пример #4
0
 void Create(H5::H5Location &object, const std::string & name, const std::string & value) {
     H5::StrType strType(0, value.size());
     attribute = object.createAttribute(name.c_str(), strType, H5::DataSpace(0,NULL));
     isInitialized = true;
     attribute.write(strType, value.c_str());
 }