当前位置: 首页>>代码示例>>C++>>正文


C++ OracleEnv类代码示例

本文整理汇总了C++中OracleEnv的典型用法代码示例。如果您正苦于以下问题:C++ OracleEnv类的具体用法?C++ OracleEnv怎么用?C++ OracleEnv使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OracleEnv类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QS_DEF

void MangoShadowFetch::prepareMass (OracleEnv &env)
{
   env.dbgPrintf("preparing shadow table for molecular mass match\n");

   QS_DEF(Array<char>, where);

   {
      ArrayOutput where_out(where);
      where_out.printf("");
      where_out.writeChar(0);
   }

   _fetch_type = _MASS;
   _env.reset(new OracleEnv(env.ctx(), env.logger()));
   _statement.reset(new OracleStatement(_env.ref()));

   _statement->append("SELECT mol_rowid FROM %s WHERE mass >= :mass_min AND mass <= :mass_max",
                      _table_name.ptr());

   _statement->prepare();
   _statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));

   ArrayOutput output(_counting_select);
   output.printf("SELECT COUNT(*) FROM %s WHERE WHERE mass >= :mass_min AND mass <= :mass_max",
           _table_name.ptr());
}
开发者ID:epam,项目名称:Indigo,代码行数:26,代码来源:mango_shadow_fetch.cpp

示例2: OracleEnv

void MangoShadowFetch::prepareTautomer (OracleEnv &env, int right_part)
{
   if (right_part == 1)
      env.dbgPrintf("preparing shadow table for tautomer match\n");
   else 
      env.dbgPrintf("preparing shadow table for non-tautomer match\n");

   _fetch_type = _TAUTOMER;
   _right_part = right_part;

   _env.reset(new OracleEnv(env.ctx(), env.logger()));
   _statement.reset(new OracleStatement(_env.ref()));
   _lob_cmf.reset(new OracleLOB(_env.ref()));

   _statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());

   if (right_part == 1)
      _statement->append(" WHERE gross = :gross OR gross LIKE :grossh");

   _statement->prepare();
   _statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
   _statement->defineBlobByPos(2, _lob_cmf.ref());

   if (right_part == 1)
   {
      ArrayOutput output(_counting_select);
      
      output.printf("SELECT COUNT(*) FROM %s WHERE gross = :gross", _table_name.ptr());
   }
   else
      _counting_select.clear();
}
开发者ID:epam,项目名称:Indigo,代码行数:32,代码来源:mango_shadow_fetch.cpp

示例3: OracleEnv

void RingoShadowFetch::prepareExact (OracleEnv &env, int right_part)
{
   RingoExact & instance = _context.exact;

   if (right_part == 1)
      env.dbgPrintf("preparing shadow table for exact\n");
   else
      env.dbgPrintf("preparing shadow table for non-exact\n");

   _fetch_type = _EXACT;
   _right_part = right_part;

   _env.reset(new OracleEnv(env.ctx(), env.logger()));
   _statement.reset(new OracleStatement(_env.ref()));
   _lob_crf.reset(new OracleLOB(_env.ref()));

   _statement->append("SELECT sh.rid, sh.crf FROM %s sh", _table_name.ptr());

   if (right_part == 1)
      _statement->append(" WHERE hash = :hash");

   _statement->prepare();
   _statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
   _statement->defineBlobByPos(2, _lob_crf.ref());
   if (_right_part == 1)
   {
      const char *hash_str = instance.getQueryHashStr();
      _statement->bindStringByName(":hash", hash_str, strlen(hash_str) + 1);
   }

   ArrayOutput output_cnt(_counting_select);
   output_cnt.printf("SELECT COUNT(*) FROM %s sh", _table_name.ptr());
   if (right_part == 1)
      output_cnt.printf(" WHERE hash = :hash");
}
开发者ID:Rillke,项目名称:indigo,代码行数:35,代码来源:ringo_shadow_fetch.cpp

