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

C++ InternalError函数代码示例

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

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



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

示例1: if

// static
void
PositionCalculationCollection::typeFromEnum(const char *post,
                                            e_poscalc_t *type, int *flags)
{
    if (post[0] == 'a')
    {
        *type   = POS_ATOM;
        *flags &= ~(POS_MASS | POS_COMPLMAX | POS_COMPLWHOLE);
        return;
    }

    /* Process the prefix */
    const char *ptr = post;
    if (post[0] == 'w')
    {
        *flags &= ~POS_COMPLMAX;
        *flags |= POS_COMPLWHOLE;
        ptr     = post + 6;
    }
    else if (post[0] == 'p')
    {
        *flags &= ~POS_COMPLWHOLE;
        *flags |= POS_COMPLMAX;
        ptr     = post + 5;
    }
    else if (post[0] == 'd')
    {
        *flags &= ~(POS_COMPLMAX | POS_COMPLWHOLE);
        ptr     = post + 4;
    }

    if (ptr[0] == 'r')
    {
        *type = POS_RES;
    }
    else if (ptr[0] == 'm')
    {
        *type = POS_MOL;
    }
    else
    {
        GMX_THROW(InternalError("Unknown position calculation type"));
    }
    if (strlen(ptr) < 7)
    {
        GMX_THROW(InternalError("Unknown position calculation type"));
    }
    if (ptr[6] == 'm')
    {
        *flags |= POS_MASS;
    }
    else if (ptr[6] == 'g')
    {
        *flags &= ~POS_MASS;
    }
    else
    {
        GMX_THROW(InternalError("Unknown position calculation type"));
    }
}
开发者ID:hasagar,项目名称:gromacs,代码行数:61,代码来源:poscalc.cpp


示例2: EmitVar

void EmitVar(Var * var, UInt8 format)
{
	Bool non_keyword = true;

	if (var != NULL) {
		if (var->mode == INSTR_SRC_FILE) {
			EmitStr(var->name);

		} else if (var->mode == INSTR_ELEMENT) {
			if (VarIsStructElement(var)) {
				EmitVar(var->adr, format);
				EmitStr("+");
				EmitVar(var->var, format);
			} else {
				InternalError("don't know how to emit array element");
			}
		} else if (var->mode == INSTR_DEREF) {
			EmitVar(var->var, format);
		} else if (var->mode == INSTR_BYTE) {
			InternalError("don't know how to emit byte array element");
		} else if (var->name != NULL) {
			// *** Module parameters (4)
			// When parameter name is emmited, it is prefixed with PARAM_ prefix
			if (VarIsParam(var)) {
				EmitStr("PARAM_");
			} else if (var->mode == INSTR_INT && var->type != NULL && var->type->variant == TYPE_INT && var->type->owner != NULL) {
				EmitVarName(var->type->owner);
				EmitStr("__");
			} else if (var->scope != NULL && var->scope != &ROOT_PROC && var->scope != CPU->SCOPE && var->scope->name != NULL && !VarIsLabel(var)) {
				EmitVarName(var->scope);
				EmitStr("__");
			} else {
				non_keyword = true;
				// For variables (excluding registers), emit extra underscore at the beginning to prevent name clash with assembler built-in keywords and register names
				if (!VarIsReg(var)) {
					EmitStr("_");
				}
			}
			EmitVarName(var);

		} else if (var->mode == INSTR_TEXT) {
			if (format == 1) {
				EmitStrConst(var->str); 
			} else {
				EmitStr(var->str);
			}
		} else {
			ASSERT(var->mode == INSTR_INT);
			EmitBigInt(&var->n);
		}
	}
}
开发者ID:davidechiappetta,项目名称:atalan,代码行数:52,代码来源:emit.c


示例3: InternalError

 string Z3Model::ToString() const
 {
     if (Ctx == nullptr || Model == nullptr) {
         throw InternalError((string)"ToString() called on a null Z3Model object");
     }
     return string(Z3_model_to_string(Ctx, Model));
 }
开发者ID:BenCaulfield,项目名称:sygus-comp14,代码行数:7,代码来源:Z3Objects.cpp


