void wb_dbms::copy(wb_export &e, const char *fileName) { pwr_tStatus sts; char l_fileName[512]; dcli_translate_filename(l_fileName, fileName); if (!m_env) { m_env = new wb_dbms_env(l_fileName); m_env->open(); } createDb(); importVolume(e); close(); open(); try { m_env->txn_begin(0, (wb_dbms_txn **)&m_txn); wb_dbms_info i(this); i.get(m_txn); m_vid = i.vid(); m_cid = i.cid(); strcpy(m_volumeName, i.name()); commit(&sts); } catch (wb_dbms_error &e) { m_txn->abort(); printf("exeption: %s\n", e.what().c_str()); } }
void wb_db::copy(wb_export &e, const char *fileName) { pwr_tStatus sts; dcli_translate_filename(m_fileName, fileName); openDb(false); importVolume(e); close(); openDb(true); try { m_env->txn_begin(0, (DbTxn **)&m_txn, 0); wb_db_info i(this); i.get(m_txn); m_vid = i.vid(); m_cid = i.cid(); strcpy(m_volumeName, i.name()); commit(&sts); } catch (DbException &e) { //txn->abort(); printf("exeption: %s\n", e.what()); } }
void wb_dbms::copy(wb_export &e, wb_dbms_env *env) { pwr_tStatus sts; m_env = env; m_env->open(); createDb(); importVolume(e); close(); open(); try { m_env->txn_begin(0, (wb_dbms_txn **)&m_txn); wb_dbms_info i(this); i.get(m_txn); m_vid = i.vid(); m_cid = i.cid(); strcpy(m_volumeName, i.name()); commit(&sts); } catch (wb_dbms_error &e) { m_txn->abort(); printf("exeption: %s\n", e.what().c_str()); } }
OSPObjectCatalog OSPObjectFile::importObject(const tinyxml2::XMLNode *node) { //! OSPRay light object. if (!strcmp(node->ToElement()->Name(), "light")) return(importLight(node)); //! OSPRay triangle mesh object. if (!strcmp(node->ToElement()->Name(), "triangleMesh")) return(importTriangleMesh(node)); //! OSPRay volume object. if (!strcmp(node->ToElement()->Name(), "volume")) return(importVolume(node)); //! No other object types are currently supported. exitOnCondition(true, "unrecognized XML element type '" + std::string(node->ToElement()->Name()) + "'"); return(NULL); }