这篇教程C++ writeMessage函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ writeMessage函数的具体用法?C++ writeMessage怎么用?C++ writeMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeMessage函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: clientStateListLockvoid SharedJelloServer::sendServerUpdate(void) { /* Lock the client state list: */ Threads::Mutex::Lock clientStateListLock(clientStateListMutex); /* Go through all client states: */ for(ClientStateList::iterator cslIt=clientStates.begin();cslIt!=clientStates.end();++cslIt) { ClientState* cs=*cslIt; if(cs->connected) { try { Threads::Mutex::Lock pipeLock(cs->pipeMutex); if(cs->parameterVersion!=parameterVersion) { /* Send a parameter update message: */ writeMessage(SERVER_PARAMUPDATE,*cs->pipe); cs->pipe->write<Scalar>(crystal.getAtomMass()); cs->pipe->write<Scalar>(crystal.getAttenuation()); cs->pipe->write<Scalar>(crystal.getGravity()); cs->parameterVersion=parameterVersion; } /* Send a server update message: */ writeMessage(SERVER_UPDATE,*cs->pipe); /* Send the crystal's state: */ crystal.writeAtomStates(*cs->pipe); cs->pipe->flush(); } catch(...) { /* Ignore write errors; let the client communication thread handle them */ } } } }
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:40,
示例2: loadVideovoid CasparDevice::playVideo(int channel, int videolayer, const QString& name, const QString &transition, int duration, const QString& easing, const QString& direction, int seek, int length, bool loop, bool useAuto){ if (useAuto) loadVideo(channel, videolayer, name, transition, duration, easing, direction, seek, length, loop, false, useAuto); else writeMessage(QString("PLAY %1-%2 /"%3/" %4 %5 %6 %7 %8 %9 %10") .arg(channel).arg(videolayer).arg(name).arg(transition).arg(duration).arg(easing) .arg(direction) .arg((seek > 0) ? QString("SEEK %1").arg(seek) : "") .arg((length > 0) ? QString("LENGTH %1").arg(length) : "") .arg((loop == true) ? "LOOP" : ""));}
开发者ID:IainCole,项目名称:Client,代码行数:13,
示例3: uiNameChanged void uiNameChanged(const char* const uiName) override { CARLA_SAFE_ASSERT_RETURN(uiName != nullptr && uiName[0] != '/0',); const CarlaMutexLocker cml(getPipeLock()); if (! writeMessage("uiTitle/n", 8)) return; if (! writeAndFixMessage(uiName)) return; flushMessages(); }
开发者ID:falkTX,项目名称:Carla,代码行数:13,
示例4: lockvoid SIPTransaction::sendAckFor2xx( const SIPMessage::Ptr& pAck, const OSS::IPAddress& dialogTarget){ OSS::mutex_lock lock(_mutex); if (!_dialogTarget.isValid()) _dialogTarget = dialogTarget; if (SIPXOR::isEnabled() && _isXOREncrypted) { pAck->setProperty("xor", "1"); } if (_transport->isReliableTransport()) { writeMessage(pAck); } else { writeMessage(pAck, dialogTarget); }}
开发者ID:arnaudcoquelet,项目名称:oss_core,代码行数:22,
示例5: QStringvoid ChatWindow::conNameChanged(QString name){ if( m_conName == name ||( name == "" && m_conName == QString(m_chatConnection->getIp()+":"+QString::number(m_chatConnection->getClientPort())) ) ){ return; } if( name == "" ){ name = QString(m_chatConnection->getIp()+":"+QString::number(m_chatConnection->getClientPort())); } writeMessage(StatusMess, QString("%1 changed name to %2").arg(m_conName, name) ); m_conName = name; setWindowTitle(QString("Chat: %1 - KLan").arg(m_conName));}
开发者ID:Fxrh,项目名称:KLan,代码行数:13,
示例6: writeMessagevoid TextOutputWidget::showSuccessMessage(const QString &message){ QColor previousBackgroundColor = m_output->textBackgroundColor(); QColor previousColor = m_output->textColor(); m_output->setTextBackgroundColor(m_succesBackgroundColor); m_output->setTextColor(m_succesTextColor); writeMessage(message); m_output->setTextBackgroundColor(previousBackgroundColor); m_output->setTextColor(previousColor);}
开发者ID:UIKit0,项目名称:kate,代码行数:13,
示例7: writeMessagevoid Messages::actionCB(){ if (entry.empty()) return; history.push_back(entry); // save in history if (entry[0] == '!') performRequest(entry); else { writeMessage("chat", g.pref.user, entry.c_str()); // display in message zone User::userWriting(entry.c_str()); // send to World Management } entry = ""; // clear textfield}
开发者ID:philippedax,项目名称:vreng,代码行数:13,
示例8: writeMessagevoid CasparDevice::loadVideo(int channel, int videolayer, const QString& name, const QString& transition, int duration, const QString& easing, const QString& direction, int seek, int length, bool loop, bool freezeOnLoad, bool useAuto){ writeMessage(QString("%1 %2-%3 /"%4/" %5 %6 %7 %8 %9 %10 %11 %12") .arg((freezeOnLoad == true) ? "LOAD" : "LOADBG") .arg(channel).arg(videolayer).arg(name).arg(transition).arg(duration).arg(easing) .arg(direction) .arg((seek > 0) ? QString("SEEK %1").arg(seek) : "") .arg((length > 0) ? QString("LENGTH %1").arg(length) : "") .arg((loop == true) ? "LOOP" : "") .arg((useAuto == true) ? "AUTO" : ""));}
开发者ID:IainCole,项目名称:Client,代码行数:13,
示例9: writeMessage/** * Returns 1 (true) if the font object type 1 passed as a parameter exists * and it is deleted from the manager successfully. * @param pFo Pointer to font object type 1 */bool IND_FontManager::remove(IND_Font *pFo) { g_debug->header("Freeing font", DebugApi::LogHeaderBegin); if (!_ok) { writeMessage(); return 0; } // Search object bool mIs = 0; list <IND_Font *>::iterator mFontListIter; for (mFontListIter = _listFonts->begin(); mFontListIter != _listFonts->end(); mFontListIter++) { if ((*mFontListIter) == pFo) { mIs = 1; break; } } // Not found if (!mIs) { writeMessage(); return 0; } // ----- Free object ----- g_debug->header("File name:", DebugApi::LogHeaderInfo); g_debug->dataChar(pFo->getFileName(), 1); // Quit from list delFromlist(pFo); g_debug->header("Ok", DebugApi::LogHeaderEnd); return 1;}
开发者ID:M-F-K,项目名称:indielib-crossplatform,代码行数:43,
示例10: qDebugvoid Server::sendJob(QTcpSocket* socket){ // mutexes if(cur_y >= vres) return; qDebug() << "Send Job"; WhiteNetwork::Job job = { cur_y, cur_y + step }; cur_y += step; QByteArray data; QDataStream ds(&data, QIODevice::ReadWrite); ds << WhiteNetwork::Message::Job << job; writeMessage(socket, data);}
开发者ID:ghostec,项目名称:White2,代码行数:14,
示例11: withoutDefaultGoodvoid withoutDefaultGood(Message mess){ switch(mess){ case Message::information: writeMessage(); break; case Message:: warning: writeWarning(); break; default: // nothing can be done break; } }
开发者ID:RainerGrimm,项目名称:ModernesCppSource,代码行数:15,
示例12: writeMessagevoid Writer::recordMessage(const protocol::MessagePtr &msg){ if(msg->isRecordable()) { const qint64 now = QDateTime::currentMSecsSinceEpoch(); if(m_minInterval>0) { const qint64 interval = now - m_interval; if(interval >= m_minInterval) { writeMessage(protocol::Interval(0, qMin(qint64(0xffff), interval))); } m_interval = now; } if(m_timestampInterval > 0) { const qint64 interval = now - m_lastTimestamp; if(interval >= m_timestampInterval) { writeMessage(protocol::Marker(0, QDateTime::currentDateTime().toString())); m_lastTimestamp = now; } } writeMessage(*msg); }}
开发者ID:callaa,项目名称:Drawpile,代码行数:24,
示例13: mavlink_msg_request_data_stream_encodevoid _MavlinkInterface::requestDataStream(uint8_t stream_id, int rate){ mavlink_message_t message; mavlink_request_data_stream_t ds; ds.target_system = system_id; ds.target_component = autopilot_id; ds.req_stream_id = stream_id; ds.req_message_rate = rate; ds.start_stop = 1; mavlink_msg_request_data_stream_encode(system_id, companion_id, &message,&ds); writeMessage(message); return;}
开发者ID:k5un,项目名称:OpenKAI,代码行数:15,
示例14: requestBroadcastMessageint requestBroadcastMessage(uint8_t address[5], uint8_t broadcast_address[5], uint8_t messageIndex) { printk("running init!/n"); uint8_t type = REQUESTBROADCAST; InitBroadcast msg; msg.messageId = type; msg.messageIndex = messageIndex; msg.length = 10; msg.uuid = CONFIG_HARDWARE_ID memcpy(msg.address, address, 5*sizeof(uint8_t)); printk("Sending init message/n"); printk("address %d/n", msg.address[1]); int writeReturn = writeMessage(msg, broadcast_address, msg.length); printk("sent broadcast/n"); return writeReturn;}
开发者ID:rymurr,项目名称:nrf24_tests,代码行数:15,
示例15: withDefaultvoid withDefault(Message mess){ switch(mess){ case Message::information: writeMessage(); break; case Message:: warning: writeWarning(); break; default: writeUnexpected(); break; } }
开发者ID:RainerGrimm,项目名称:ModernesCppSource,代码行数:15,
示例16: qDebugvoid MCentral::repaintGraph(QString name){ #ifdef MYDEBUG qDebug() << "Startuje MCentral::repaintGraph("<<name<<")"; #endif clearMessage(); clearTmpDisp(); if(name != ""){ //Nie wchodzi do ifa gdy zamykamy ostatni graf engine->setCurrentGraph(name); tmpDisp(engine->graphToString()); writeMessage(engine->dispResults()); } #ifdef MYDEBUG qDebug() << "Konczy sie MCentral::repaintGraph("<<name<<")"; #endif}
开发者ID:kamil-cc,项目名称:GraphAlg,代码行数:15,
示例17: threadFunction void threadFunction(void) { for(uint16_t i = 0u; i < 10u; i++) { std::stringstream ss; int sensorValue = std::rand() % 1000u; ss << name() << " data is " << sensorValue << " : " << writeMessage("/actuator", reinterpret_cast<uint8_t*>(&sensorValue), sizeof(sensorValue), 100u) << std::endl; CLogger() << ss.str(); CTiming::sleep_mS(100u); } }
开发者ID:andriy-bilynskyy,项目名称:OSAL,代码行数:16,
示例18: isSgStatementvoid RemovalOfNodes::visit(SgNode* node){ // If the AST node doesn't have the attribute keep, then delete the node. if(!node->attribute.exists("keep")){ SgStatement *stmt = isSgStatement(node); if(stmt!=NULL){ //LowLevelRewrite::remove(stmt); MiddleLevelRewrite::remove(stmt); //Still removes #include-statments when removes global variables#ifdef DEBUG_REMOVAL writeMessage(node);#endif } } // free memory of the ast attribute... // else if(node->attribute.exists("keep")){ // node->attribute.remove("keep"); // }}
开发者ID:Sciumo,项目名称:rose,代码行数:17,
示例19: mavlink_msg_command_long_encodevoid _Mavlink::command_long_doSetMode(int mode){ mavlink_message_t message; mavlink_command_long_t ds; ds.target_system = m_systemID; ds.target_component = m_targetComponentID; ds.command = MAV_CMD_DO_SET_MODE; ds.param1 = mode; mavlink_msg_command_long_encode(m_systemID, m_componentID, &message, &ds); writeMessage(message); LOG_I("<- COMMAND_LONG: MAV_CMD_DO_SET_MODE"); return;}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:17,
示例20: handleMessageRead /** * @see Session::handleMessageRead( Message& aMessage) */ virtual void handleMessageRead( Message& aMessage) { // This is the place where any request message from a client should // be handled robot->handleRequest( aMessage); // We now just echo the message. In real life we would write our own // response to the request. writeMessage( aMessage); // This is part of the original application. If one wants a stop message // just leave this here. Otherwise think something up yourself. if (aMessage.getBody() == "stop") { CommunicationService::getCommunicationService().getIOService().stop(); } }
开发者ID:Thomqa,项目名称:robotworldTest_1610,代码行数:20,
示例21: writeMessagevoid GuiChat::processEvent(Event* event){ if(event->hasProperty("CHAT")) { writeMessage(event); } if(event->hasProperty("Keyboard")) { if( (event->getProperty("Fonction").compare("ENTREE")) == 0 ) { if(atoi(event->getProperty("Action").c_str()) == 1) { sendMessage(); } } }}
开发者ID:quinsmpang,项目名称:xsilium-engine,代码行数:18,
示例22: mavlink_msg_request_data_stream_encodevoid _Mavlink::requestDataStream(uint8_t stream_id, int rate){ mavlink_message_t message; mavlink_request_data_stream_t ds; ds.target_system = m_systemID; ds.target_component = m_targetComponentID; ds.req_stream_id = stream_id; ds.req_message_rate = rate; ds.start_stop = 1; mavlink_msg_request_data_stream_encode(m_systemID, m_componentID, &message, &ds); writeMessage(message); LOG_I("<- REQUEST_DATA_STREAM"); return;}
开发者ID:yankailab,项目名称:OpenKAI,代码行数:18,
示例23: generateMessagevoid TeamMessageHandler::update(BHumanMessageOutputGenerator& outputGenerator){ outputGenerator.theBHumanArbitraryMessage.queue.clear(); outputGenerator.sendThisFrame =#ifndef SITTING_TEST#ifdef TARGET_ROBOT !(theMotionRequest.motion == MotionRequest::specialAction && theMotionRequest.specialActionRequest.specialAction == SpecialActionRequest::playDead) && !(theMotionInfo.motion == MotionRequest::specialAction && theMotionInfo.specialActionRequest.specialAction == SpecialActionRequest::playDead) &&#endif#endif // !SITTING_TEST theFrameInfo.getTimeSince(timeLastSent) >= sendInterval; outputGenerator.generate = [this, &outputGenerator](RoboCup::SPLStandardMessage* const m) { generateMessage(outputGenerator); writeMessage(outputGenerator, m); };}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:19,
示例24: messageLockvoid GrapheinClient::GrapheinTool::deleteCurvesCallback(Misc::CallbackData* cbData){ if(client==0) return; /* Delete all local curves: */ for(CurveMap::Iterator cIt=client->localCurves.begin(); !cIt.isFinished(); ++cIt) delete cIt->getDest(); client->localCurves.clear(); /* Send a curve deletion message: */ { Threads::Mutex::Lock messageLock(client->messageMutex); writeMessage(DELETE_ALL_CURVES,client->message); } /* Deactivate the tool just in case: */ active=false;}
开发者ID:KeckCAVES,项目名称:CollaborationInfrastructure,代码行数:19,
示例25: mavlink_msg_command_long_encodeint _MavlinkInterface::toggleOffboardControl(bool bEnable){ if(m_bControlling == bEnable)return -1; // Prepare command for off-board mode mavlink_command_long_t com; com.target_system = system_id; com.target_component = autopilot_id; com.command = MAV_CMD_NAV_GUIDED_ENABLE; com.confirmation = true; com.param1 = (float) bEnable; // flag >0.5 => start, <0.5 => stop // Encode mavlink_message_t message; mavlink_msg_command_long_encode(system_id, companion_id, &message, &com); // Send the message return writeMessage(message);}
开发者ID:k5un,项目名称:OpenKAI,代码行数:20,
示例26: SOCKET_LOGvoid ClientSocket::sendMessage(const QByteArray &message, int messageCode){ SOCKET_LOG( QString("Sending message to client (exit code: %1).").arg(messageCode) ); if (!m_socket) { SOCKET_LOG("Cannot send message to client. Socket is already deleted."); } else if (m_closed) { SOCKET_LOG("Client disconnected!"); } else { QByteArray msg; QDataStream out(&msg, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_5_0); out << static_cast<qint32>(messageCode); out.writeRawData( message.constData(), message.length() ); if ( writeMessage(m_socket, msg) ) SOCKET_LOG("Message sent to client."); else SOCKET_LOG("Failed to send message to client!"); }}
开发者ID:amosbird,项目名称:CopyQ,代码行数:20,
注:本文中的writeMessage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ writeNode函数代码示例 C++ writeLong函数代码示例 |