示例4: Node

Document::Document(xmlDocPtr doc) : Node(reinterpret_cast<xmlNodePtr>(doc))
{
    if ( _xml == nullptr )
        throw InternalError("Failed to create new document");
    // ensure the right polymorphic type ptr is installed
    _xml->_private = this;
}
开发者ID:phamquy,项目名称:readium-sdk,代码行数:7,代码来源:document.cpp


示例5: xmlAddNextSibling

void Node::InsertAfter(Node *child)
{
    xmlNodePtr newNode = xmlAddNextSibling(xml(), child->xml());
    if ( newNode == nullptr )
        throw InternalError("Unable to add child node", xmlGetLastError());
    child->rebind(newNode);
}
开发者ID:aironik,项目名称:readium-sdk,代码行数:7,代码来源:node.cpp


示例6: MiscError

//
// newTypeIndex defaulted to 0 to indicate that a new type is to be enter.
//
void TypeIndexMap::Insert( const type_index oldTypeIndex,
                           const type_index newTypeIndex )
/********************************************************/
{
    try {
    if ( newTypeIndex != 0 ) {
        _mappingTable[oldTypeIndex].globalIndex = newTypeIndex;
        _mappingTable[oldTypeIndex].isNewType = FALSE;
    } else {
        // check if running out of types.
        if ( _currentGlobalIndex >= 0xffff ) {
            throw MiscError("fatal : running out of type indices.");
        }
        _mappingTable[oldTypeIndex].globalIndex = _currentGlobalIndex++;
        _mappingTable[oldTypeIndex].isNewType = TRUE;
    }

   // testing code.
    _mappingTable[oldTypeIndex].isDone = TRUE;
    }
    catch (...) {
        cerr << "index : " << oldTypeIndex << endl;
        throw InternalError("packtype.cpp : TypeIndexMap::Lookup() index range failed.");
    }
}
开发者ID:hubei,项目名称:open-watcom,代码行数:28,代码来源:typemap.cpp


示例7: InternalError

//-------------------------------------------------------------------------------------------------
LuaWorker::LuaWorker(IConsole *pConsole)
    :QObject(NULL)
    ,IScriptEngine()
    ,ISyncContext()
    ,m_pConsole(pConsole)
    ,m_mtxTasks()
    ,m_luaState(NULL)
    ,m_pSysVar(NULL)
    ,m_vLuaTables()
{
    ILuaTable::setSyncContext(this);

    // Hier keine dynamische allokation, da diese im Hauptthread geschehen würde!
    if (m_pConsole==NULL)
        throw InternalError(tr("Can't create Lua worker with null console pointer"));

    m_vLuaTables.push_back(new LuaTabWindow());
    m_vLuaTables.push_back(new LuaTabSys());
    m_vLuaTables.push_back(new LuaTabMessageBox());
    m_vLuaTables.push_back(new LuaTabCanvas());


    init();
    initTables();

    splashScreen();
}
开发者ID:beltoforion,项目名称:InstantLua,代码行数:28,代码来源:LuaWorker.cpp


示例8: readNextFrame

EnergyFrame
EnergyFrameReader::frame()
{
    EnergyFrame energyFrame;

    if (!haveProbedForNextFrame_)
    {
        readNextFrame();
    }
    if (!nextFrameExists_)
    {
        GMX_THROW(APIError("There is no next frame, so there should have been no attempt to use the data, e.g. by reacting to a call to readNextFrame()."));
    }

    // The probe filled enxframe_ with new data, so now we use that data to fill energyFrame
    t_enxframe *enxframe = enxframeGuard_.get();
    energyFrame.time_ = enxframe->t;
    energyFrame.step_ = enxframe->step;
    for (auto &index : indicesOfEnergyFields_)
    {
        if (index.second >= enxframe->nre)
        {
            GMX_THROW(InternalError(formatString("Index %d for energy %s not present in energy frame with %d energies",
                                                 index.second, index.first.c_str(), enxframe->nre)));
        }
        energyFrame.values_[index.first] = enxframe->ener[index.second].e;
    }

    // Prepare for reading future frames
    haveProbedForNextFrame_ = false;
    nextFrameExists_        = false;

    return energyFrame;
}
开发者ID:MichalKononenko,项目名称:gromacs,代码行数:34,代码来源:energyreader.cpp


