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


C++ identifier函数代码示例

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


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

示例1: createScalarField

 bool MutableMessage::addScalarField(const char *field, const uint8_t &value) {
     auto e = createScalarField(m_field_allocator, field, value);
     auto result = m_keys.insert(std::make_pair(e->identifier(), m_payload.size()));
     if (tf::likely(result.second)) {
         m_payload.emplace_back(e);
     } else {
         destroyField(m_field_allocator, e);
     }
     return result.second;
 }
开发者ID:wannabegeek,项目名称:DCM,代码行数:10,代码来源:MutableMessage.cpp

示例2: position

 Stmt* Parser::useStatement()
 {
     uint32_t pos = position();
     eat(T_Use);
     if (!(hd() == T_Identifier && identValue() == compiler->SYM_namespace))
         compiler->syntaxError(pos, SYNTAXERR_ILLEGAL_USE);
     eat(T_Identifier);
     Str* ns = identifier();
     return ALLOC(UseNamespaceStmt, (pos, ns));
 }
开发者ID:changm,项目名称:tessa,代码行数:10,代码来源:eval-parse-stmt.cpp

示例3: CommandResult

CommandResult::SharedConst TotalBalancesCommand::resultOk(
    string &totalBalancesStr) const
{
    return CommandResult::SharedConst(
        new CommandResult(
            identifier(),
            UUID(),
            200,
            totalBalancesStr));
}
开发者ID:GEO-Project,项目名称:GEO-Project,代码行数:10,代码来源:TotalBalancesCommand.cpp

示例4: position

 Stmt* Parser::useStatement()
 {
     uint32_t pos = position();
     eat(T_Use);
     if (!match(T_Namespace))
         compiler->syntaxError(pos, SYNTAXERR_ILLEGAL_USE);
     Str* ns = identifier();
     addOpenNamespace(ALLOC(NamespaceRef, (ns)));
     return ALLOC(EmptyStmt, ());
 }
开发者ID:bsdf,项目名称:trx,代码行数:10,代码来源:eval-parse-stmt.cpp

示例5: ASSERT

void ThreadIdentifierData::initialize(ThreadIdentifier id)
{
    ASSERT(!identifier());

#if !ENABLE(SAMSUNG_WEBKIT_PERFORMANCE_PATCH)
    // SAMSUNG CHANGE : Webkit Performance Patch Merge + r92154
    initializeKeyOnce();
    // SAMSUNG CHANGE : Webkit Performance Patch Merge -
#endif
    pthread_setspecific(m_key, new ThreadIdentifierData(id));
}
开发者ID:johnwpoliver,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:11,代码来源:ThreadIdentifierDataPthreads.cpp

示例6: eat

 CatchClause* Parser::catchClause()
 {
     eat (T_LeftParen);
     Str* catchvar_name = identifier();
     Type* catchvar_type_name = NULL;
     if (match(T_Colon))
         catchvar_type_name = typeExpression();
     eat (T_RightParen);
     Seq<Stmt*>* catchblock = statementBlock();
     return ALLOC(CatchClause, (catchvar_name, catchvar_type_name, catchblock));
 }
开发者ID:bsdf,项目名称:trx,代码行数:11,代码来源:eval-parse-stmt.cpp

示例7: advance

void Scanner::scanToken()
{
	char c = advance();
	switch (c) {
	case '(': addToken(LEFT_PAREN); break;
	case ')': addToken(RIGHT_PAREN); break;
	case '{': addToken(LEFT_BRACE); break;
	case '}': addToken(RIGHT_BRACE); break;
	case ',': addToken(COMMA); break;
	case '.': addToken(DOT); break;
	case '-': addToken(MINUS); break;
	case '+': addToken(PLUS); break;
	case ';': addToken(SEMICOLON); break;
	case '*': addToken(STAR); break;
	case '!': addToken(match('=') ? BANG_EQUAL : BANG); break;
	case '=': addToken(match('=') ? EQUAL_EQUAL : EQUAL); break;
	case '<': addToken(match('=') ? LESS_EQUAL : LESS); break;
	case '>': addToken(match('=') ? GREATER_EQUAL : GREATER); break;
	case '/':
		if (match('/'))
		{
			while (peek() != '\n' && !isAtEnd()) advance();
		}
		else
		{
			addToken(SLASH);
		}
		break;
	case ' ':
	case '\r':
	case '\t':
		// Ignore whitespace.                      
		break;

	case '\n':
		line_++;
		break;
	case '"': string(); break;
	default:
		if (isDigit(c))
		{
			number();
		}
		else if (isAlpha(c))
		{
			identifier();
		}
		else
		{
			error(line_, "Unexpected character.");
		}
		break;
	}
}
开发者ID:remiznik,项目名称:tests,代码行数:54,代码来源:Scanner.cpp

