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


C++ Exception::getEntryAt方法代码示例

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


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

示例1: append

void Exception::append(const Exception &another, size_t startDepth) throw() {
	Exception base;

	if (this == &another) {
		base.append(another, startDepth);
		append(base, 0);
		return;
	}

	size_t baseEntryCount = 0;
	if (!isEmpty()) {
		assert(base.isEmpty());

		base.append(*this, 0);
		baseEntryCount = 1 + base.maxDepth_;

		clear();
	}

	size_t subEntryCount = baseEntryCount + (another.maxDepth_ - startDepth);
	if (subEntryCount > 0) {
		subEntries_ =
				static_cast<Entry*>(allocate(sizeof(Entry) * subEntryCount));
		if (subEntries_ == NULL) {
			subEntryCount = 0;
		}
	}
	maxDepth_ = subEntryCount;

	for (size_t i = 0; i <= subEntryCount; i++) {
		Entry &dest = (i > 0 ? subEntries_[i - 1] : topEntry_);

		const Entry *src;
		if (i < baseEntryCount) {
			src = base.getEntryAt(i);
		}
		else {
			src = another.getEntryAt(startDepth + (i - baseEntryCount));
		}

		setEntry(dest, *src);
	}

	fillWhat();
}
开发者ID:Naoyuki-Yatsuda,项目名称:griddb_nosql,代码行数:45,代码来源:type.cpp

示例2: str

Exception::Exception(
		const NamedErrorCode &namedErrorCode,
		const char8_t *message,
		const SourceSymbolChar *fileNameLiteral,
		const SourceSymbolChar *functionNameLiteral,
		int32_t lineNumber,
		const std::exception *causeInHandling,
		const char8_t *typeNameLiteral,
		StackTraceMode stackTraceMode,
		DuplicatedLiteralFlags literalFlags) throw() :
		bufferOffset_(0),
		subEntries_(NULL),
		maxDepth_(0),
		topEntry_(),
		what_(NULL) {

	do {
#ifdef UTIL_STACK_TRACE_ENABLED
		if (causeInHandling == NULL && stackTraceMode == STACK_TRACE_TOP) {
			try {
				char8_t buf[512];
				detail::LocalString str(buf, sizeof(buf));

				detail::StackTraceStringHandler handler(str);
				StackTraceUtils::getStackTrace(handler);

				setEntry(topEntry_,
						namedErrorCode, message, str.tryGet(), typeNameLiteral,
						fileNameLiteral, functionNameLiteral, lineNumber,
						literalFlags);
				break;
			}
			catch (...) {
			}
		}
#endif
		setEntry(topEntry_,
				namedErrorCode, message, NULL, typeNameLiteral,
				fileNameLiteral, functionNameLiteral, lineNumber,
				literalFlags);
	}
	while (false);

	if (causeInHandling != NULL) {
		Exception *fullEx;
		std::exception *stdEx;
		const char8_t *causeType = resolveException(&fullEx, &stdEx);

		size_t subEntryCount = (fullEx == NULL ? 1 : fullEx->maxDepth_ + 1);
		subEntries_ =
				static_cast<Entry*>(allocate(sizeof(Entry) * subEntryCount));
		if (subEntries_ == NULL) {
			subEntryCount = 0;
		}
		maxDepth_ = subEntryCount;

		if (fullEx == NULL) {
			if (subEntryCount > 0) {
				const char8_t *causeMessage = NULL;
				if (stdEx != NULL) {
					try {
						causeMessage = stdEx->what();
					}
					catch (...) {
					}
				}

				setEntry(subEntries_[0],
						NamedErrorCode(), causeMessage, NULL, causeType,
						NULL, NULL, -1, LITERAL_NORMAL);
			}
		}
		else {
			for (size_t i = 0; i < subEntryCount; i++) {
				Entry &dest = subEntries_[i];
				const Entry *src = fullEx->getEntryAt(i);

				setEntry(dest, *src);
			}
		}
	}

	fillWhat();
}
开发者ID:Naoyuki-Yatsuda,项目名称:griddb_nosql,代码行数:84,代码来源:type.cpp


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