示例9: InternalError

//
// GetLevelName
//
const char *GetLevelName(void)
{
  if (!wad.current_level)
    InternalError("GetLevelName: no current level");
    
  return wad.current_level->name;
}
开发者ID:samboy,项目名称:Oblige,代码行数:10,代码来源:wad.c


示例10: SeparateSegs

//
// SeparateSegs
//
void SeparateSegs(superblock_t *seg_list, seg_t *part,
    superblock_t *lefts, superblock_t *rights,
    intersection_t ** cut_list)
{
  int num;

  while (seg_list->segs)
  {
    seg_t *cur = seg_list->segs;
    seg_list->segs = cur->next;

    cur->block = NULL;

    DivideOneSeg(cur, part, lefts, rights, cut_list);
  }

  // recursively handle sub-blocks
  for (num=0; num < 2; num++)
  {
    superblock_t *A = seg_list->subs[num];

    if (A)
    {
      SeparateSegs(A, part, lefts, rights, cut_list);

      if (A->real_num + A->mini_num > 0)
        InternalError("SeparateSegs: child %d not empty !", num);

      FreeSuper(A);
      seg_list->subs[num] = NULL;
    }
  }

  seg_list->real_num = seg_list->mini_num = 0;
}
开发者ID:Crowbar-Sledgehammer,项目名称:glbsp,代码行数:38,代码来源:seg.c


示例11: HLAfloat64TimeFactory

/*
 * Provides a factory for the standard logical time types HLAfloat64Time
 * and HLAinteger64Time. The RTI reference time library's LogicalTimeFactoryFactory
 * should just forward requests to here.
 */
std::auto_ptr<LogicalTimeFactory>
HLAlogicalTimeFactoryFactory::makeLogicalTimeFactory( const std::wstring& implementationName )
{
	if( implementationName.compare(L"HLAfloat64TimeFactory") == 0 )
	{
		return auto_ptr<LogicalTimeFactory>( new HLAfloat64TimeFactory() );
	}
	else if( implementationName.compare(L"HLAinteger64TimeFactory") == 0 )
	{
		return auto_ptr<LogicalTimeFactory>( new HLAinteger64TimeFactory() );
	}
	else if( implementationName.compare(L"HLAfloat64Time") == 0 )
	{
		return auto_ptr<LogicalTimeFactory>( new HLAfloat64TimeFactory() );
	}
	else if( implementationName.compare(L"HLAinteger64Time") == 0 )
	{
		return auto_ptr<LogicalTimeFactory>( new HLAinteger64TimeFactory() );
	}
	else
	{
		wstringstream wss;
		wss << "Unknown time implementation type [" << implementationName <<
			"]: Must be HLAfloat64TimeFactory or HLAinteger64TimeFactory";

		throw InternalError( wss.str() );
	}
}
开发者ID:DoctorRuss,项目名称:portico,代码行数:33,代码来源:LogicalTimeFactoryFactory.cpp


示例12: _options

SelectionCollection::Impl::Impl(gmx_ana_poscalc_coll_t *pcc)
    : _options("selection", "Common selection control"),
      _debugLevel(0), _grps(NULL)
{
    _sc.root      = NULL;
    _sc.nvars     = 0;
    _sc.varstrs   = NULL;
    _sc.top       = NULL;
    gmx_ana_index_clear(&_sc.gall);
    _sc.pcc       = pcc;
    _sc.mempool   = NULL;
    _sc.symtab    = NULL;

    // TODO: This is not exception-safe if any called function throws.
    if (_sc.pcc == NULL)
    {
        int rc = gmx_ana_poscalc_coll_create(&_sc.pcc);
        if (rc != 0)
        {
            // TODO: A more reasonable error
            GMX_THROW(InternalError("Failed to create position calculation collection"));
        }
        _flags.set(Impl::efOwnPositionCollection);
    }
    _gmx_sel_symtab_create(&_sc.symtab);
    gmx_ana_selmethod_register_defaults(_sc.symtab);
}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:27,代码来源:selectioncollection.cpp


