• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LogAssert函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LogAssert

// param points to the DrThread, already IncRef'd
DWORD WINAPI DrThread::ThreadEntryStatic(void * param)
{
    DrThread *pThread = (DrThread *)param;

    // We save a pointer to this thread object in thread-local storage. That way,
    // You can always find your current thread object with DrGetCurrentThread().
    //
    LogAssert(t_pThread.IsNull());
    t_pThread = pThread;  // save pointer to ourselves in thread local storage

    DrLogI( "Dryad thread starting. %s, pThread=%p", pThread->m_strDescription.GetString(), pThread);

    DWORD ret = pThread->ThreadEntry();

    DrLogI( "Dryad thread exiting. %s, pThread=%p, exitcode=%08x", pThread->m_strDescription.GetString(), pThread, ret);

    LogAssert(t_pThread == pThread);

    // no longer under our control...
    t_pThread = NULL;

    pThread->DecRef(); // The DrThread will be freed when noone is interested in it anymoe

    return ret;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:26,代码来源:DrThread.cpp


示例2: LogAssert

StrTab::StrTab(std::istream &file, off_t start_offset, off_t end_offset, bool makeUnique)
{
	LogAssert(end_offset > start_offset);
	file.seekg(start_offset, file.beg);
	LogAssert(file);
	char c = '\0';
	std::map<std::string, int> unique_id;
	while (file && file.tellg() <= end_offset)
	{
		std::string s;
		file.get(c);
		while (c && file && file.tellg() <= end_offset)
		{
			s += c;
			file.get(c);
		}
		if (makeUnique)
		{
			if (unique_id.find(s) != unique_id.end())
			{
				std::stringstream ss;
				ss << s << " " << ++unique_id[s];
				s = ss.str();
				LogWarning("Munged string to make unique: \"%s\"", s.c_str());
			}
			else
				unique_id.emplace(s, 0);
		}
		readStrings.push_back(s);
	}
	if (c)
		LogError("Table didn't end with NULL");
}
开发者ID:JonnyH,项目名称:OpenApoc,代码行数:33,代码来源:strtab.cpp


示例3: InitTextureCoords

void FontSymbol::RenderToBuffer(unsigned char *buffer, unsigned int textureWidth, unsigned int textureHeight)
{
    if (IsEmpty())
    {
        return;
    }

    InitTextureCoords(textureWidth, textureHeight);

    FT_Glyph_To_Bitmap(&this->ftGlyph, FT_RENDER_MODE_NORMAL, NULL, true);
    FT_BitmapGlyph bitmapGlyph = reinterpret_cast<FT_BitmapGlyph>(this->ftGlyph);

    LogAssert(bitmapGlyph->bitmap.width == this->width && "Dimensions don't match.");
    LogAssert(bitmapGlyph->bitmap.rows == this->height && "Dimensions don't match.");

    for (int y = 0; y < bitmapGlyph->bitmap.rows; ++y)
    {
        for (int x = 0; x < bitmapGlyph->bitmap.width; ++x)
        {
            int index = ((this->y + y) * textureWidth) + (this->x + x);
            LogAssert(index >= 0 && "Invalid index.");
            buffer[index] = bitmapGlyph->bitmap.buffer[y * bitmapGlyph->bitmap.width + x];
        }
    }
}
开发者ID:Asido,项目名称:Tamagotchi,代码行数:25,代码来源:Font.cpp


示例4: acs

void RChannelFifoNBWriter::AcceptReturningUnit(RChannelFifoUnit* unit)
{
    bool wakeUpSupplierDrain = false;

    {
        AutoCriticalSection acs(&m_baseDR);

        LogAssert(m_outstandingUnits > 0);
        --m_outstandingUnits;

        if (m_supplierState == SS_Draining)
        {
            /* the supplier has requested a drain */
            if (m_outstandingUnits == 0)
            {
                m_supplierState = SS_Stopped;
                ++m_supplierEpoch;
                wakeUpSupplierDrain = true;
            }
        }
    }

    if (wakeUpSupplierDrain)
    {
        BOOL bRet = ::SetEvent(m_supplierDrainEvent);
        LogAssert(bRet != 0);
    }

    delete unit;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:30,代码来源:channelfifo.cpp


示例5: LogAssert

//
// Notify GM of completed vertex
//
void DVertexPnController::Terminate(DrError vertexState,
                                    UInt32 exitCode)
{
    LogAssert(vertexState != DryadError_VertexRunning);

    if (vertexState == DrError_OK)
    {
        LogAssert(exitCode == DrExitCode_StillActive);
    }

    //
    // take Critical section to update vertex state
    //
    {
        AutoCriticalSection acs(&m_baseCS);

        m_currentStatus->SetVertexState(vertexState);
    }

    //
    // Log vertex termination
    //
    DrLogI( "Terminating vertex. Vertex %u.%u exitCode %s vertexState %s",
        m_currentStatus->GetProcessStatus()->GetVertexId(),
        m_currentStatus->GetProcessStatus()->GetVertexInstanceVersion(),
        DREXITCODESTRING(exitCode), DRERRORSTRING(vertexState));

    //
    // Send status to GM
    //
    SendStatus(exitCode, true);
}
开发者ID:CodEnFisH,项目名称:Dryad,代码行数:35,代码来源:dvertexpncontrol.cpp


示例6: ReportError

void DryadSubGraphVertex::MakeInputParser(UInt32 whichInput,
                                          RChannelItemParserRef* pParser)
{
    if (m_virtualInput == s_invalidVertex)
    {
        ReportError(DryadError_VertexInitialization,
                    "MakeInputParser called before initialization");
        return;
    }

    if (whichInput >= m_numberOfInputEdges)
    {
        ReportError(DryadError_VertexInitialization,
                    "MakeInputParser called with illegal port");
        return;
    }

    EdgeInfo* edge = m_inputEdge[whichInput];
    LogAssert(edge->GetSourceVertex() == m_virtualInput);
    LogAssert(edge->GetSourcePort() == whichInput);

    UInt32 inputVertex = edge->GetDestinationVertex();
    LogAssert(inputVertex < m_numberOfVertices);

    VertexInfo* input = &(m_vertex[inputVertex]);
    UInt32 inputPort = edge->GetDestinationPort();
    LogAssert(inputPort < input->GetInputPortCount());

    DryadVertexProgramBase* subProgram = input->GetVertexProgram();

    subProgram->MakeInputParser(inputPort, pParser);

    ReportError(subProgram->GetErrorCode(),
                subProgram->GetErrorMetaData());
}
开发者ID:CodEnFisH,项目名称:Dryad,代码行数:35,代码来源:subgraphvertex.cpp


示例7: LogAssert

void RChannelFifoWriterBase::SyncHandler::UseEvent(DryadHandleListEntry* event)
{
    LONG postIncrement = ::InterlockedIncrement(&m_usingEvent);
    LogAssert(postIncrement == 1);
    LogAssert(m_event == NULL);
    m_event = event;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:7,代码来源:channelfifo.cpp


示例8: DryadConfigurationManager

 DryadConfigurationManager(
     const char* netLibName,
     const char* iniFileName,
     int argc,
     char* argv[])
 {
     m_strNetLibName = netLibName;
     m_strIniFileName = iniFileName;
     m_argc = argc;
     m_nOpts = 0;
     if (argc == 0) {
         m_argv = NULL;
     } else {
         LogAssert(argv != NULL);
         m_argv = new char *[argc];
         LogAssert(m_argv != NULL);
         for (int i = 0; i < argc; i++) {
             if (argv[i] == NULL) {
                 m_argv[i] = NULL;
             } else {
                 size_t len = strlen(argv[i])+1;
                 m_argv[i] = new char[len];
                 LogAssert(m_argv[i] != NULL);
                 memcpy(m_argv[i], argv[i], len);
             }
         }
     }
 }
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:28,代码来源:dryadstandaloneini.cpp


示例9: AddHandlerToQueue

/* called with RChannelReaderImpl::m_baseDR held */
void RChannelReaderImpl::
    AddHandlerToQueue(const char* caller,
                      RChannelProcessRequest* request,
                      ChannelProcessRequestList* requestList,
                      ChannelUnitList* returnUnitList)
{
    LogAssert(m_state == RS_Running);

    if (m_unitList.IsEmpty())
    {
//         DrLogD(
//             "queueing handler",
//             "caller: %s", caller);
        m_handlerList.InsertAsTail(m_handlerList.CastIn(request));
    }
    else
    {
//         DrLogD(
//             "adding process work request",
//             "caller: %s", caller);

        LogAssert(m_handlerList.IsEmpty());

        /* put this in the handler list since that's where
           TransferWaitingItems expects to find it */
        m_handlerList.InsertAsTail(m_handlerList.CastIn(request));

        TransferWaitingItems(caller,
                             requestList,
                             returnUnitList);
    }
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:33,代码来源:channelreader.cpp


示例10: ProcessItemArrayRequest

void RChannelReaderImpl::
    ProcessItemArrayRequest(RChannelProcessRequest* request)
{
    RChannelItemArray* itemArray = request->GetItemArray();
    RChannelItemArrayReaderHandler* handler = request->GetHandler();
    LogAssert(handler != NULL);
    LogAssert(itemArray != NULL);

    void* cancelCookie = request->GetCookie();

    handler->ProcessItemArray(itemArray);

    {
        AutoCriticalSection acs(&m_baseDR);

        LogAssert(m_state != RS_Stopped);

        /* now that the request has been processed remove it from our
           accounting */
        RemoveFromCancelMap(request, cancelCookie);
        /* if it was the last request with this cookie and somebody
           was blocked cancelling the cookie, wake them up */
        MaybeTriggerCancelEvent(cancelCookie);

        /* if it was the last request in the system and we are
           draining, wake up the drain thread */
        if (m_state == RS_Stopping && m_cookieMap.empty())
        {
            LogAssert(m_eventMap.empty());
            BOOL bRet = ::SetEvent(m_drainEvent);
            LogAssert(bRet != 0);
        }
    }
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:34,代码来源:channelreader.cpp


示例11: FetchNextItemArray

bool RChannelReader::FetchNextItem(RChannelItemRef* pOutItem,
                                   DrTimeInterval timeOut)
{
    RChannelItemArrayRef itemArray;
    bool delivered = FetchNextItemArray(1, &itemArray, timeOut);
    LogAssert(itemArray != NULL);
    if (delivered)
    {
        if (itemArray->GetNumberOfItems() == 1)
        {
            RChannelItemRef* a = itemArray->GetItemArray();
            pOutItem->TransferFrom(a[0]);
        }
        else
        {
            LogAssert(itemArray->GetNumberOfItems() == 0);
            *pOutItem = NULL;
        }
    }
    else
    {
        LogAssert(itemArray->GetNumberOfItems() == 0);
        *pOutItem = NULL;
    }

    return delivered;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:27,代码来源:channelreader.cpp


示例12: MakeFifo

void DryadSubGraphVertex::EdgeInfo::
    MakeFifo(UInt32 fifoLength, WorkQueue* workQueue)
{
    LogAssert(m_reader == NULL);
    LogAssert(m_writer == NULL);

    UInt32 uniquifier = RChannelFactory::GetUniqueFifoId();

    DrStr64 fifoName;
    fifoName.SetF("fifo://%u/internal-%u-%u.%u--%u.%u",
                  fifoLength, uniquifier,
                  m_sourceVertex, m_sourcePort,
                  m_destinationVertex, m_destinationPort);

    DVErrorReporter errorReporter;
    RChannelFactory::OpenReader(fifoName, NULL, NULL, 1, NULL, 0, 0, workQueue,
                                &errorReporter, &m_reader, NULL);
    LogAssert(errorReporter.NoError());
    RChannelFactory::OpenWriter(fifoName, NULL, NULL, 1, NULL, 0, NULL,
                                &errorReporter, &m_writer);
    LogAssert(errorReporter.NoError());

    m_reader->GetReader()->Start(NULL);
    m_writer->GetWriter()->Start();
}
开发者ID:CodEnFisH,项目名称:Dryad,代码行数:25,代码来源:subgraphvertex.cpp


示例13: acs

void DryadSubGraphVertex::VertexCompleted(DrError status,
                                          DryadMetaData* errorData)
{
    bool finished = false;

    {
        AutoCriticalSection acs(&m_baseCS);

        LogAssert(GetErrorCode() != DryadError_VertexCompleted);
        if (status == DryadError_VertexCompleted)
        {
            status = DrError_OK;
        }

        if (NoError())
        {
            ReportError(status, errorData);
        }

        LogAssert(m_outstandingVertices > 0);
        --m_outstandingVertices;

        if (m_outstandingVertices == 0)
        {
            finished = true;
        }
    }

    if (finished)
    {
        /* the real status will be returned in AsyncPostCompletion
           after we have exited all handlers. */
        m_handler->ProgramCompleted();
    }
}
开发者ID:CodEnFisH,项目名称:Dryad,代码行数:35,代码来源:subgraphvertex.cpp


示例14: StartSupplier

void RChannelFifoNBWriter::
    StartSupplier(RChannelBufferPrefetchInfo* prefetchCookie)
{
    ChannelUnitList unblockedList;

    {
        AutoCriticalSection acs(&m_baseDR);

        LogAssert(m_supplierState == SS_Stopped);

        LogAssert(m_writerState != WS_Closed);
        LogAssert(m_outstandingUnits == 0);

        BOOL bRet = ::ResetEvent(m_supplierDrainEvent);
        LogAssert(bRet != 0);

        m_supplierState = SS_Running;

        while (m_blockedList.IsEmpty() == false)
        {
            ++m_outstandingUnits;

            RChannelFifoUnit* blockedUnit =
                m_blockedList.CastOut(m_blockedList.GetHead());

            unblockedList.TransitionToTail(unblockedList.
                                           CastIn(blockedUnit));
        }

        m_sendLatch.AcceptList(&unblockedList);
    }

    SendUnits(&unblockedList);
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:34,代码来源:channelfifo.cpp


示例15: LogAssert

/* called with RChannelReaderImpl::m_baseDR held */
void RChannelReaderImpl::AddUnitToQueue(const char* caller,
                                        RChannelUnit* unit,
                                        ChannelProcessRequestList* requestList,
                                        ChannelUnitList* returnUnitList)
{
    LogAssert(m_state == RS_Running || m_state == RS_InterruptingSupplier);

    if (unit->GetType() == RChannelUnit_Item)
    {
        /* make sure we haven't already sent out a termination item for
           processing */
        LogAssert(m_writerTerminationItem == NULL &&
                  m_readerTerminationItem == NULL);

        if (m_handlerList.IsEmpty())
        {
//             DrLogD(
//                 "queueing item list",
//                 "caller: %s", caller);

            m_unitList.InsertAsTail(m_unitList.CastIn(unit));
            unit = NULL;
        }
        else
        {
//             DrLogD(
//                 "adding process work request",
//                 "caller: %s", caller);

            LogAssert(m_unitList.IsEmpty());

            /* put this in the unit list since that's where
               TransferWaitingItems expects to find it */
            m_unitList.InsertAsTail(m_unitList.CastIn(unit));

            TransferWaitingItems(caller,
                                 requestList,
                                 returnUnitList);
        }
    }
    else
    {
        LogAssert(unit->GetType() == RChannelUnit_BufferBoundary);
        if (m_unitList.IsEmpty())
        {
            returnUnitList->InsertAsTail(returnUnitList->CastIn(unit));
//             DrLogD(
//                 "adding buffer boundary dispatch request",
//                 "caller: %s", caller);
        }
        else
        {
            m_unitList.InsertAsTail(m_unitList.CastIn(unit));
//             DrLogD(
//                 "queueing buffer boundary dispatch request",
//                 "caller: %s", caller);
        }
    }
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:60,代码来源:channelreader.cpp


示例16: DrGetUtf8CommandArgs

//
// Gets command line arguments
//
void DrGetUtf8CommandArgs(int argc, wchar_t *wargv[], char ***pargv)
{
    DrStr128 strArg;
    char **newArgv = NULL;

    //
    // increment count to account for tailing NULL
    //
    ++argc;

    //
    // If there are any command line args
    //
    if (argc > 0) 
    {
        //
        // Create argument storage and verify that it's correctly created
        //
        newArgv = new char *[(size_t)argc];
        LogAssert(newArgv != NULL);

        //
        // Foreach argument
        //
        for (int i = 0; i < argc; i++) 
        {
            if (wargv[i] == NULL) 
            {
                //
                // If NULL argument, store NULL
                //
                newArgv[i] = NULL;
            } 
            else 
            {
                // 
                // Get argument value and verify that it's a valid string
                //
                strArg.Set( wargv[i] );
                LogAssert(strArg.GetString() != NULL);

                //
                // Copy argument value into list 
                //
                newArgv[i] = new char[strArg.GetLength() + 1];
                LogAssert(newArgv[i] != NULL);
                memcpy(newArgv[i], strArg.GetString(), strArg.GetLength() + 1);
            }
        }
    }

    //
    // Store argument list (can be null if no arguments)
    //
    *pargv = newArgv;
}
开发者ID:CodEnFisH,项目名称:Dryad,代码行数:59,代码来源:vertexHost.cpp


示例17: acs

void RChannelReaderImpl::Start(RChannelBufferPrefetchInfo* prefetchCookie)
{
    bool startSupplier = false;

    {
        AutoCriticalSection acs(&m_baseDR);

        LogAssert(m_supplier != NULL);
        LogAssert(m_state == RS_Stopped);
        LogAssert(m_cookieMap.empty());
        LogAssert(m_eventMap.empty());
        LogAssert(m_unitList.IsEmpty());
        LogAssert(m_handlerList.IsEmpty());
        LogAssert(m_interruptHandler == NULL);
        LogAssert(m_startedSupplier == false);
        m_sendLatch.Start();
        m_unitLatch.Start();

        m_state = RS_Running;
        m_readerTerminationItem = NULL;
        m_writerTerminationItem = NULL;
        m_numberOfSubItemsRead = 0;
        m_dataSizeRead = 0;
        m_prefetchCookie = prefetchCookie;

        if (m_lazyStart == false)
        {
            /* when we exit the lock, we will start the
               supplier. After the supplier has been started we'll set
               m_startedSupplierEvent to prevent a race condition in
               Interrupt */
            startSupplier = true;
            BOOL bRet = ::ResetEvent(m_startedSupplierEvent);
            LogAssert(bRet != 0);
            m_startedSupplier = true;
        }
    }

    if (startSupplier)
    {
        //todo: remove comments if not logging
//         DrLogI( "Starting Supplier");
        m_supplier->StartSupplier(m_prefetchCookie);
//         DrLogI( "Started Supplier");
        BOOL bRet = ::SetEvent(m_startedSupplierEvent);
        LogAssert(bRet != 0);
    }
}    
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:48,代码来源:channelreader.cpp


示例18: CreateGlobalJob

DrJobTicket* CreateGlobalJob()
{    
    DrError hr = S_OK;
    DrServiceDescriptor sd;
    DrRef<DrJobTicket> jobTicket = g_pDryadConfig->GetDefaultJobTicket();    
    
    sd.Set("xcps", g_pDryadConfig->GetDefaultClusterName(), NULL, "rd.RDRBasic.XComputeProcessScheduler_0");        
    
    DrRef<XcPsCreateJobRequest> msg;
    msg.Attach(new XcPsCreateJobRequest());
    msg->SetCreateJobTicket(jobTicket);    
    XcJobConstraint& constraint = msg->CreateJobConstraint();
    constraint.SetMaxConcurrentProcesses(999);
    constraint.SetMaxExecutionTime(DrTimeInterval_Hour);
    g_pDrClient->SendTo(msg, sd);    
    msg->WaitForResponse( &hr );
    if (hr != DrError_OK)
    {
        DrLogE( "DryadConfigurationManager",
            "CreateJob failied, error=%s",
            DRERRORSTRING(hr));
        LogAssert(false);
    }
    return jobTicket.Detach();    
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:25,代码来源:dryadstandaloneini.cpp


示例19: while

/* called with m_baseDR held */
bool RChannelFifoWriter::ReWriteBlockedListForEarlyReturn(RChannelItemType
                                                          drainType)
{
    /* rewrite any blocked items to have the termination code correct
       before sending them back to the writer after a reader
       Drain. Also, discard the items, since the reader is never going
       to see them. */
    bool wakeUpWriterDrain = false;
    DrBListEntry* listEntry = m_blockedList.GetHead();
    while (listEntry != NULL)
    {
        RChannelFifoUnit* unit = m_blockedList.CastOut(listEntry);
        listEntry = m_blockedList.GetNext(listEntry);
        unit->SetStatusCode(drainType);
        unit->DiscardItems();
        if (unit == m_terminationUnit)
        {
            LogAssert(listEntry == NULL);
            m_terminationUnit = NULL;
            if (m_writerState == WS_Draining)
            {
                wakeUpWriterDrain = true;
            }
        }
    }

    return wakeUpWriterDrain;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:29,代码来源:channelfifo.cpp


示例20: GetTerminationItems

DrError RChannelReader::GetTerminationStatus(DryadMetaDataRef* pErrorData)
{
    DrError status;

    RChannelItemRef writerTermination;
    RChannelItemRef readerTermination;
    GetTerminationItems(&writerTermination,
                        &readerTermination);

    LogAssert(readerTermination.Ptr() != NULL);
    if (writerTermination.Ptr() != NULL &&
        writerTermination->GetType() != RChannelItem_EndOfStream)
    {
        status = writerTermination->GetErrorFromItem();
        *pErrorData = writerTermination->GetMetaData();
    }
    else if (readerTermination->GetType() == RChannelItem_EndOfStream)
    {
        status = DrError_EndOfStream;
        *pErrorData = readerTermination->GetMetaData();
    }
    else
    {
        status = DryadError_ProcessingInterrupted;
        *pErrorData = readerTermination->GetMetaData();
    }

    return status;
}
开发者ID:Applied-Duality,项目名称:Dryad,代码行数:29,代码来源:channelreader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LogCrit函数代码示例发布时间:2022-05-30
下一篇:
C++ LogAddTD函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap