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


C++ SDB_ASSERT函数代码示例

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


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

示例1: getOption

      INT32 getOption( CHAR **optAddr, UINT32 *optSize = NULL ) const
      {
         INT32 rc = SDB_OK ;
         SDB_ASSERT( optAddr, "Option buffer is NULL" ) ;

         if ( 0 == _optSize )
         {
            rc = SDB_SYS ;
            goto error ;
         }
         *optAddr = (CHAR *)this + sizeof(_dmsOptExtent) ;
         if ( optSize )
         {
            *optSize = _optSize ;
         }
      done:
         return rc ;
      error:
         goto done ;
      }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:20,代码来源:dmsExtent.hpp

示例2: qgmDump

 INT32 qgmDump ( _qgmPlanContainer *op, CHAR *pBuffer, INT32 bufferSize )
 {
    INT32 rc = SDB_OK ;
    INT32 id = 0 ;
    SDB_ASSERT ( op && pBuffer, "op and pBuffer can't be NULL" ) ;
    _qgmOperatorElement rootElement ;
    rc = qgmCalcElement ( op->plan(), &rootElement, id, 0 ) ;
    PD_RC_CHECK ( rc, PDERROR, "Failed to calc element, rc = %d", rc ) ;
    rc = qgmAssignPos ( &rootElement, 0 ) ;
    PD_RC_CHECK ( rc, PDERROR, "Failed to assign pos, rc = %d", rc ) ;
    rc = qgmPrint ( &rootElement, pBuffer, bufferSize ) ;
    PD_RC_CHECK ( rc, PDERROR, "Failed to print, rc = %d", rc ) ;
    id = 0 ;
    rc = qgmDumpDetails ( op->plan(), pBuffer, bufferSize, id ) ;
    PD_RC_CHECK ( rc, PDERROR, "Failed to dump details, rc = %d", rc ) ;
 done :
    return rc ;
 error :
    goto done ;
 }
开发者ID:247687009,项目名称:SequoiaDB,代码行数:20,代码来源:qgmDump.cpp

示例3: utilStrJoin

 INT32 utilStrJoin( const CHAR **src,
                    UINT32 cnt,
                    CHAR *join,
                    UINT32 &joinSize )
 {
    SDB_ASSERT( NULL != join, "impossible" ) ;
    INT32 rc = SDB_OK ;
    UINT32 len = 0 ;
    for ( UINT32 i = 0; i < cnt; i++ )
    {
       if ( NULL != src[i] )
       {
          UINT32 sLen = ossStrlen(src[i]) ;
          ossMemcpy( join + len, src[i], sLen ) ;
          len += sLen ;
       }
    }
    joinSize = len ;
    return rc ;
 }
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:20,代码来源:utilStr.cpp

示例4: PD_TRACE_ENTRY

   // PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU__RESETCOLLECTION, "_dmsStorageUnit::_resetCollection" )
   INT32 _dmsStorageUnit::_resetCollection( dmsMBContext *context )
   {
      INT32 rc                     = SDB_OK ;
      PD_TRACE_ENTRY ( SDB__DMSSU__RESETCOLLECTION ) ;
      SDB_ASSERT( context, "context can't be NULL" ) ;

      rc = _pIndexSu->dropAllIndexes( context, NULL, NULL ) ;
      if ( rc )
      {
         PD_LOG( PDERROR, "Drop all indexes failed, rc: %d", rc ) ;
      }

      rc = _pDataSu->_truncateCollection( context ) ;
      if ( rc )
      {
         PD_LOG( PDERROR, "Truncate collection data failed, rc: %d", rc ) ;
      }
      PD_TRACE_EXITRC ( SDB__DMSSU__RESETCOLLECTION, rc ) ;
      return rc ;
   }
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:21,代码来源:dmsStorageUnit.cpp