示例13: result

void HelpWriterContext::Impl::processMarkup(const std::string &text,
                                            WrapperInterface  *wrapper) const
{
    std::string result(text);
    for (ReplaceList::const_iterator i = replacements_.begin();
         i != replacements_.end(); ++i)
    {
        result = replaceAll(result, i->search, i->replace);
    }
    switch (state_->format_)
    {
        case eHelpOutputFormat_Console:
        {
            result = repall(result, sandrTty);
            result = replaceLinks(result);
            return wrapper->wrap(result);
        }
        case eHelpOutputFormat_Man:
        {
            // Needs to be done first to avoid '-' -> '\-' messing up the links.
            result = replaceLinks(result);
            result = repall(result, sandrMan);
            return wrapper->wrap(result);
        }
        case eHelpOutputFormat_Html:
        {
            result = repall(result, sandrHtml);
            result = replaceLinks(result);
            return wrapper->wrap(result);
        }
        default:
            GMX_THROW(InternalError("Invalid help output format"));
    }
}
开发者ID:daniellandau,项目名称:gromacs,代码行数:34,代码来源:helpwritercontext.cpp


示例14: GrammarNode

    GrammarFunc::GrammarFunc(const Grammar* TheGrammar, 
                             const FuncOperatorBase* FuncOp,
                             const vector<GrammarNode*>& Children)
        : GrammarNode(TheGrammar, FuncOp->GetEvalType()), Op(FuncOp), Children(Children)
    {
        // Check that all children belong to the same grammar
        for (auto const& Child : Children) {
            if (Child->GetGrammar() != TheGrammar) {
                throw InternalError((string)"Error: Attempted to combine nodes from different grammars.\n" + 
                                    "At " + __FILE__ + ":" + to_string(__LINE__));
            }
        }

        // Check that the types match
        auto FuncType = FuncOp->GetFuncType();
        const uint32 Arity = FuncOp->GetArity();
        if (Children.size() != Arity) {
            throw TypeException((string)"Operator \"" + FuncOp->GetName() + "\" expects " + 
                                to_string(Arity) + " operands, but received " + to_string(Children.size()) + 
                                " operands.");
        }

        for (uint32 i = 0; i < Arity; ++i) {
            if (Children[i]->GetType() != FuncType->GetDomainTypes()[i]) {
                throw TypeException((string)"Type mismatch in arguments to operator \"" + 
                                    FuncOp->GetName() + "\"");
            }
        }
    }
开发者ID:BenCaulfield,项目名称:sygus-comp14,代码行数:29,代码来源:GrammarNodes.cpp


示例15: declarationFromTypes

Node<DeclarationNode>::Link DeclarationParser::declaration(bool throwIfEmpty) {
  if (accept(TT::SEMI)) {
    if (throwIfEmpty) throw InternalError("Empty declaration", {METADATA_PAIRS});
    else return nullptr;
  }
  if (accept(TT::DEFINE)) {
    skip();
    // Dynamic variable declaration
    expect(TT::IDENTIFIER, "Unexpected token after define keyword");
    return declarationFromTypes({});
  } else if (accept(TT::IDENTIFIER)) {
    auto ident = current().data;
    skip();
    // Single-type declaration
    if (accept(TT::IDENTIFIER)) {
      return declarationFromTypes({ident});
    }
    // Multi-type declaration
    if (accept(",")) {
      TypeList types = {ident};
      do {
        skip();
        expect(TT::IDENTIFIER, "Expected identifier in type list");
        types.insert(current().data);
        skip();
      } while (accept(","));
      expect(TT::IDENTIFIER);
      return declarationFromTypes(types);
    }
  }
  throw Error("SyntaxError", "Invalid declaration", current().trace);
}
开发者ID:slak44,项目名称:test-lang,代码行数:32,代码来源:tokenParser.cpp


