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


C++ ProgressMeterHolder::get方法代码示例

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


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

示例1: run

 void run() {
     // It's necessary to index sufficient keys that a RARELY condition will be triggered.
     int32_t nDocs = 130;
     // Add some data to the collection.
     for( int32_t i = 0; i < nDocs; ++i ) {
         _client.insert( _ns, BSON( "a" << i ) );
     }
     IndexDetails& id = addIndexWithInfo();
     // Create a SortPhaseOne.
     SortPhaseOne phaseOne;
     ProgressMeterHolder pm (cc().curop()->setMessage("InterruptAddKeysToPhaseOne",
                                                      "InterruptAddKeysToPhaseOne Progress",
                                                      nDocs,
                                                      nDocs));
     // Register a request to kill the current operation.
     cc().curop()->kill();
     if ( _mayInterrupt ) {
         // Add keys to phaseOne.
         ASSERT_THROWS( BtreeBasedBuilder::addKeysToPhaseOne( nsdetails(_ns), _ns,
                                           id,
                                           BSON( "a" << 1 ),
                                           &phaseOne,
                                           nDocs,
                                           pm.get(),
                                           _mayInterrupt,
                                           nsdetails(_ns)->idxNo(id) ),
                        UserException );
         // Not all keys were added to phaseOne due to the interrupt.
         ASSERT( static_cast<uint64_t>( nDocs ) > phaseOne.n );
     }
     else {
         // Add keys to phaseOne.
         BtreeBasedBuilder::addKeysToPhaseOne( nsdetails(_ns), _ns,
                            id,
                            BSON( "a" << 1 ),
                            &phaseOne,
                            nDocs,
                            pm.get(),
                            _mayInterrupt, nsdetails(_ns)->idxNo(id) );
         // All keys were added to phaseOne despite to the kill request, because
         // mayInterrupt == false.
         ASSERT_EQUALS( static_cast<uint64_t>( nDocs ), phaseOne.n );
     }
 }
开发者ID:violentesc,项目名称:mongo,代码行数:44,代码来源:indexupdatetests.cpp

示例2: run

        void run() {
            // Add some data to the collection.
            int32_t nDocs = 130;
            for( int32_t i = 0; i < nDocs; ++i ) {
                _client.insert( _ns, BSON( "a" << i ) );
            }

            IndexDescriptor* id = addIndexWithInfo();
            // Create a SortPhaseOne.
            SortPhaseOne phaseOne;
            ProgressMeterHolder pm (cc().curop()->setMessage("AddKeysToPhaseOne",
                                                             "AddKeysToPhaseOne Progress",
                                                             nDocs,
                                                             nDocs));
            // Add keys to phaseOne.
            BtreeBasedBuilder::addKeysToPhaseOne( collection(),
                                                  id,
                                                  BSON( "a" << 1 ),
                                                  &phaseOne,
                                                  pm.get(), true );
            // Keys for all documents were added to phaseOne.
            ASSERT_EQUALS( static_cast<uint64_t>( nDocs ), phaseOne.n );
        }
开发者ID:Albert-B-P,项目名称:mongo,代码行数:23,代码来源:indexupdatetests.cpp


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