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


C++ Tags::find方法代码示例

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


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

示例1: Error

//------------------------------------------------------------------------------------------------------------------------------------
// Helper for ErrorMessenger.
//------------------------------------------------------------------------------------------------------------------------------------
LogMgr::ErrorDialogResult LogMgr::Error(const std::string& errorMessage, bool isFatal, const char* funcName, const char* sourceFile, unsigned int lineNum)
{
	string tag = ((isFatal) ? ("FATAL") : ("ERROR"));

	// buffer for our final output string
	string buffer;
	GetOutputBuffer(buffer, tag, errorMessage, funcName, sourceFile, lineNum);

	// write the final buffer to all the various logs
	m_tagCriticalSection.Lock();
	Tags::iterator findIt = m_tags.find(tag);
	if (findIt != m_tags.end())
		OutputFinalBufferToLogs(buffer, findIt->second);
	m_tagCriticalSection.Unlock();

    // show the dialog box
    int result = ::MessageBoxA(NULL, buffer.c_str(), tag.c_str(), MB_ABORTRETRYIGNORE|MB_ICONERROR|MB_DEFBUTTON3);

	// act upon the choice
	switch (result)
	{
		case IDIGNORE : return LogMgr::LOGMGR_ERROR_IGNORE;
		case IDABORT  : __debugbreak(); return LogMgr::LOGMGR_ERROR_RETRY;  // assembly language instruction to break into the debugger
		case IDRETRY :	return LogMgr::LOGMGR_ERROR_RETRY;
		default :       return LogMgr::LOGMGR_ERROR_RETRY;
	}
}
开发者ID:AsbjoernS,项目名称:gamecode4,代码行数:30,代码来源:Logger.cpp

示例2: Log

void LogManager::Log(const std::string& tag, const std::string& msg, const char* funcName, const char* fileName, unsigned int lineNum) 
{
	m_CritSection.Lock();
	Tags::iterator findIt = m_Tags.find(tag);
	if (findIt != m_Tags.end())
	{
		std::string buffer;
		GetOutputBuffer(buffer, tag, msg, funcName, fileName, lineNum);
		OutputBufferToLogs(buffer, findIt->second);
	}
	m_CritSection.Unlock();
}
开发者ID:Hesh0,项目名称:Sabre3D,代码行数:12,代码来源:Logger.cpp

示例3:

QSet<QString> TagComparator::_toSet(const Tags& t, const QString& k)
{
  Tags::const_iterator it = t.find(k);
  if (OsmSchema::getInstance().isList(k, *it))
  {
    return QSet<QString>::fromList(t.getList(k));
  }
  else
  {
    QSet<QString> result;
    result.insert(*it);
    return result;
  }
}
开发者ID:bpross-52n,项目名称:hootenanny,代码行数:14,代码来源:TagComparator.cpp

示例4: sort_operations_recursive

/* topological (depth-first) sorting of operations */
static void sort_operations_recursive(NodeOperationBuilder::Operations &sorted, Tags &visited, NodeOperation *op)
{
	if (visited.find(op) != visited.end())
		return;
	visited.insert(op);
	
	for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
		NodeOperationInput *input = op->getInputSocket(i);
		if (input->isConnected())
			sort_operations_recursive(sorted, visited, &input->getLink()->getOperation());
	}
	
	sorted.push_back(op);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:15,代码来源:COM_NodeOperationBuilder.cpp

示例5: SetDisplayFlags

void LogManager::SetDisplayFlags(const std::string& tag, unsigned char flag)
{
	m_CritSection.Lock();
	if (flag != 0)
	{
		Tags::iterator findIt = m_Tags.find(tag);
		if (findIt == m_Tags.end())
			m_Tags.insert(std::make_pair(tag, flag));
		else
			findIt->second = flag;
	}
	else
		m_Tags.erase(tag);
	m_CritSection.Unlock();
}
开发者ID:Hesh0,项目名称:Sabre3D,代码行数:15,代码来源:Logger.cpp

示例6: add_group_operations_recursive