示例4: fetch

void RingoFastIndex::fetch (OracleEnv &env, int max_matches)
{
   env.dbgPrintf("requested %d hits\n", max_matches);
   matched.clear();
   
   BingoFingerprints &fingerprints = _context.context().fingerprints;
   
   if (_fetch_type == _SUBSTRUCTURE)
   {
      if (fingerprints.ableToScreen(_screening))
      {
         while (matched.size() < max_matches)
         {
            if (_screening.passed.size() > 0)
            {
               int idx = _screening.passed.begin();
               _match(env, _screening.passed.at(idx));
               _screening.passed.remove(idx);
               continue;
            }

            if (fingerprints.screenPart_Init(env, _screening))
            {
               while (fingerprints.screenPart_Next(env, _screening))
                  ;
               fingerprints.screenPart_End(env, _screening);
               _unmatched += _screening.block->used - _screening.passed.size();
            }
            else
            {
               env.dbgPrintfTS("screening ended\n");
               break;
            }

            _screening.items_passed += _screening.passed.size();
            
            env.dbgPrintfTS("%d reactions passed screening\n", _screening.passed.size());
         } 
      }
      else
      {
         while (matched.size() < max_matches && _cur_idx < _context.context().context().storage.count())
            _match(env, _cur_idx++);
         
         env.dbgPrintfTS("%d reactions matched\n", matched.size());
      }
   }
   else
      throw Error("unexpected fetch type: %d", _fetch_type);
}
开发者ID:mojca,项目名称:indigo,代码行数:50,代码来源:ringo_fast_index.cpp

示例5: prepareSubstructure

void MangoFastIndex::prepareSubstructure (OracleEnv &env)
{
   env.dbgPrintf("preparing fastindex for substructure search\n");
   
   _context.context().context().storage.validate(env);
   _context.context().fingerprints.validate(env);
   _context.context().fingerprints.screenInit(_context.substructure.getQueryFingerprint(), _screening);

   env.dbgPrintfTS("Have %d bits in query fingerprint\n", _screening.query_ones.size());

   _fetch_type = _SUBSTRUCTURE;
   _cur_idx = 0;
   _matched = 0;
   _unmatched = 0;
}
开发者ID:Rillke,项目名称:indigo,代码行数:15,代码来源:mango_fast_index.cpp

示例6: _ringoRegisterReaction