示例5: SDB_ASSERT

 void dmsStorageLoadOp::_initExtentHeader ( dmsExtent *extAddr,
                                            UINT16 numPages )
 {
    SDB_ASSERT ( _pageSize * numPages == _currentExtentSize,
                 "extent size doesn't match" ) ;
    extAddr->_eyeCatcher[0]          = DMS_EXTENT_EYECATCHER0 ;
    extAddr->_eyeCatcher[1]          = DMS_EXTENT_EYECATCHER1 ;
    extAddr->_blockSize              = numPages ;
    extAddr->_mbID                   = 0 ;
    extAddr->_flag                   = DMS_EXTENT_FLAG_INUSE ;
    extAddr->_version                = DMS_EXTENT_CURRENT_V ;
    extAddr->_logicID                = DMS_INVALID_EXTENT ;
    extAddr->_prevExtent             = DMS_INVALID_EXTENT ;
    extAddr->_nextExtent             = DMS_INVALID_EXTENT ;
    extAddr->_recCount               = 0 ;
    extAddr->_firstRecordOffset      = DMS_INVALID_EXTENT ;
    extAddr->_lastRecordOffset       = DMS_INVALID_EXTENT ;
    extAddr->_freeSpace              = _pageSize * numPages -
                                       sizeof(dmsExtent) ;
 }
开发者ID:2015520,项目名称:SequoiaDB,代码行数:20,代码来源:dmsStorageLoadExtent.cpp

示例6: PD_TRACE_ENTRY

   INT32 migMaster::sendMsgToClient ( const CHAR *format, ... )
   {
      INT32 rc = SDB_OK ;
      PD_TRACE_ENTRY ( SDB__MIGLOADJSONPS__SENDMSG );
      SDB_ASSERT ( _sock, "_sock is NULL" ) ;
      va_list ap;
      pmdEDUCB *eduCB = pmdGetKRCB()->getEDUMgr()->getEDU() ;
      CHAR buffer[ PD_LOG_STRINGMAX ] ;
      boost::unique_lock<boost::mutex> lock ( _mutex ) ;

      ossMemset ( buffer, 0, PD_LOG_STRINGMAX ) ;
      va_start(ap, format) ;
      vsnprintf(buffer, PD_LOG_STRINGMAX, format, ap) ;
      va_end(ap) ;

      if ( _sendMsg )
      {
         ossMemset ( _sendMsg, 0, _sendSize ) ;
      }

      rc = msgBuildMsgMsg ( &_sendMsg, &_sendSize,
                            0, buffer ) ;
      if ( rc )
      {
         PD_LOG ( PDERROR, "Failed to msgBuildMsgMsg" ) ;
         goto error ;
      }

      rc = pmdSend ( _sendMsg, *(INT32 *)_sendMsg,
                     _sock, eduCB ) ;
      if ( rc )
      {
         PD_LOG ( PDERROR, "Failed to send buff, rc=%d", rc ) ;
         goto error ;
      }
   done:
      PD_TRACE_EXITRC ( SDB__MIGLOADJSONPS__SENDMSG, rc );
      return rc ;
   error:
      goto done ;
   }
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:41,代码来源:migLoad.cpp

示例7: PD_TRACE_ENTRY

   ///PD_TRACE_DECLARE_FUNCTION ( SDB__MTHINCLUDEPARSER_PARSE, "_mthIncludeParser::parse" )
   INT32 _mthIncludeParser::parse( const bson::BSONElement &e,
                                   _mthSAction &action ) const
   {
      INT32 rc = SDB_OK ;
      PD_TRACE_ENTRY( SDB__MTHINCLUDEPARSER_PARSE ) ;
      SDB_ASSERT( !e.eoo(), "can not be eoo" ) ;

      if ( !e.isNumber() )
      {
         PD_LOG( PDERROR, "invalid element type[%d]", e.type() ) ;
         rc = SDB_INVALIDARG ;
         goto error ;
      }

#if defined (_DEBUG)
      if ( 0 != _name.compare( e.fieldName() ) )
      {
         PD_LOG( PDERROR, "field name[%s] is not valid",
                 e.fieldName() ) ;
         rc = SDB_INVALIDARG ;
         goto error ;
      }
#endif

      action.setName( _name.c_str() ) ;
      if ( 0 == e.numberLong() )
      {
         action.setAttribute( MTH_S_ATTR_EXCLUDE ) ;
      }
      else
      {
         action.setAttribute( MTH_S_ATTR_INCLUDE ) ;
         action.setFunc( &mthIncludeBuild,
                         &mthIncludeGet ) ;
      }
   done:
      PD_TRACE_EXITRC( SDB__MTHINCLUDEPARSER_PARSE, rc ) ;
      return rc ;
   error:
      goto done ;
   }
开发者ID:2015520,项目名称:SequoiaDB,代码行数:42,代码来源:mthIncludeParser.cpp