static void add_group_operations_recursive(Tags &visited, NodeOperation *op, ExecutionGroup *group)
{
	if (visited.find(op) != visited.end())
		return;
	visited.insert(op);
	
	if (!group->addOperation(op))
		return;
	
	/* add all eligible input ops to the group */
	for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
		NodeOperationInput *input = op->getInputSocket(i);
		if (input->isConnected())
			add_group_operations_recursive(visited, &input->getLink()->getOperation(), group);
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:16,代码来源:COM_NodeOperationBuilder.cpp

示例7: log

	void LogMgr::log(const std::string& tag, const std::string& message, const char* funcName, const char* sourceFile, unsigned int lineNum)
	{
		m_TagCriticalSection.lock();
		Tags::iterator findIt = m_Tags.find(tag);
		if (findIt != m_Tags.end())
		{
			m_TagCriticalSection.unlock();

			std::string buffer;
			getOutputBuffer(buffer, tag, message, funcName, sourceFile, lineNum);
			outputFinalBufferToLogs(buffer, tag, findIt->second);
		}
		else
		{
			m_TagCriticalSection.unlock();
		}
	}
开发者ID:paubertin,项目名称:xTen,代码行数:17,代码来源:logger.cpp

示例8: Log

///////////////////////////////////////////////////////////////////////////////////////////////////////
// this function builds up the log string and outputs it to various places based on display flags
///////////////////////////////////////////////////////////////////////////////////////////////////////
void LogMgr::Log(const string& tag, const string& message, const char* func, const char* source, unsigned int line)
{
  _tag_critical_section.Lock();
  Tags::iterator it = _tags.find(tag);
  if(it != _tags.end())
  {
    _tag_critical_section.Unlock();
    string buffer;
    GetOutputBuffer(buffer, tag, message, func, source, line);
    OutputFinalBufferToLogs(buffer, it->second);
  }
  else
  {
    //critical section is exited in the if above, so need to do it here if above wasnt executed
    _tag_critical_section.Unlock();
  }
}
开发者ID:raistlin969,项目名称:Solinari,代码行数:20,代码来源:Logger.cpp

示例9: setDisplayFLags

	void LogMgr::setDisplayFLags(const std::string& tag, unsigned char flags)
	{
		m_TagCriticalSection.lock();
		if (flags != 0)
		{
			Tags::iterator findIt = m_Tags.find(tag);
			if (findIt == m_Tags.end())
				m_Tags.insert(std::make_pair(tag, flags));
			else
				findIt->second = flags;
		}
		else
		{
			m_Tags.erase(tag);
		}
		m_TagCriticalSection.unlock();
	}
开发者ID:paubertin,项目名称:xTen,代码行数:17,代码来源:logger.cpp

示例10: SetDisplayFlags

///////////////////////////////////////////////////////////////////////////////////////
// sets one or more display flags
///////////////////////////////////////////////////////////////////////////////////////
void LogMgr::SetDisplayFlags(const std::string& tag, unsigned char flags)
{
  _tag_critical_section.Lock();
  if(flags != 0)
  {
    Tags::iterator it = _tags.find(tag);
    if(it == _tags.end())
      _tags.insert(std::make_pair(tag, flags));
    else
      it->second = flags;
  }
  else
  {
    _tags.erase(tag);
  }
  _tag_critical_section.Unlock();
}
开发者ID:raistlin969,项目名称:Solinari,代码行数:20,代码来源:Logger.cpp

示例11: find_reachable_operations_recursive

static void find_reachable_operations_recursive(Tags &reachable, NodeOperation *op)
{
	if (reachable.find(op) != reachable.end())
		return;
	reachable.insert(op);
	
	for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
		NodeOperationInput *input = op->getInputSocket(i);
		if (input->isConnected())
			find_reachable_operations_recursive(reachable, &input->getLink()->getOperation());
	}
	
	/* associated write-buffer operations are executed as well */
	if (op->isReadBufferOperation()) {
		ReadBufferOperation *read_op = (ReadBufferOperation *)op;
		MemoryProxy *memproxy = read_op->getMemoryProxy();
		find_reachable_operations_recursive(reachable, memproxy->getWriteBufferOperation());
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:19,代码来源:COM_NodeOperationBuilder.cpp

示例12: Log

//------------------------------------------------------------------------------------------------------------------------------------
// This function builds up the log string and outputs it to various places based on the display flags (m_displayFlags).
//------------------------------------------------------------------------------------------------------------------------------------
void LogMgr::Log(const string& tag, const string& message, const char* funcName, const char* sourceFile, unsigned int lineNum)
{
	m_tagCriticalSection.Lock();
	Tags::iterator findIt = m_tags.find(tag);
	if (findIt != m_tags.end())
	{
		m_tagCriticalSection.Unlock();
		
		string buffer;
		GetOutputBuffer(buffer, tag, message, funcName, sourceFile, lineNum);
		OutputFinalBufferToLogs(buffer, findIt->second);
	}
	else
	{
		// Critical section is exited in the if statement above, so we need to exit it here if that didn't 
		// get executed.
        m_tagCriticalSection.Unlock();
	}
}  // end LogMgr::Log()
开发者ID:AsbjoernS,项目名称:gamecode4,代码行数:22,代码来源:Logger.cpp

示例13: error

	LogMgr::ErrorDialogResult LogMgr::error(const std::string & errorMessage, bool isFatal, const char* funcName, const char* sourceFile, unsigned int lineNum)
	{
		std::string tag = ((isFatal) ? ("FATAL") : ("ERROR"));

		std::string buffer;
		getOutputBuffer(buffer, tag, errorMessage, funcName, sourceFile, lineNum);

		m_TagCriticalSection.lock();
		Tags::iterator findIt = m_Tags.find(tag);
		if (findIt != m_Tags.end())
			outputFinalBufferToLogs(buffer, tag, findIt->second);
		m_TagCriticalSection.unlock();

		int result = ::MessageBoxA(NULL, buffer.c_str(), tag.c_str(), MB_ABORTRETRYIGNORE | MB_ICONERROR | MB_DEFBUTTON3);

		switch (result)
		{
		case IDIGNORE: return LogMgr::LOGMGR_ERROR_IGNORE;
		case IDABORT: __debugbreak();  return LogMgr::LOGMGR_ERROR_RETRY;
		case IDRETRY: return LogMgr::LOGMGR_ERROR_RETRY;
		default: return LogMgr::LOGMGR_ERROR_RETRY;
		}
	}
开发者ID:paubertin,项目名称:xTen,代码行数:23,代码来源:logger.cpp

示例14: Error

//////////////////////////////////////////////////////////////////////////////////////////////
//helper for ErrorMessenger
/////////////////////////////////////////////////////////////////////////////////////////////
LogMgr::ErrorDialogResult LogMgr::Error(const std::string& error_message, bool is_fatal, const char* func, const char* source, unsigned int line)
{
  string tag = ((is_fatal) ? ("FATAL") : ("ERROR"));
  //buffer for final output string
  string buffer;
  GetOutputBuffer(buffer, tag, error_message, func, source, line);

  //write final buffer to various logs
  _tag_critical_section.Lock();
  Tags::iterator it = _tags.find(tag);
  if(it != _tags.end())
    OutputFinalBufferToLogs(buffer, it->second);
  _tag_critical_section.Unlock();

  //show the dialog box
  int result = ::MessageBoxA(NULL, buffer.c_str(), tag.c_str(),  MB_ABORTRETRYIGNORE|MB_ICONERROR|MB_DEFBUTTON3);
  switch(result)
  {
    case IDIGNORE:  return LogMgr::LOGMGR_ERROR_IGNORE;
    case IDABORT: __debugbreak(); return LogMgr::LOGMGR_ERROR_ABORT;
    case IDRETRY: return LogMgr::LOGMGR_ERROR_RETRY;
    default:  return LogMgr::LOGMGR_ERROR_RETRY;
  }
}
开发者ID:raistlin969,项目名称:Solinari,代码行数:27,代码来源:Logger.cpp

示例15: prune_operations

void NodeOperationBuilder::prune_operations()
{
	Tags reachable;
	for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
		NodeOperation *op = *it;
		
		/* output operations are primary executed operations */
		if (op->isOutputOperation(m_context->isRendering()))
			find_reachable_operations_recursive(reachable, op);
	}
	
	/* delete unreachable operations */
	Operations reachable_ops;
	for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
		NodeOperation *op = *it;
		
		if (reachable.find(op) != reachable.end())
			reachable_ops.push_back(op);
		else
			delete op;
	}
	/* finally replace the operations list with the pruned list */
	m_operations = reachable_ops;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:24,代码来源:COM_NodeOperationBuilder.cpp


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