示例16: RuleSetAddRule

void RuleSetAddRule(RuleSet * ruleset, Rule * rule)
/*
Purpose:
	Add the rule to the rule set.
	The rules in the ruleset are sorted by specificity (the most specific rule is at the start of the list).
	The rules are hashed by operation.
*/
{
    InstrOp op = rule->op;
    Rule * prev_r, * r;

    if (!rule->to->first) {
        InternalError("Empty rule");
        return;
    }

    prev_r = NULL;
    r = ruleset->rules[op];

    while(r != NULL && !RuleIsMoreSpecific(rule, r)) {
        prev_r = r;
        r = r->next;
    }

    rule->next = r;

    if (prev_r == NULL) {
        ruleset->rules[op] = rule;
    } else {
        prev_r->next = rule;
    }

}
开发者ID:davidechiappetta,项目名称:atalan,代码行数:33,代码来源:translate.c


示例17:

int	PGBuildLR1::MAKE_KERNEL (int camefrom, int symb)
{
      int i, la, c, first_item;
//		prt_log ("\nFROM STATE %d MAKING STATE %d\n\n", camefrom, n_states);
      hash_no = 0;
		first_item = -1;
      f_lrkernel[n_states] = n_lrkernels;
      for (c = 0; c < N_clo[camefrom]; c++)		// For all closure items.  
      {
         i = Closure[camefrom][c].item;			// Get item #.
         if (item[i].symb == symb)					// If head symbol match?
         {
				if (first_item == -1) first_item = i;
            la = Closure[camefrom][c].LA;       // Get old LA.
            hash_no += N_terms*(i+1) + la;		// Add both to hash number. 
            lrkernel [n_lrkernels].item = i+1;  // Make new LR1 item.
            lrkernel [n_lrkernels].LA   = la;   // Keep same look ahead.
//          prt_item ("Making LR1 kernel ", i+1, la);
            if (++n_lrkernels >= max_lrkernels) MemCrash ("Number of LR(1) kernels", max_lrkernels);
         }
      }
      l_lrkernel[n_states] = n_lrkernels;
      if (n_lrkernels == f_lrkernel[n_states]) InternalError (255);
//    PRT_LRSTA (n_states);
		return first_item;
}
开发者ID:glycerine,项目名称:lrstar,代码行数:26,代码来源:PGBuildLR1.cpp


示例18: op

Operator Token::op() const {
  if (type != TT::OPERATOR) throw InternalError("Only available on operators", {
    METADATA_PAIRS,
    {"token", this->toString()}
  });
  return Operator::list[idx];
}
开发者ID:slak44,项目名称:test-lang,代码行数:7,代码来源:token.cpp


示例19: PruneSectors

void PruneSectors(void)
{
  int i;
  int new_num;

  DisplayTicker();

  // scan all sectors
  for (i=0, new_num=0; i < num_sectors; i++)
  {
    sector_t *S = lev_sectors[i];

    if (S->ref_count < 0)
      InternalError("Sector %d ref_count is %d", i, S->ref_count);
    
    if (S->ref_count == 0)
    {
      UtilFree(S);
      continue;
    }

    S->index = new_num;
    lev_sectors[new_num++] = S;
  }

  if (new_num < num_sectors)
  {
    PrintVerbose("Pruned %d unused sectors\n", num_sectors - new_num);
    num_sectors = new_num;
  }

  if (new_num == 0)
    FatalError("Couldn't find any Sectors");
}
开发者ID:alexey-lysiuk,项目名称:doom64ex-osx,代码行数:34,代码来源:analyze.c


示例20: xmlAddChild

void Node::AddChild(std::shared_ptr<Node> child)
{
    xmlNodePtr newNode = xmlAddChild(_xml, child->xml());
    if ( newNode == nullptr )
        throw InternalError("Unable to add child node");
    child->rebind(newNode);
}
开发者ID:Hasimir,项目名称:readium-sdk,代码行数:7,代码来源:node.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ InternalList函数代码示例发布时间:2022-05-30
下一篇:
C++ InternalAList函数代码示例发布时间: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