示例8: PD_TRACE_ENTRY

   // PD_TRACE_DECLARE_FUNCTION( SDB__QGMCONDITIONNODEHELPER_SEPARATE2, "_qgmConditionNodeHelper::_separate2" )
   void _qgmConditionNodeHelper::_separate( _qgmConditionNode *predicate,
                                            qgmConditionNodePtrVec &nodes )
   {
      PD_TRACE_ENTRY( SDB__QGMCONDITIONNODEHELPER_SEPARATE2 ) ;
      SDB_ASSERT( NULL != predicate, "predicate can't be NULL" ) ;

      if ( SQL_GRAMMAR::AND == predicate->type )
      {
         _separate( predicate->left, nodes ) ;
         _separate( predicate->right, nodes ) ;

         predicate->dettach() ;
         SAFE_OSS_DELETE( predicate ) ;
      }
      else if ( predicate )
      {
         nodes.push_back( predicate ) ;
      }

      PD_TRACE_EXIT( SDB__QGMCONDITIONNODEHELPER_SEPARATE2 ) ;
   }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:22,代码来源:qgmConditionNodeHelper.cpp

示例9: PD_TRACE_ENTRY

// PD_TRACE_DECLARE_FUNCTION ( SDB_OSSSK_SETSKLI, "ossSocket::setSocketLi" )
INT32 _ossSocket::setSocketLi ( INT32 lOnOff, INT32 linger )
{
   INT32 rc = SDB_OK ;
   PD_TRACE_ENTRY ( SDB_OSSSK_SETSKLI );
   SDB_ASSERT ( _init, "socket is not initialized" ) ;

   struct linger _linger ;
   _linger.l_onoff = lOnOff ;
   _linger.l_linger = linger ;

   PD_CHECK( _init, SDB_SYS, error, PDWARNING, "Socket is not init" ) ;

   rc = setsockopt ( _fd, SOL_SOCKET, SO_LINGER,
                     (const char*)&_linger, sizeof (_linger) ) ;

done:
   PD_TRACE_EXITRC ( SDB_OSSSK_SETSKLI, rc );
   return rc ;
error:
   goto done ;
}
开发者ID:BryanLance,项目名称:SequoiaDB,代码行数:22,代码来源:ossSocket.cpp

示例10: SDB_ASSERT

   void *_pmdEDUCB::getAlignedMemory( UINT32 alignment, UINT32 size )
   {
      SDB_ASSERT( alignment == OSS_FILE_DIRECT_IO_ALIGNMENT,
                  "rewrite this function if u want to use new alignment" ) ;
      if ( _alignedMemSize < size )
      {
         if ( NULL != _alignedMem )
         {
            SDB_OSS_ORIGINAL_FREE( _alignedMem ) ;
            _alignedMemSize = 0 ;
            _alignedMem = NULL ; 
         }

         _alignedMem = ossAlignedAlloc( alignment, size ) ;
         if ( NULL != _alignedMem )
         {
            _alignedMemSize = size ;
         }
      }
      return _alignedMem ;
   }
开发者ID:jasonsungblog,项目名称:SequoiaDB,代码行数:21,代码来源:pmdEDU.cpp

示例11: PD_TRACE_ENTRY

   INT32 _qgmPlNLJoin::_modifyInnerCondition( BSONObj &obj )
   {
      PD_TRACE_ENTRY( SDB__QGMPLNLJOIN__MODIFYINNERCONDITION ) ;
      SDB_ASSERT( NULL != _param, "impossible" ) ;
      INT32 rc = SDB_OK ;

      QGM_VARLIST::const_iterator itr = _varlist.begin() ;
      for ( ; itr != _varlist.end(); itr++ )
      {
         rc = _param->setVar( *itr, obj ) ;
         if ( SDB_OK != rc )
         {
            goto error ;
         }
      }
   done:
      PD_TRACE_EXITRC( SDB__QGMPLNLJOIN__MODIFYINNERCONDITION, rc ) ;
      return rc ;
   error:
      goto done ;
   }
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:21,代码来源:qgmPlNLJoin.cpp