bool _ringoRegisterReaction (OracleEnv &env, const char *rowid,
                             const Array<char> &reaction_buf,
                             RingoOracleContext &context,
                             RingoIndex &index,
                             BingoFingerprints &fingerprints)
{
   QS_DEF(Array<char>, data);
   QS_DEF(Array<char>, compressed_rowid);
   ArrayOutput output(data);

   output.writeChar(0); // 0 -- present, 1 -- removed from index
   
   ArrayOutput rid_output(compressed_rowid);
   RowIDSaver rid_saver(context.context().rid_dict, rid_output);

   rid_saver.saveRowID(rowid);

   output.writeByte((byte)compressed_rowid.size());
   output.writeArray(compressed_rowid);

   TRY_READ_TARGET_RXN
   {
      BufferScanner scanner(reaction_buf);

      try
      {
         index.prepare(scanner, output, NULL);
      }
      catch (CmfSaver::Error &e)
      { 
         if (context.context().reject_invalid_structures)
            throw; // Rethrow this exception further
         env.dbgPrintf(bad_reaction_warning_rowid, rowid, e.message());
         return false;
      }
      catch (CrfSaver::Error &e)
      { 
         if (context.context().reject_invalid_structures)
            throw; // Rethrow this exception further
         env.dbgPrintf(bad_reaction_warning_rowid, rowid, e.message());
         return false;
      }
   }
   CATCH_READ_TARGET_RXN_ROWID(rowid, {
      if (context.context().reject_invalid_structures)
         throw; // Rethrow this exception further
      return false;
   });
开发者ID:equilion,项目名称:indigo,代码行数:48,代码来源:ringo_oracle_index.cpp

示例7: _fetchSubstructure

void MangoFastIndex::_fetchSubstructure (OracleEnv &env, int max_matches)
{
   BingoFingerprints &fingerprints = _context.context().fingerprints;

   if (fingerprints.ableToScreen(_screening))
   {
      while (matched.size() < max_matches)
      {
         if (_screening.passed.size() > 0)
         {
            int idx = _screening.passed.begin();
            _match(env, _screening.passed.at(idx));
            _screening.passed.remove(idx);
            continue;
         }

         if (fingerprints.screenPart_Init(env, _screening))
         {
            while (fingerprints.screenPart_Next(env, _screening))
            {
               if (_screening.passed_pre.size() <= _context.context().context().sub_screening_pass_mark ||
                   _screening.query_bit_idx    >= _context.context().context().sub_screening_max_bits)
               {
                  env.dbgPrintfTS("stopping at bit #%d; ", _screening.query_bit_idx);
                  break;
               }
            }
            fingerprints.screenPart_End(env, _screening);
            _unmatched += _screening.block->used - _screening.passed.size();
         }
         else
         {
            env.dbgPrintfTS("screening ended\n");
            break;
         }

         _screening.items_passed += _screening.passed.size();
         env.dbgPrintf("%d molecules passed screening\n", _screening.passed.size());
      }
   }
   else
   {
      while (matched.size() < max_matches && _cur_idx < _context.context().context().storage.count())
         _match(env, _cur_idx++);

      env.dbgPrintfTS("%d molecules matched of tested %d\n", matched.size(), _cur_idx);
   }
}
开发者ID:Rillke,项目名称:indigo,代码行数:48,代码来源:mango_fast_index.cpp

示例8: _finishIndexLob

void BingoStorage::_finishIndexLob (OracleEnv &env)
{
    env.dbgPrintf("flushing index LOB\n");
    OracleLOB *index_lob = _getLob(env, 0);
    index_lob->write(_index_lob_pending_mark, _index_lob_pending_data);
    _index_lob_pending_mark += _index_lob_pending_data.size();
    _index_lob_pending_data.clear();
    delete index_lob;
}
开发者ID:whztt07,项目名称:Indigo,代码行数:9,代码来源:bingo_storage.cpp

示例9: _finishTopLob

void BingoStorage::_finishTopLob (OracleEnv &env)
{
    OracleLOB *top_lob = _getLob(env, _blocks.size());
    env.dbgPrintf("flushing storage LOB\n");
    top_lob->write(_top_lob_pending_mark, _top_lob_pending_data);
    _top_lob_pending_mark += _top_lob_pending_data.size();
    _top_lob_pending_data.clear();
    delete top_lob;
    top_lob = 0;
}
开发者ID:whztt07,项目名称:Indigo,代码行数:10,代码来源:bingo_storage.cpp

示例10: prepareTautomerSubstructure

void MangoFastIndex::prepareTautomerSubstructure (OracleEnv &env)
{
   env.dbgPrintfTS("preparing fastindex for tautomer substructure search\n");
   _context.context().context().storage.validate(env);
   _context.context().fingerprints.validate(env);
   _context.context().fingerprints.screenInit(_context.tautomer.getQueryFingerprint(), _screening);
   _fetch_type = _TAUTOMER_SUBSTRUCTURE;
   _cur_idx = 0;
   _matched = 0;
   _unmatched = 0;
}
开发者ID:Rillke,项目名称:indigo,代码行数:11,代码来源:mango_fast_index.cpp

示例11: prepareSimilarity

void MangoFastIndex::prepareSimilarity (OracleEnv &env)
{
   env.dbgPrintfTS("preparing fastindex for similarity search\n");
   _context.context().context().storage.validate(env);
   _context.context().fingerprints.validate(env);
   _context.context().fingerprints.screenInit(_context.similarity.getQueryFingerprint(), _screening);
   _fetch_type = _SIMILARITY;
   _cur_idx = 0;
   _matched = 0;
   _unmatched = 0;
}
开发者ID:Rillke,项目名称:indigo,代码行数:11,代码来源:mango_fast_index.cpp

示例12: fetch

void MangoFastIndex::fetch (OracleEnv &env, int max_matches)
{  
   env.dbgPrintf("requested %d hits\n", max_matches);
   matched.clear();
   
   if (_fetch_type == _SUBSTRUCTURE || _fetch_type == _TAUTOMER_SUBSTRUCTURE)
      _fetchSubstructure(env, max_matches);
   else if (_fetch_type == _SIMILARITY)
      _fetchSimilarity(env, max_matches);
   else
      throw Error("unexpected fetch type: %d", _fetch_type);
}
开发者ID:Rillke,项目名称:indigo,代码行数:12,代码来源:mango_fast_index.cpp

示例13: countOracleBlocks

int MangoShadowFetch::countOracleBlocks (OracleEnv &env)
{
   int res;

   env.dbgPrintf("countOracleBlocks\n");

   if (!OracleStatement::executeSingleInt(res, env, "select blocks from user_tables where "
              "table_name = upper('%s')", _table_name.ptr()))
      return 0;

   return res;
}
开发者ID:epam,项目名称:Indigo,代码行数:12,代码来源:mango_shadow_fetch.cpp

示例14: prepareSubstructure

void RingoFastIndex::prepareSubstructure (OracleEnv &env)
{
   env.dbgPrintf("preparing fastindex for reaction substructure search\n");
   
   _context.context().context().storage.validate(env);
   _context.context().fingerprints.validate(env);
   _context.context().fingerprints.screenInit(_context.substructure.getQueryFingerprint(), _screening);
   _fetch_type = _SUBSTRUCTURE;
   _cur_idx = 0;
   _matched = 0;
   _unmatched = 0;
}
开发者ID:mojca,项目名称:indigo,代码行数:12,代码来源:ringo_fast_index.cpp

示例15: mangoPrepareMolecule

bool mangoPrepareMolecule (OracleEnv &env, const char *rowid,
                            const Array<char> &molfile_buf,
                            MangoOracleContext &context,
                            MangoIndex &index,
                            Array<char> &data,
                            OsLock *lock_for_exclusive_access)
{
   profTimerStart(tall, "moleculeIndex.prepare");

   ArrayOutput output(data);

   output.writeChar(0); // 0 -- present, 1 -- removed from index

   QS_DEF(Array<char>, compressed_rowid);
   ArrayOutput rid_output(compressed_rowid);

   {
      // RowIDSaver modifies context.context().rid_dict and 
      // requires exclusive access for this
      OsLockerNullable locker(lock_for_exclusive_access);

      RowIDSaver rid_saver(context.context().rid_dict, rid_output);

      rid_saver.saveRowID(rowid);
   }

   output.writeByte((byte)compressed_rowid.size());
   output.writeArray(compressed_rowid);

   TRY_READ_TARGET_MOL
   {
      BufferScanner scanner(molfile_buf);

      try
      {
         index.prepare(scanner, output, lock_for_exclusive_access);
      }
      catch (CmfSaver::Error &e) 
      {
         OsLockerNullable locker(lock_for_exclusive_access);
         env.dbgPrintf(bad_molecule_warning_rowid, rowid, e.message());
         return false;
      }
   }
   CATCH_READ_TARGET_MOL_ROWID(rowid, return false);

   // some magic: round it up to avoid ora-22282
   if (data.size() % 2 == 1)
      output.writeChar(0);
   
   return true;
}
开发者ID:Rillke,项目名称:indigo,代码行数:52,代码来源:mango_oracle_index.cpp


注:本文中的OracleEnv类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。