本文整理汇总了C++中DEBUG_TAG函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG_TAG函数的具体用法?C++ DEBUG_TAG怎么用?C++ DEBUG_TAG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEBUG_TAG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
/** Connects the 0MQ sockets */
bool StatusSubscribe::startSocket()
{
m_socket = m_context->createSocket(ZMQSocket::TYP_SUB, this);
m_socket->setLinger(0);
try {
m_socket->connectTo(m_socketUri);
}
catch (const zmq::error_t &e) {
const QString errorString = QString("Error %1: ").arg(e.num()) + QString(e.what());
qCritical() << m_debugName << ":" << errorString;
return false;
}
connect(m_socket, &ZMQSocket::messageReceived,
this, &StatusSubscribe::processSocketMessage);
for (const auto &topic: m_socketTopics)
{
m_socket->subscribeTo(topic);
}
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "sockets connected" << m_socketUri);
#endif
return true;
}
示例2: i
void ServiceDiscovery::stopQuery(const QString &serviceType)
{
int queryId = 0; // prevents compiler warning
bool found = false;
QMapIterator<int, QString> i(m_queryIdServiceMap);
while (i.hasNext()) {
i.next();
if (i.value() == serviceType) // query type matching
{
found = true;
queryId = i.key();
break;
}
}
if (!found)
{
return;
}
m_jdns->queryCancel(queryId);
m_queryIdTypeMap.remove(queryId);
m_queryIdServiceMap.remove(queryId);
clearAlItems(serviceType);
DEBUG_TAG(1, "SD", "Stopped query" << queryId << serviceType);
}
示例3: DEBUG_TAG
/** Processes all message received on socket */
void PreviewSubscribe::processSocketMessage(const QList<QByteArray> &messageList)
{
Container &rx = m_socketRx;
if (messageList.length() < 2) // in case we received insufficient data
{
return;
}
// we only handle the first two messges
const auto &topic = messageList.first();
rx.ParseFromArray(messageList.last().data(), messageList.last().size());
#ifdef QT_DEBUG
std::string s;
gpb::TextFormat::PrintToString(rx, &s);
DEBUG_TAG(3, m_debugName, "received message" << QString::fromStdString(s));
#endif
// react to any incoming message
if (m_state == State::Up)
{
emit fsmUpMessageReceived(QPrivateSignal());
}
emit socketMessageReceived(topic, rx);
}
示例4: DEBUG_TAG
void QServiceDiscovery::deinitializeMdns()
{
if (m_jdns == NULL)
{
return;
}
#ifdef QT_DEBUG
DEBUG_TAG(1, "SD", "Deinitializing JDNS");
#endif
if (m_running)
{
if (m_lookupMode == UnicastDNS)
{
m_unicastLookupTimer->stop();
}
removeAllServiceTypes();
m_queryIdItemMap.clear();
m_queryIdServiceMap.clear();
m_queryIdTypeMap.clear();
}
m_jdns->deleteLater();
m_jdns = NULL;
#if defined(Q_OS_ANDROID)
QAndroidJniObject::callStaticMethod<void>("io/machinekit/service/MulticastActivator",
"disable");
#endif
m_lookupReady = false; // lookup no ready anymore
emit lookupReadyChanged(m_lookupReady);
}
示例5: DEBUG_TAG
void ConfigBase::fsmLoading()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "State LOADING");
#endif
m_state = State::Loading;
emit stateChanged(m_state);
}
示例6: DEBUG_TAG
void LogServiceBase::fsmUp()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "State UP");
#endif
m_state = State::Up;
emit stateChanged(m_state);
}
示例7: DEBUG_TAG
void LauncherBase::fsmSynced()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "State SYNCED");
#endif
m_state = State::Synced;
emit stateChanged(m_state);
}
示例8: DEBUG_TAG
void HalrcompSubscribe::fsmTrying()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "State TRYING");
#endif
m_state = State::Trying;
emit stateChanged(m_state);
}
示例9: DEBUG_TAG
void StatusSubscribe::fsmUp()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "State UP");
#endif
m_state = State::Up;
emit stateChanged(m_state);
}
示例10: DEBUG_TAG
void ServiceDiscovery::openNetworkSession()
{
DEBUG_TAG(3, "SD", "trying to open network session");
// use the default network configuration and make sure that the link is open
QList<QNetworkConfiguration> availableConfigs;
QNetworkConfiguration defaultConfig = m_networkConfigManager->defaultConfiguration();
if (defaultConfig.isValid()) {
availableConfigs.append(defaultConfig);
}
availableConfigs.append(m_networkConfigManager->allConfigurations(QNetworkConfiguration::Discovered));
DEBUG_TAG(2, "SD", "number of configs: " << availableConfigs.size());
for (const QNetworkConfiguration &config: availableConfigs)
{
if (networkConfigIsQualified(config))
{
DEBUG_TAG(2, "SD", "network config: " << config.bearerTypeName() << config.bearerTypeFamily() << config.name());
if (!m_networkSession.isNull())
{
m_networkSession->deleteLater();
}
m_networkSession = new QNetworkSession(config, this);
connect(m_networkSession, &QNetworkSession::opened,
this, &ServiceDiscovery::networkSessionOpened);
connect(m_networkSession, &QNetworkSession::closed,
this, &ServiceDiscovery::networkSessionClosed);
connect(m_networkSession, static_cast<void (QNetworkSession::*)(QNetworkSession::SessionError)>(&QNetworkSession::error),
this, &ServiceDiscovery::networkSessionError);
m_networkSession->open();
return;
}
else
{
DEBUG_TAG(2, "SD", "unsupported network config: " << config.bearerTypeName() << config.bearerTypeFamily() << config.name());
}
}
}
示例11: DEBUG_TAG
void QApplicationStatus::stop()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, "status", "stop")
#endif
cleanup();
updateState(Disconnected); // clears also the error
}
示例12: DEBUG_TAG
void QApplicationLauncher::stop()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_commandIdentity, "stop")
#endif
cleanup();
updateState(Service::Disconnected); // clears also the error
}
示例13: DEBUG_TAG
void QApplicationCommand::stop()
{
#ifdef QT_DEBUG
DEBUG_TAG(1, "command", "stop")
#endif
cleanup();
updateState(Disconnected);
updateError(NoError, ""); // clear the error here
}
示例14: DEBUG_TAG
void ApplicationLauncher::start(int index)
{
if (!m_synced) {
return;
}
#ifdef QT_DEBUG
DEBUG_TAG(1, debugName(), "starting launcher" << index)
#endif
m_tx.set_index(index);
sendLauncherStart(m_tx);
}
示例15: DEBUG_TAG
void CommandBase::fsmUpCommandTryingEvent()
{
if (m_state == State::Up)
{
#ifdef QT_DEBUG
DEBUG_TAG(1, m_debugName, "Event COMMAND TRYING");
#endif
// handle state change
emit fsmUpExited(QPrivateSignal());
fsmTrying();
emit fsmTryingEntered(QPrivateSignal());
// execute actions
}
}