示例8: text

void LineEdit::checkContent()
{
    if (text().length()>=2 && currentBegin!=text().mid(0,2).toLower()) {
        currentBegin = text().mid(0,2).toLower();
        networkManager->sendGetStationsRequest(currentBegin,identifier());
        //qDebug()<<"id  "<<identifier();
    }

    //QUrl decode cyrillic letters automatically
    //networkManager->sendGetStationsRequest(QUrl::toPercentEncoding(currentBegin),identifier());
}
开发者ID:dimininio,项目名称:TicketScanner,代码行数:11,代码来源:lineedit.cpp

示例9: while

AST *
PreProcessor::expression()
{
	List<Token> exps;
	while (!tokenit.eof() && !tokenit.is(_PP_END)) {
		const Token &t = tokenit.get(0);
		switch (t.id) {
		case _IDENT: {
			bool replaced = identifier();
			if (!replaced) {
				exps.push_back(t);
			}
			continue;
		}
			//'defined' expression is pre-evaluated here
		case _PP_DEFINED: {
			tokenit.next();
			bool lparen = tokenit.eat(_LPAREN);
			if (!tokenit.is(_IDENT)){
				ERROR("'defined' error");
			}
			bool defined = isDefined(tokenit.val()->toString());
			tokenit.next();
			if (lparen && !tokenit.eat(_RPAREN)) {
				ERROR("'defined' error");
				return false;
			}
			Token newt;
			newt.id = _DECIMAL_CONSTANT;
			if (defined) {
				newt.val = new TokenInt("<defined 1>", 1);
			} else {
				newt.val = new TokenInt("<defined 0>", 0);
			}
			exps.push_back(newt);
			continue;
		}
		case _SPC:
			//don't push spaces
			break;
		default:
			exps.push_back(t);
		}
		tokenit.next();
	}
	DBG("expression %d", exps.size());
	ptokens(exps);
	DBG("---------");
	if (tokenit.is(_PP_END)) {
		tokenit.next();
	}
	
	return parser.parseConstantExpression(exps);
}
开发者ID:ktok07b6,项目名称:scc,代码行数:54,代码来源:PreProcessor.cpp

示例10: show

void Brick::hit()
{
    if (identifier() == "HiddenBrick" && !isVisible()) {
        show();
        ++m_game->m_remainingBricks;
    } else if (identifier() == "MultipleBrick3") {
        setIdentifier("MultipleBrick2");
        // TODO: make a convenience function out of the following two
        m_game->addScore(qRound(m_game->m_dScore));
        m_game->m_dScore = BRICK_SCORE;
    } else if (identifier() == "MultipleBrick2") {
        setIdentifier("MultipleBrick1");
        m_game->addScore(qRound(m_game->m_dScore));
        m_game->m_dScore = BRICK_SCORE;
    } else if (identifier() == "ExplodingBrick") {
        explode();
    } else if (identifier() != "UnbreakableBrick") {
        forcedHit();
    }
}
开发者ID:thypon,项目名称:xbreakout,代码行数:20,代码来源:brick.cpp

示例11: forcedHit

void Brick::forcedHit()
{
    if (m_deleted) return;
    
    if (identifier() == "ExplodingBrick") {
        explode();
    } else {
        handleDeletion();
    }
    hide();
}
开发者ID:thypon,项目名称:xbreakout,代码行数:11,代码来源:brick.cpp

