本文整理汇总了C++中Messages类的典型用法代码示例。如果您正苦于以下问题:C++ Messages类的具体用法?C++ Messages怎么用?C++ Messages使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Messages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: close
void Settings::on_mymessages_clicked()
{
close();
Messages sms;
sms.setModal(true);
sms.exec();
}
示例2: pthread_mutex_lock
bool CommRemote::run(Messages & messages, Feedback & feedback) {
// Delete all the previous remote messages to the robot
messages.clearRemoteMessagesToRobot();
pthread_mutex_lock(&dataMutex);
// Add all the received remote messages to the robot
std::vector<RemoteMessageToRobot const *>::iterator toIter;
for (toIter = messagesToRobot.begin();
toIter != messagesToRobot.end();
toIter++) {
messages.addRemoteMessageToRobot(*toIter);
}
messagesToRobot.clear();
// Take ownership of all the remote messages to be sent from the robot
messagesFromRobot.insert(messagesFromRobot.end(),
messages.getRemoteMessagesToSend().begin(),
messages.getRemoteMessagesToSend().end());
messages.clearRemoteMessagesFromRobot();
pthread_mutex_unlock(&dataMutex);
// Are we connected to a client now?
bool isConnectedToClient = (clientSocket >= 0);
if (isConnectedToClient != wasConnectedToClient) {
feedback.setConnectedToClient(isConnectedToClient);
wasConnectedToClient = isConnectedToClient;
}
return false;
}
示例3: dialogLoggingCallback
// dialogLoggingCallback is already used in debug.cpp
static void dialogLoggingCallback(const gchar */*log_domain*/,
GLogLevelFlags /*log_level*/,
const gchar *messageText,
gpointer user_data)
{
Messages *dlg = static_cast<Messages *>(user_data);
dlg->message(const_cast<char*>(messageText));
}
示例4: check_datum
void check_datum(Messages &m, MatrixXi &y){
for(int i=0; i<m.nnodes; i++)
assert(y(i) >= -1 && y(i) < m.nvals(i));
// do checks on m
for(int c=0; c<m.cliques.size(); c++){
assert(m.compute_nconfigs(c) > 0);
assert(m.nconfigs(c) > 0);
}
}
示例5: WXUNUSED
void DialogsProvider::OnMessages( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the log window */
if( !p_messages_dialog )
p_messages_dialog = new Messages( p_intf, this );
if( p_messages_dialog )
{
p_messages_dialog->Show( !p_messages_dialog->IsShown() );
}
}
示例6: getMessages
void CachingChannel::getMessages(std::vector<Poco::Message>& msg, int offset, int numEntries) const
{
msg.clear();
Messages::const_iterator it = _cache.begin();
while (offset > 0 && it != _cache.end())
++it;
while (numEntries > 0 && it != _cache.end())
{
msg.push_back(*it);
++it;
}
}
示例7: QueueMtMsg
// ------------------------------------------------------------------------------------------------
static void QueueMtMsg(bool type, CCStr msg, va_list args)
{
// Create a copy of the specified arguments list
va_list args_cpy;
va_copy(args_cpy, args);
// Allocate a moderately large string
String buffer(128, '\0');
// Attempt to run the specified format
Int32 size = vsnprintf(&buffer[0], buffer.size(), msg, args);
// See if a larger buffer is necessary
if (size > 0 && static_cast< unsigned >(size) > buffer.size())
{
// Resize the string buffer to the required size
buffer.resize(static_cast< unsigned >(size+1), '\0');
// Attempt to run the specified format
size = vsnprintf(&buffer[0], buffer.size(), msg, args_cpy);
}
// Finalize the arguments list copy
va_end(args_cpy);
// See if the format failed
if (size < 0)
{
return;
}
// Remove unwanted characters
buffer.resize(size+1);
// Acquire a global lock
std::lock_guard< std::mutex > lock(g_Mutex);
// Emplace the message into the message queue
g_Messages.emplace(std::move(buffer), type);
}
示例8: seqMessage
//----------------------------------------------------------------------
// internal utility function
static int seqMessage(MessageType type, const char* format, va_list ap)
{
char buff[SEQ_BUFFER_LENGTH];
int ret = vsnprintf(buff, sizeof(buff), format, ap);
Messages* messages = Messages::messages();
// if the message object exists, use it, otherwise dump to stderr
if (messages)
messages->addMessage(type, buff);
#ifdef Q_OS_WIN
OutputDebugStringA(buff);
OutputDebugStringA("\n");
#else
fprintf(stderr, "%s\n", buff);
#endif
return ret;
}
示例9: shared_from_this
void
Transaction::abort(Messages& messages)
{
log->recordAbort(id);
for (size_t i = 0; i < enrolledMessages.size(); ++i)
messages.abort(enrolledMessages[i], shared_from_this());
state = TRANS_ABORTED;
}
示例10: id
void CSMTools::BodyPartCheckStage::perform ( int stage, Messages &messages )
{
const CSMWorld::Record<ESM::BodyPart> &record = mBodyParts.getRecord(stage);
if ( record.isDeleted() )
return;
const ESM::BodyPart &bodyPart = record.get();
CSMWorld::UniversalId id( CSMWorld::UniversalId::Type_BodyPart, bodyPart.mId );
// Check BYDT
if (bodyPart.mData.mPart > 14 )
messages.push_back(std::make_pair( id, bodyPart.mId + " has out of range part value." ));
if (bodyPart.mData.mFlags > 3 )
messages.push_back(std::make_pair( id, bodyPart.mId + " has out of range flags value." ));
if (bodyPart.mData.mType > 2 )
messages.push_back(std::make_pair( id, bodyPart.mId + " has out of range type value." ));
// Check MODL
if ( bodyPart.mModel.empty() )
messages.push_back(std::make_pair( id, bodyPart.mId + " has no model." ));
else if ( mMeshes.searchId( bodyPart.mModel ) == -1 )
messages.push_back(std::make_pair( id, bodyPart.mId + " has invalid model." ));
// Check FNAM
if ( bodyPart.mRace.empty() )
messages.push_back(std::make_pair( id, bodyPart.mId + " has no race." ));
else if ( mRaces.searchId( bodyPart.mRace ) == -1 )
messages.push_back(std::make_pair( id, bodyPart.mId + " has invalid race." ));
}
示例11: FlushMessages
/* ------------------------------------------------------------------------------------------------
* Flush queued messages to the console output.
*/
void FlushMessages()
{
// Acquire a global lock
std::lock_guard< std::mutex > lock(g_Mutex);
// Output any queued messages
while (!g_Messages.empty())
{
// Identify the message type and send it
if (g_Messages.front().second)
{
OutputMessage("%s", g_Messages.front().first.c_str());
}
else
{
OutputError("%s", g_Messages.front().first.c_str());
}
// Pop the message from the queue
g_Messages.pop();
}
}
示例12: transformRequestFinished
void MemoryPacketModel::transformRequestFinished(QList<QByteArray> dataList, Messages messages)
{
quintptr senderID = (quintptr)sender();
if (transformRequests.contains(senderID)) {
QPair<int,int> target = transformRequests.take(senderID);
if (target.second > lastPredefinedColumn && target.second < columnNames.size()) {
int size = dataList.size();
if (size > packetsList.size() - target.first) {
qWarning() << tr("[MemoryPacketModel::transformRequestFinished] data set size (%1) is too big")
.arg(dataList.size());
size = packetsList.size() - target.first; // reducing the saice
}
QString colName = columnNames.at(target.second);
OutputFormat format = userColumnsDef.value(colName).format;
int j = 0;
for (int i = target.first; i < target.first + size; i++) {
Packet * pa = packetsList.at(i);
QString data = QString::fromUtf8((format == Pip3lineConst::TEXTFORMAT) ? dataList.at(j) : dataList.at(j).toHex());
pa->setAdditionalField(colName, data);
j++;
}
emit dataChanged(createIndex(target.first, target.second), createIndex(target.first + size - 1, target.second));
// loggin error messages
for (int i = 0; i < messages.size(); i++) {
emit log(messages.at(i).message,messages.at(i).source, messages.at(i).level);
}
} else {
qCritical() << tr("[MemoryPacketModel::transformRequestFinished] Can't find the column %1 T_T").arg(target.second);
}
} else {
qCritical() << tr("[MemoryPacketModel::transformRequestFinished] Can't find the request id T_T");
}
emit readOnlyStateChanged(false);
}
示例13: id
void CSMTools::SkillCheckStage::perform (int stage, Messages& messages)
{
const CSMWorld::Record<ESM::Skill>& record = mSkills.getRecord (stage);
if (record.isDeleted())
return;
const ESM::Skill& skill = record.get();
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Skill, skill.mId);
for (int i=0; i<4; ++i)
if (skill.mData.mUseValue[i]<0)
{
std::ostringstream stream;
stream << "Use value #" << i << " of " << skill.mId << " is negative";
messages.push_back (std::make_pair (id, stream.str()));
}
if (skill.mDescription.empty())
messages.push_back (std::make_pair (id, skill.mId + " has an empty description"));
}
示例14: while
void CSMDoc::Operation::executeStage()
{
Messages messages;
while (mCurrentStage!=mStages.end())
{
if (mCurrentStep>=mCurrentStage->second)
{
mCurrentStep = 0;
++mCurrentStage;
}
else
{
try
{
mCurrentStage->first->perform (mCurrentStep++, messages);
}
catch (const std::exception& e)
{
emit reportMessage (CSMWorld::UniversalId(), e.what(), "", mType);
abort();
}
++mCurrentStepTotal;
break;
}
}
emit progress (mCurrentStepTotal, mTotalSteps ? mTotalSteps : 1, mType);
for (Messages::Iterator iter (messages.begin()); iter!=messages.end(); ++iter)
emit reportMessage (iter->mId, iter->mMessage, iter->mHint, mType);
if (mCurrentStage==mStages.end())
exit();
}
示例15: vadd_msg
void Messages::vadd_msg(const char *msg, va_list ap)
{
player_messages.add_msg_string(vstring_format(msg, ap));
}