本文整理汇总了C++中FatalErrorException函数的典型用法代码示例。如果您正苦于以下问题:C++ FatalErrorException函数的具体用法?C++ FatalErrorException怎么用?C++ FatalErrorException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FatalErrorException函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FatalErrorException
Variant ThisExpression::set(VariableEnvironment &env, CVarRef val) const {
throw FatalErrorException("Cannot re-assign $this");
}
示例2: getValueRef
CVarRef ArrayData::endRef() {
if (size_t(m_pos) < size_t(size())) {
return getValueRef(size() - 1);
}
throw FatalErrorException("invalid ArrayData::m_pos");
}
示例3: FatalErrorException
void ArrayData::uasort(CVarRef cmp_function) {
throw FatalErrorException("Unimplemented ArrayData::uasort");
}
示例4: File
OutputFile::OutputFile(const String& filename): File(true, s_php, s_output) {
if (filename != s_php_output) {
throw FatalErrorException("not a php://output file ");
}
m_isLocal = true;
}
示例5: getValueRef
CVarRef ArrayData::endRef() {
if (m_pos != invalid_index) {
return getValueRef(iter_end());
}
throw FatalErrorException("invalid ArrayData::m_pos");
}
示例6: FatalErrorException
void ArrayData::ZSetStr(ArrayData* ad, StringData* k, RefData* v) {
throw FatalErrorException("Unimplemented ArrayData::ZSetStr");
}
示例7: FatalErrorException
ObjectData *FrameInjectionFunction::getThisForArrow() {
if (ObjectData *obj = getThis()) {
return obj;
}
throw FatalErrorException("Using $this when not in object context");
}
示例8: FatalErrorException
int64 MemFile::writeImpl(const char *buffer, int64 length) {
throw FatalErrorException((string("cannot write a mem stream: ") +
m_name).c_str());
}
示例9: assert
void AsioContext::runUntil(c_WaitableWaitHandle* wait_handle) {
assert(wait_handle);
assert(wait_handle->getContext() == this);
auto session = AsioSession::Get();
auto ete_queue = session->getExternalThreadEventQueue();
if (!session->hasAbruptInterruptException()) {
session->initAbruptInterruptException();
}
while (!wait_handle->isFinished()) {
// Run queue of ready async functions once.
if (!m_runnableQueue.empty()) {
auto current = m_runnableQueue.back();
m_runnableQueue.pop_back();
current->resume();
continue;
}
// Process all sleep handles that have completed their sleep.
if (session->processSleepEvents()) {
continue;
}
// Process all external thread events that have completed their operation.
// Queue may contain received unprocessed events from failed runUntil().
if (UNLIKELY(ete_queue->hasReceived()) || ete_queue->tryReceiveSome()) {
ete_queue->processAllReceived();
continue;
}
// Run default priority queue once.
if (runSingle(m_priorityQueueDefault)) {
continue;
}
// Wait for pending external thread events...
if (!m_externalThreadEvents.empty()) {
// ...but only until the next sleeper (from any context) finishes.
auto waketime = session->sleepWakeTime();
// Wait if necessary.
if (LIKELY(!ete_queue->hasReceived())) {
onIOWaitEnter(session);
ete_queue->receiveSomeUntil(waketime);
onIOWaitExit(session);
}
if (ete_queue->hasReceived()) {
// Either we didn't have to wait, or we waited but no sleeper timed us
// out, so just handle the ETEs.
ete_queue->processAllReceived();
} else {
// No received events means the next-to-wake sleeper timed us out.
session->processSleepEvents();
}
continue;
}
// If we're here, then the only things left are sleepers. Wait for one to
// be ready (in any context).
if (!m_sleepEvents.empty()) {
onIOWaitEnter(session);
std::this_thread::sleep_until(session->sleepWakeTime());
onIOWaitExit(session);
session->processSleepEvents();
continue;
}
// Run no-pending-io priority queue once.
if (runSingle(m_priorityQueueNoPendingIO)) {
continue;
}
// What? The wait handle did not finish? We know it is part of the current
// context and since there is nothing else to run, it cannot be in RUNNING
// or SCHEDULED state. So it must be BLOCKED on something. Apparently, the
// same logic can be used recursively on the something, so there is an
// infinite chain of blocked wait handles. But our memory is not infinite.
// What could it possibly mean? I think we are in a deep sh^H^Hcycle.
// But we can't, the cycles are detected and avoided at blockOn() time.
// So, looks like it's not cycle, but the word I started typing first.
assert(false);
throw FatalErrorException(
"Invariant violation: queues are empty, but wait handle did not finish");
}
}
示例10: assert
void AsioContext::runUntil(c_WaitableWaitHandle* wait_handle) {
assert(!m_current);
assert(wait_handle);
assert(wait_handle->getContext() == this);
auto session = AsioSession::Get();
uint8_t check_ete_counter = 0;
while (!wait_handle->isFinished()) {
// process ready external thread events once per 256 other events
// (when 8-bit check_ete_counter overflows)
if (!++check_ete_counter) {
auto ete_wh = session->getReadyExternalThreadEvents();
while (ete_wh) {
auto next_wh = ete_wh->getNextToProcess();
ete_wh->process();
ete_wh = next_wh;
}
}
// run queue of ready continuations once
if (!m_runnableQueue.empty()) {
auto current = m_runnableQueue.front();
m_runnableQueue.pop();
m_current = current;
m_current->run();
m_current = nullptr;
decRefObj(current);
continue;
}
// run default priority queue once
if (runSingle(m_priorityQueueDefault)) {
continue;
}
// pending external thread events? wait for at least one to become ready
if (!m_externalThreadEvents.empty()) {
// all your wait time are belong to us
auto ete_wh = session->waitForExternalThreadEvents();
while (ete_wh) {
auto next_wh = ete_wh->getNextToProcess();
ete_wh->process();
ete_wh = next_wh;
}
continue;
}
// run no-pending-io priority queue once
if (runSingle(m_priorityQueueNoPendingIO)) {
continue;
}
// What? The wait handle did not finish? We know it is part of the current
// context and since there is nothing else to run, it cannot be in RUNNING
// or SCHEDULED state. So it must be BLOCKED on something. Apparently, the
// same logic can be used recursively on the something, so there is an
// infinite chain of blocked wait handles. But our memory is not infinite.
// What could it possibly mean? I think we are in a deep sh^H^Hcycle.
// But we can't, the cycles are detected and avoided at blockOn() time.
// So, looks like it's not cycle, but the word I started typing first.
assert(false);
throw FatalErrorException(
"Invariant violation: queues are empty, but wait handle did not finish");
}
}
示例11: FatalErrorException
bool FunctionCallExpression::exist(VariableEnvironment &env, int op) const {
throw FatalErrorException(0, "Cannot call %s on a function return value",
op == T_ISSET ? "isset" : "empty");
}
示例12: getValueRef
CVarRef NameValueTableWrapper::currentRef() {
if (m_pos != ArrayData::invalid_index) {
return getValueRef(m_pos);
}
throw FatalErrorException("invalid ArrayData::m_pos");
}
示例13: FatalErrorException
bool TempFile::open(const String& filename, const String& mode) {
throw FatalErrorException((std::string("cannot open a temp file ") +
m_name).c_str());
}
示例14: setState
void c_ContinuationWaitHandle::run() {
// may happen if scheduled in multiple contexts
if (getState() != STATE_SCHEDULED) {
return;
}
try {
setState(STATE_RUNNING);
do {
// iterate continuation
if (m_child.isNull()) {
// first iteration or null dependency
m_continuation->call_next();
} else if (m_child->isSucceeded()) {
// child succeeded, pass the result to the continuation
m_continuation->call_send(m_child->getResult());
} else if (m_child->isFailed()) {
// child failed, raise the exception inside continuation
m_continuation->call_raise(m_child->getException());
} else {
throw FatalErrorException(
"Invariant violation: child neither succeeded nor failed");
}
// continuation finished, retrieve result from its m_value
if (m_continuation->m_done) {
markAsSucceeded(m_continuation->m_value.asTypedValue());
return;
}
// set up dependency
TypedValue* value = m_continuation->m_value.asTypedValue();
if (IS_NULL_TYPE(value->m_type)) {
// null dependency
m_child = nullptr;
} else {
c_WaitHandle* child = c_WaitHandle::fromTypedValue(value);
if (UNLIKELY(!child)) {
Object e(SystemLib::AllocInvalidArgumentExceptionObject(
"Expected yield argument to be an instance of WaitHandle"));
throw e;
}
AsioSession* session = AsioSession::Get();
if (UNLIKELY(session->hasOnContinuationYieldCallback())) {
session->onContinuationYield(this, child);
}
m_child = child;
}
} while (m_child.isNull() || m_child->isFinished());
// we are blocked on m_child so it must be WaitableWaitHandle
assert(dynamic_cast<c_WaitableWaitHandle*>(m_child.get()));
blockOn(static_cast<c_WaitableWaitHandle*>(m_child.get()));
} catch (const Object& exception) {
// process exception thrown by generator or blockOn cycle detection
markAsFailed(exception);
}
}
示例15: f_func_get_arg
Variant f_func_get_arg(int arg_num) {
throw FatalErrorException("bad HPHP code generation");
}