示例12: SDB_ASSERT

   // PD_TRACE_DECLARE_FUNCTION ( SDB__IXMINXCB_GETKEY, "_ixmIndexCB::getKeysFromObject" )
   INT32 _ixmIndexCB::getKeysFromObject ( const BSONObj &obj,
                                          BSONObjSet &keys ) const
   {
      INT32 rc = SDB_OK ;
      SDB_ASSERT ( _isInitialized,
                   "index details must be initialized first" ) ;
      PD_TRACE_ENTRY ( SDB__IXMINXCB_GETKEY );
      ixmIndexKeyGen keyGen(this) ;
      rc = keyGen.getKeys ( obj, keys ) ;
      if ( rc )
      {
         PD_LOG ( PDERROR, "Failed to generate key from object, rc: %d", rc ) ;
         goto error ;
      }

   done :
      PD_TRACE_EXITRC ( SDB__IXMINXCB_GETKEY, rc );
      return rc ;
   error :
      goto done ;
   }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:22,代码来源:ixm.cpp

示例13: PD_TRACE_ENTRY

   // PD_TRACE_DECLARE_FUNCTION ( SDB__CLSREPSET_UNREGSN, "_clsReplicateSet::unregSession" )
   void _clsReplicateSet::unregSession ( _clsDataSrcBaseSession * pSession )
   {
      PD_TRACE_ENTRY ( SDB__CLSREPSET_UNREGSN );
      SDB_ASSERT ( pSession, "Session can't be null" ) ;

      _vecLatch.lock_w () ;
      std::vector<_clsDataSrcBaseSession*>::iterator it =
         _vecSrcSessions.begin() ;
      while ( it != _vecSrcSessions.end() )
      {
         if ( *it == pSession )
         {
            _vecSrcSessions.erase ( it ) ;
            _srcSessionNum-- ;
            break ;
         }
         ++it ;
      }
      _vecLatch.release_w () ;
      PD_TRACE_EXIT ( SDB__CLSREPSET_UNREGSN );
   }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:22,代码来源:clsReplicateSet.cpp

示例14: PD_TRACE_ENTRY

   INT32 _qgmPlScan::_executeOnCoord( _pmdEDUCB *eduCB )
   {
      PD_TRACE_ENTRY( SDB__QGMPLSCAN__EXECONCOORD ) ;
      INT32 rc = SDB_OK ;
      INT32 bufSize = 0 ;
      CHAR *qMsg = NULL ;
      MsgOpReply dummyReply ;
      BSONObj *err = NULL ;
      BSONObj selector = _selector.selector() ;

      rc = msgBuildQueryMsg ( &qMsg, &bufSize,
                              _collection.toString().c_str(),0,
                              0, _skip, _return,
                              &_condition, &selector,
                              &_orderby, &_hint ) ;

      if ( SDB_OK != rc )
      {
         goto error ;
      }

      rc = _coordQuery.execute ( qMsg, *(SINT32*)qMsg, eduCB,
                                 dummyReply, NULL ) ;
      SDB_ASSERT( NULL == err, "impossible" ) ;
      PD_RC_CHECK ( rc, PDERROR,
                    "Failed to execute coordQuery, rc = %d", rc ) ;

      _contextID = dummyReply.contextID ;

   done:
      if ( NULL != qMsg )
      {
         SDB_OSS_FREE( qMsg ) ;
         qMsg = NULL ;
      }
      PD_TRACE_EXITRC( SDB__QGMPLSCAN__EXECONCOORD, rc ) ;
      return rc ;
   error:
      goto done ;
   }
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:40,代码来源:qgmPlScan.cpp

示例15: SDB_ASSERT

   INT32 _coordCMDEval::_buildContext( _spdSession *session,
                                       pmdEDUCB *cb,
                                       SINT64 &contextID )
   {
      INT32 rc = SDB_OK ;
      const BSONObj &evalRes = session->getRetMsg() ;
      SDB_ASSERT( !evalRes.isEmpty(), "impossible" ) ;

      SDB_RTNCB *rtnCB = pmdGetKRCB()->getRTNCB() ;
      rtnContextSP *context = NULL ;
      rc = rtnCB->contextNew ( RTN_CONTEXT_SP, (rtnContext**)&context,
                               contextID, cb ) ;
      PD_RC_CHECK( rc, PDERROR, "Failed to create new context, rc: %d", rc ) ;

      rc = context->open( session ) ;
      PD_RC_CHECK( rc, PDERROR, "Failed to open context[%lld], rc: %d",
                   context->contextID(), rc ) ;
   done:
      return rc ;
   error:
      goto done ;
   }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:22,代码来源:coordCommandProcedure.cpp


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