示例12: handleTimeout

	/// Handle the completion of a timer operation.
	void handleTimeout( const boost::system::error_code& e )
	{
		if ( !e )	{
			m_connHandler->signalOccured( ConnectionHandler::TIMEOUT );
			LOG_DEBUG << "Timeout on connection to " << identifier();

			nextOperation();
		}
		else	{
			assert( e == boost::asio::error::operation_aborted );
		}
	}
开发者ID:Wolframe,项目名称:Wolframe,代码行数:13,代码来源:connectionBase.hpp

示例13: catch

void TCPConnection::send(ByteArray message, std::chrono::milliseconds timeout) const {
    try {
        socket_->SendData((const int8_t*)message.data(), message.size(), static_cast<uint32_t>(timeout.count()));
    } catch (const IVDA::SocketConnectionException& err) {
        throw ConnectionClosedError("Connection to peer " + socket_->GetPeerAddress() + " lost during send operation (internal error: " +
                                        err.what() + ")",
                                    identifier(), __FILE__, __LINE__);
    } catch (const IVDA::SocketException& err) {
        std::string internalError = mocca::joinString(err.what(), ", ", err.internalError());
        throw NetworkError("Network error in send operation (internal error: " + internalError + ")", __FILE__, __LINE__);
    }
}
开发者ID:waschkbaer,项目名称:BrainVis,代码行数:12,代码来源:TCPConnection.cpp

示例14: createNotEnoughArgumentsError

JSValue JSSubtleCrypto::encrypt(ExecState* exec)
{
    if (exec->argumentCount() < 3)
        return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));

    auto algorithm = createAlgorithmFromJSValue(exec, exec->uncheckedArgument(0));
    if (!algorithm) {
        ASSERT(exec->hadException());
        return jsUndefined();
    }

    auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(exec, algorithm->identifier(), exec->uncheckedArgument(0));
    if (!parameters) {
        ASSERT(exec->hadException());
        return jsUndefined();
    }

    RefPtr<CryptoKey> key = JSCryptoKey::toWrapped(exec->uncheckedArgument(1));
    if (!key)
        return throwTypeError(exec);

    if (!key->allows(CryptoKeyUsageEncrypt)) {
        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'encrypt'"));
        setDOMException(exec, NOT_SUPPORTED_ERR);
        return jsUndefined();
    }

    CryptoOperationData data;
    if (!cryptoOperationDataFromJSValue(exec, exec->uncheckedArgument(2), data)) {
        ASSERT(exec->hadException());
        return jsUndefined();
    }

    
    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(exec, globalObject());
    DeferredWrapper wrapper(exec, globalObject(), promiseDeferred);
    auto successCallback = [wrapper](const Vector<uint8_t>& result) mutable {
        wrapper.resolve(result);
    };
    auto failureCallback = [wrapper]() mutable {
        wrapper.reject(nullptr);
    };

    ExceptionCode ec = 0;
    algorithm->encrypt(*parameters, *key, data, WTF::move(successCallback), WTF::move(failureCallback), ec);
    if (ec) {
        setDOMException(exec, ec);
        return jsUndefined();
    }

    return promiseDeferred->promise();
}
开发者ID:LianYue1,项目名称:webkit,代码行数:52,代码来源:JSSubtleCryptoCustom.cpp

示例15: Q_D

/*!
    \qmlmethod bool FacebookAlbum::unlike()
    Initiates a "delete like" operation on the album.

    If the network request was started successfully, the function
    will return true and the status of the album will change to
    \c SocialNetwork::Busy.  Otherwise, the function will return
    false.
*/
bool FacebookAlbumInterface::unlike()
{
    Q_D(FacebookAlbumInterface);
    bool requestMade = request(IdentifiableContentItemInterface::Delete,
                               identifier(), QLatin1String("likes"));

    if (!requestMade)
        return false;

    d->action = FacebookInterfacePrivate::DeleteLikeAction;
    d->connectFinishedAndErrors();
    return true;
}
开发者ID:VDVsx,项目名称:nemo-qml-plugins,代码行数:22,代码来源:facebookalbuminterface.cpp


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