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


C++ TA_TRACE_BEGIN函数代码示例

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


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

示例1: freeFileIndexPriv

static TA_RetCode freeFileIndexPriv( void *toBeFreed )
{
   TA_PROLOG;
   TA_FileIndexPriv *asciiFileData;
   TA_Libc          *libHandle;
   TA_StringCache   *stringCache;

   asciiFileData = (TA_FileIndexPriv *)toBeFreed;

   libHandle   = asciiFileData->libHandle;
   TA_TRACE_BEGIN( libHandle, freeFileIndexPriv );

   stringCache = TA_GetGlobalStringCache( libHandle );

   if( !asciiFileData )
   {
      TA_TRACE_RETURN( TA_ALLOC_ERR );
   }

   if( freeListAndElement( libHandle, asciiFileData->listLocationToken, freeTokenInfo ) != TA_SUCCESS )
   {
      TA_TRACE_RETURN( TA_ALLOC_ERR );
   }

   if( freeListAndElement( libHandle, asciiFileData->listCategory, freeCategoryData ) != TA_SUCCESS )
   {
      TA_TRACE_RETURN( TA_ALLOC_ERR );
   }

   if( asciiFileData->root )
      TA_FileIndexFreeValueTree( libHandle, asciiFileData->root );

   if( asciiFileData->scratchPad )
      TA_Free( libHandle, asciiFileData->scratchPad );

   if( asciiFileData->wildOneChar )
      TA_StringFree( stringCache, asciiFileData->wildOneChar );

   if( asciiFileData->wildZeroOrMoreChar )
      TA_StringFree( stringCache, asciiFileData->wildZeroOrMoreChar );

   if( asciiFileData->wildOneOrMoreChar )
      TA_StringFree( stringCache, asciiFileData->wildOneOrMoreChar );

   if( asciiFileData->initialCategoryString )
      TA_StringFree( stringCache, asciiFileData->initialCategoryString );

   if( asciiFileData->initialCategoryCountryString )
      TA_StringFree( stringCache, asciiFileData->initialCategoryCountryString );

   if( asciiFileData->initialCategoryExchangeString )
      TA_StringFree( stringCache, asciiFileData->initialCategoryExchangeString );

   if( asciiFileData->initialCategoryTypeString )
      TA_StringFree( stringCache, asciiFileData->initialCategoryTypeString );

   TA_Free( libHandle, asciiFileData );

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:60,代码来源:ta_fileindex_priv.c

示例2: freeListAndElement

static TA_RetCode freeListAndElement( TA_Libc *libHandle, TA_List *list, TA_RetCode (*freeFunc)( TA_Libc *libHandle, void *toBeFreed ) )
{
   TA_PROLOG;
   TA_RetCode retCode;
   void *node;

   TA_TRACE_BEGIN( libHandle, freeListAndElement );

   if( list != NULL )
   {
      while( (node = TA_ListRemoveTail( list )) != NULL )
      {
         retCode = freeFunc( libHandle, node );
         if( retCode != TA_SUCCESS )
         {
            TA_FATAL( libHandle, NULL, node, retCode );
            TA_TRACE_RETURN( TA_ALLOC_ERR );
         }
      }

      retCode = TA_ListFree( list );
      if( retCode != TA_SUCCESS )
      {
         TA_FATAL( libHandle, NULL, list, retCode );
         TA_TRACE_RETURN( TA_ALLOC_ERR );
      }
   }

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:30,代码来源:ta_fileindex_priv.c

示例3: getGroupId

   static TA_RetCode getGroupId( const char *groupString, unsigned int *groupId )
#endif
{
   #ifdef TA_GEN_CODE
   TA_PROLOG;
   #endif

   unsigned int i;

   #ifdef TA_GEN_CODE
      TA_TRACE_BEGIN( libHandle, getgroupId );

      TA_ASSERT( libHandle, groupString != NULL );
      TA_ASSERT( libHandle, groupId != NULL );
   #endif

   for( i=0; i < TA_NB_GROUP_ID; i++ )
   {
      if( strcmp( TA_GroupString[i], groupString ) == 0 )
      {
         *groupId = i;
         #ifdef TA_GEN_CODE
            TA_TRACE_RETURN( TA_SUCCESS );
         #else
            return TA_SUCCESS;
         #endif
      }
   }

   #ifdef TA_GEN_CODE
      TA_TRACE_RETURN( TA_GROUP_NOT_FOUND );
   #else
      return TA_GROUP_NOT_FOUND;
   #endif
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:35,代码来源:ta_abstract.c

示例4: getFuncNameByIdx

   static TA_RetCode getFuncNameByIdx( TA_GroupId groupId,
                                       unsigned int idx,
                                       const char **stringPtr )
#endif
{
   #ifdef TA_GEN_CODE
      /* Code used only when compiled with gen_code. */
      TA_PROLOG;
      unsigned int curIdx;
      unsigned int i, j, found;
      const TA_FuncDef **funcDefTable;
      unsigned int tableSize;
      const TA_FuncInfo *funcInfo;

      TA_TRACE_BEGIN( libHandle, getFuncNameByIdx );

      TA_ASSERT( libHandle, stringPtr != NULL );

      curIdx = 0;
      found = 0;
      for( i=0; (i < 26) && !found; i++ )
      {
         funcDefTable = TA_DEF_Tables[i];
         tableSize = *(TA_DEF_TablesSize[i]);

         for( j=0; (j < tableSize) && !found; j++ )
         {
            if( funcDefTable[j]->groupId == groupId )
            {
               if( idx == curIdx )
               {
                  funcInfo = funcDefTable[j]->funcInfo;
                  TA_ASSERT( libHandle, funcInfo != NULL );
                  *stringPtr = funcInfo->name;
                  found = 1;
               }
               curIdx++;
            }
         }
      }

      TA_ASSERT( libHandle, found == 1 );
      TA_ASSERT( libHandle, *stringPtr != NULL );

      TA_TRACE_RETURN( TA_SUCCESS );
   #else
      /* Optimized code in the final library. */
      const TA_FuncDef **funcDefTable;
      const TA_FuncInfo *funcInfo;

      funcDefTable = TA_PerGroupFuncDef[groupId];
      funcInfo = funcDefTable[idx]->funcInfo;
      *stringPtr = funcInfo->name;

      return TA_SUCCESS;
   #endif
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:57,代码来源:ta_abstract.c

示例5: TA_HistoryCheckInternal

/**** Global functions definitions.   ****/
TA_RetCode TA_HistoryCheckInternal( TA_Libc            *libHandle,
                                    TA_Period           expectedPeriod,
                                    const TA_Timestamp *expectedStart,
                                    const TA_Timestamp *expectedEnd,
                                    TA_Field            fieldToCheck,
                                    const TA_History   *history,
                                    unsigned int       *faultyIndex,
                                    unsigned int       *faultyField )
{
   TA_PROLOG;
   unsigned int allFieldNull;

   (void)faultyField;
   (void)faultyIndex;
   (void)fieldToCheck;
   (void)expectedEnd;
   (void)expectedStart;

   TA_TRACE_BEGIN( libHandle, TA_HistoryCheckInternal );

   TA_ASSERT( libHandle, history != NULL );

   /* Period shall be always set in the history. */
   if( history->period != expectedPeriod )
   {
      TA_TRACE_RETURN( TA_UNKNOWN_ERR );
   }

   /* Verify that an empty history is really empty. */
   if( (history->open  == NULL) &&
       (history->high  == NULL) &&
       (history->low   == NULL) &&
       (history->close == NULL) &&
       (history->volume == NULL) &&
       (history->openInterest == NULL) &&
       (history->timestamp == NULL) )
   {
      allFieldNull = 1;
      if( history->nbBars != 0 )
      {
         TA_TRACE_RETURN( TA_UNKNOWN_ERR );
      }
   }
   else
      allFieldNull = 0;

   if( (history->nbBars == 0) && !allFieldNull )
   {
      TA_TRACE_RETURN( TA_UNKNOWN_ERR );
   }

   /* !!! Some more runtime verification could be added here... */

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:56,代码来源:ta_historycheck.c

示例6: TA_FileIndexMoveToPrevToken

TA_RetCode TA_FileIndexMoveToPrevToken( TA_FileIndexPriv *data )
{
   TA_PROLOG;
   TA_Libc *libHandle;
   TA_RetCode retCode;

   if( !data )
      return TA_UNKNOWN_ERR;

   libHandle = data->libHandle;
   TA_TRACE_BEGIN( libHandle, TA_FileIndexMoveToPrevToken );

   if( data->curToken == NULL )
   {
      /* Iterator variable not initialize. Simply position everything on the
       * first token.
       */
      retCode = TA_FileIndexMoveToNextToken( data );
      TA_TRACE_RETURN( retCode ); 
   }
   else if( data->prevToken == NULL )
   {
      /* Can't go further back. Simply return. */
      TA_TRACE_RETURN( TA_SUCCESS );
   }
   else
   {
      if( data->curDirectionForward == 1 )
      {
         if( data->nextToken != NULL )
            TA_ListAccessPrev( data->listLocationToken );
         else
            TA_ListAccessTail( data->listLocationToken );

         TA_ListAccessPrev( data->listLocationToken );
         data->curDirectionForward = 0;
      }

      data->nextToken = data->curToken;
      data->curToken = data->prevToken;
      data->prevToken = (TA_TokenInfo *)TA_ListAccessPrev( data->listLocationToken );

      /* Parano test: Should never happen since the code assume that
       * the 'listLocationToken' is always terminated by TA_END.
       */
      if( !data->curToken )
      {
         TA_FATAL( data->libHandle, NULL, data->curToken->id, data->curTokenDepth );
      }
   }
   data->curTokenDepth--;

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:54,代码来源:ta_fileindex_utils.c

示例7: TA_FileIndexAddTokenInfo

TA_RetCode TA_FileIndexAddTokenInfo( TA_FileIndexPriv *data,
                                     TA_TokenId id,
                                     TA_String *value,
                                     TA_TokenInfo *optBefore )
{
   TA_PROLOG;
   TA_RetCode retCode;
   TA_TokenInfo *info;
   TA_Libc *libHandle;
   TA_StringCache *stringCache;

   libHandle   = data->libHandle;
   TA_TRACE_BEGIN( libHandle, TA_FileIndexAddTokenInfo );

   stringCache = TA_GetGlobalStringCache( libHandle );

   info = TA_Malloc( libHandle, sizeof( TA_TokenInfo ) );

   if( !info )
   {
      TA_TRACE_RETURN( TA_ALLOC_ERR );
   }

   info->id = id;
   if( value == NULL )
      info->value = NULL;
   else
   {
      info->value = TA_StringDup( stringCache, value );

      if( !info->value )
      {
         TA_Free( libHandle, info );
         TA_TRACE_RETURN( TA_ALLOC_ERR );
      }
   }

   if( optBefore )
      retCode = TA_ListAddBefore( data->listLocationToken, optBefore, info );
   else
      retCode = TA_ListAddTail( data->listLocationToken, info );

    if( retCode != TA_SUCCESS )
    {
      if( info->value )
         TA_StringFree( stringCache, info->value );
      TA_Free( libHandle, info );
      TA_TRACE_RETURN( retCode );
   }

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:52,代码来源:ta_fileindex_priv.c

示例8: TA_FileIndexAddTreeValue

TA_RetCode TA_FileIndexAddTreeValue( TA_FileIndexPriv *data,
                                     TA_String *string,
                                     TA_ValueTreeNode **added )
{
   TA_PROLOG;
   TA_ValueTreeNode *node;
   unsigned int allocateEmptyString;
   TA_Libc *libHandle;
   TA_StringCache *stringCache;

   libHandle = data->libHandle;
   TA_TRACE_BEGIN( libHandle, TA_FileIndexAddTreeValue );

   stringCache = TA_GetGlobalStringCache( libHandle );

   allocateEmptyString = 0;
   TA_ASSERT( libHandle, data != NULL );

   if( added )
      *added = NULL;

   if( !string )
   {
      string = TA_StringAlloc( stringCache, "" );
      if( !string )
      {
         TA_TRACE_RETURN( TA_ALLOC_ERR );
      }
      allocateEmptyString = 1;
   }

   /* Alloc the TA_ValueTreeNode */
   node = allocTreeNode( libHandle, data->currentNode, string );

   if( allocateEmptyString )
      TA_StringFree( stringCache, string );

   if( !node )
   {
      TA_TRACE_RETURN( TA_ALLOC_ERR );
   }

   data->currentNode = node;

   if( added )
      *added = node;

   TA_TRACE_RETURN( TA_SUCCESS );
}
开发者ID:royratcliffe,项目名称:ta-lib,代码行数:49,代码来源:ta_fileindex_priv.c


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