本文整理匯總了C++中DebugOut函數的典型用法代碼示例。如果您正苦於以下問題:C++ DebugOut函數的具體用法?C++ DebugOut怎麽用?C++ DebugOut使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DebugOut函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: main
int main(int argc, char** argv)
{
QCoreApplication app(argc,argv);
AmbProperty speed;
double totalLatency=0;
int numSamples=0;
QObject::connect(&speed, &AmbProperty::signalChanged,[&](QVariant val)
{
double t1 = speed.time();
double t2 = amb::currentTime();
double latency = (t2-t1)*1000.0;
DebugOut(0)<<"latency: "<<latency<<std::endl;
totalLatency+=latency;
numSamples++;
DebugOut(0)<<"Average: "<<totalLatency / numSamples<<std::endl;
});
speed.setPropertyName("VehicleSpeed");
speed.connect();
return app.exec();
}
示例2: DebugOut
bool TextureShader::CreateShaders(ID3D11Device *device)
{
HRESULT hr;
// create vertex shader object from compiled shader code
hr = device->CreateVertexShader(m_vsBlob->GetBufferPointer(), m_vsBlob->GetBufferSize(), nullptr, &m_VertexShader);
if (FAILED(hr)) {
DebugOut("ID3D11Device::CreateVertexShader failed!\n");
m_vsBlob->Release();
m_psBlob = nullptr;
return false;
}
// create pixel shader
hr = device->CreatePixelShader(m_psBlob->GetBufferPointer(), m_psBlob->GetBufferSize(), nullptr, &m_PixelShader);
if (FAILED(hr)) {
DebugOut("ID3D11Device::CreatePixelShader failed!\n");
m_psBlob->Release();
m_psBlob = nullptr;
return false;
}
return true;
};
示例3: AbstractSource
TestPlugin::TestPlugin(AbstractRoutingEngine *re, map<string, string> config)
: AbstractSource(re, config)
{
DebugOut() << "Testing MapPropertyType... " << endl;
MapPropertyType<BasicPropertyType<Zone::Type>,BasicPropertyType<Door::Status>> propmap("something");
MapPropertyType<BasicPropertyType<Zone::Type>,BasicPropertyType<Door::Status>> propmaptwo("something");
propmap.append(Zone::RearLeft,Door::Ajar);
GVariant *var = propmap.toVariant();
gsize dictsize = g_variant_n_children(var);
//DebugOut() << var << endl;
propmaptwo.fromVariant(var);
g_assert(propmaptwo.toString() == propmap.toString());
DebugOut() << "Testing ListPropertyType... " << endl;
VehicleProperty::TripMetersType* tfirst = new VehicleProperty::TripMetersType();
VehicleProperty::TripMetersType* tsecond = new VehicleProperty::TripMetersType();
BasicPropertyType<uint16_t> v1(0);
BasicPropertyType<uint16_t> v2(5);
BasicPropertyType<uint16_t> v3(10);
tfirst->append(&v1);
tfirst->append(&v2);
tfirst->append(&v3);
tsecond->fromVariant(tfirst->toVariant());
g_assert (tfirst->toString() == tsecond->toString());
testBooleanToStringFromString();
g_assert (testCoreUpdateSupported());
DebugOut() << "Exiting..." << endl;
exit(-1);
}
示例4: gioPollingFunc
bool gioPollingFunc(GIOChannel *source, GIOCondition condition, gpointer data)
{
DebugOut(5) << "Polling..." << condition << endl;
if(condition & G_IO_ERR)
{
DebugOut(0)<< __SMALLFILE__ <<":"<< __LINE__ <<" websocketsink polling error."<<endl;
}
if (condition & G_IO_HUP)
{
//Hang up. Returning false closes out the GIOChannel.
//printf("Callback on G_IO_HUP\n");
DebugOut(0)<<"socket hangup event..."<<endl;
return false;
}
//This is the polling function. If it return false, glib will stop polling this FD.
//printf("Polling...%i\n",condition);
lws_tokens token;
struct pollfd pollstruct;
int newfd = g_io_channel_unix_get_fd(source);
pollstruct.fd = newfd;
pollstruct.events = condition;
pollstruct.revents = condition;
libwebsocket_service_fd(context,&pollstruct);
return true;
}
示例5: DebugOut
void CCmdAlphaWeightModulate::UnExecute()
{
CCmd::UnExecute();
CTerrainMesh * pTerrain = CMapEditApp::GetInstance()->GetTerrainMesh();
for ( std::vector<SVertex>::iterator iter = m_vecDiffs.begin(); iter != m_vecDiffs.end(); ++iter )
{
pTerrain->SetAlphaWeightAlpha(iter->dwVertexIndex, iter->weightColor);
}
DebugOut("UnExecute Test %d, %d", m_processParams.dwBrushSizeInX, m_processParams.dwBrushSizeInZ);
int width = 0, depth = 0;
width = m_processParams.dwBrushSizeInX;
depth = m_processParams.dwBrushSizeInZ;
if ( width != pTerrain->GetWidth() )
width *= 2;
if ( depth != pTerrain->GetDepth() )
depth *= 2;
DebugOut("FillBlendTexture %d, %d", width, depth);
pTerrain->FillBlendTexture(m_vecDiffs[0].dwVertexIndex , width, depth ) ;
}
示例6: DebugOut
void OBD2Source::getPropertyAsync(AsyncPropertyReply *reply)
{
DebugOut(5) << __SMALLFILE__ <<":"<< __LINE__ << "getPropertyAsync requested for " << reply->property << endl;
VehicleProperty::Property property = reply->property;
if(!ListPlusPlus<VehicleProperty::Property>(&m_supportedProperties).contains(property))
{
DebugOut(0)<<"obd plugin does not support: "<<property<<endl;
return;
}
if(reply->property == Obd2Connected)
{
reply->success = true;
reply->value = &obd2Connected;
reply->completed(reply);
return;
}
propertyReplyMap[reply->property] = reply;
ObdPid* requ = obd2AmbInstance->createPidforProperty(property);
g_async_queue_push(singleShotQueue,requ);
CommandRequest *req = new CommandRequest();
req->req = "connectifnot";
g_async_queue_push(commandQueue,req);
}
示例7: DebugOut
void Matrix34::WriteToDebugStream()
{
DebugOut("%5.2f %5.2f %5.2f\n", r.x, r.y, r.z);
DebugOut("%5.2f %5.2f %5.2f\n", u.x, u.y, u.z);
DebugOut("%5.2f %5.2f %5.2f\n", f.x, f.y, f.z);
DebugOut("%5.2f %5.2f %5.2f\n\n", pos.x, pos.y, pos.z);
}
示例8: switch
void SimpleAction::OnActivate()
{
auto gameObject = _gameObject.lock();
auto gameWorld = gameObject->GetGameWorld();
if (!_actionComplete)
{
//_actionComplete = true;
switch(_type)
{
case SimpleAction::Type::PlaySound:
// Play sound
DebugOut("PLAY SOUND: %S",_data.c_str());
gameWorld->GetDeviceContext().audioDevice->PlayClip(Quake2Game::GetContentCache()->GetAudioClip(_data));
break;
case SimpleAction::Type::PrintText:
// Print text to window
// _data is the text to output
DebugOut("TEXT MESSAGE: %S",_data.c_str());
break;
default:
break;
}
}
}
示例9: main
int main(int argc, char** argv)
{
DebugOut::setDebugThreshhold(7);
DebugOut::setThrowErr(true);
DebugOut::setThrowWarn(false);
DebugOut(0) << "Testing AMB json server/client" << endl;
QCoreApplication app(argc, argv);
DomainSocket socket;
socket.open();
if(!socket.getSocket()->waitForConnected())
{
DebugOut("Could not connect");
return -1;
}
DebugOut(0) << "We are connected!" << endl;
amb::AmbRemoteClient client(&socket);
runTest(&client);
app.exec();
}
示例10: g_io_channel_shutdown
void WebSocketSinkManager::removePoll(int fd)
{
g_io_channel_shutdown(m_ioChannelMap[fd],false,0);
//printf("Shutting down IO Channel\n");
DebugOut() << __SMALLFILE__ <<":"<< __LINE__ << "Shutting down IO Channel\n";
g_source_remove(m_ioSourceMap[fd]); //Since the watch owns the GIOChannel, this should unref it enough to dissapear.
//for (map<int,guint>::const_iterator i=m_ioSourceMap.cbegin();i!=m_ioSourceMap.cend();i++)
for (map<int,guint>::iterator i=m_ioSourceMap.begin();i!=m_ioSourceMap.end();i++)
{
if((*i).first == fd)
{
//printf("Erasing source\n");
DebugOut() << __SMALLFILE__ <<":"<< __LINE__ << "Erasing source\n";
m_ioSourceMap.erase(i);
i--;
}
}
//for (map<int,GIOChannel*>::const_iterator i=m_ioChannelMap.cbegin();i!=m_ioChannelMap.cend();i++)
for (map<int,GIOChannel*>::iterator i=m_ioChannelMap.begin();i!=m_ioChannelMap.end();i++)
{
if((*i).first == fd)
{
//printf("Erasing channel\n");
DebugOut() << __SMALLFILE__ <<":"<< __LINE__ << "Erasing channel\n";
m_ioChannelMap.erase(i);
i--;
}
}
}
示例11: assert
void DspTempo::AdjustTempo()
{
if (m_tempo != m_ftempo)
{
assert(m_tempo != m_ftempo1);
assert(m_tempo != m_ftempo2);
double ratio21 = std::abs((m_tempo - m_ftempo1) / (m_tempo - m_ftempo2));
if (m_ftempo != m_ftempo2 &&
m_outSamples1 * ratio21 - m_outSamples2 > 60 * m_rate)
{
DebugOut(ClassName(this), "adjusting for float/double imprecision (2), ratio", ratio21);
m_ftempo = m_ftempo2;
m_stouch.setTempo(m_ftempo);
}
else if (m_ftempo != m_ftempo1 &&
m_outSamples2 - m_outSamples1 * ratio21 > 60 * m_rate)
{
DebugOut(ClassName(this), "adjusting for float/double imprecision (1), ratio", ratio21);
m_ftempo = m_ftempo1;
m_stouch.setTempo(m_ftempo);
}
}
}
示例12: ServiceCtrlHandlerEx
DWORD WINAPI ServiceCtrlHandlerEx(DWORD dwOpcode, DWORD dwEventType, LPVOID lpEventData, LPVOID /*lpContext*/) {
DWORD dwRes = ERROR_CALL_NOT_IMPLEMENTED;
switch (dwOpcode) {
case SERVICE_CONTROL_STOP:
DebugOut("SERVICE_CONTROL_STOP\n");
if (hDevNotify) UnregisterDeviceNotification(hDevNotify);
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
if (gpSid) free(gpSid);
dwRes = NO_ERROR;
break;
case SERVICE_CONTROL_INTERROGATE:
DebugOut("SERVICE_CONTROL_INTERROGATE\n");
dwRes = NO_ERROR;
break;
case SERVICE_CONTROL_DEVICEEVENT:
DebugOut("SERVICE_CONTROL_DEVICEEVENT");
DeviceEventNotify(dwEventType, lpEventData);
dwRes = NO_ERROR;
break;
}
if (!SetServiceStatus(hServiceStatus, &ServiceStatus)) { // Send current status.
DebugOut("SetServiceStatus failed! (LastError=0x%x)\n", GetLastError());
}
return dwRes;
}
示例13: signalCallback
static void signalCallback( GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
AutomotiveManager* manager = static_cast<AutomotiveManager*>(user_data);
if(!manager)
{
DebugOut(DebugOut::Error)<<"Bad user_data"<<endl;
return;
}
gchar* name=nullptr;
gchar* newOwner=nullptr;
gchar* oldOwner = nullptr;
g_variant_get(parameters,"(sss)",&name, &oldOwner, &newOwner);
std::list<AbstractDBusInterface*> toRemove;
if(std::string(newOwner) == "")
{
for(auto &i : manager->subscribedProcesses)
{
AbstractDBusInterface* iface = i.first;
for(auto itr = i.second.begin(); itr != i.second.end(); itr++)
{
std::string n = *itr;
if(n == name)
{
DebugOut()<<"unreferencing "<<n<<" from the subscription of "<<iface->objectPath()<<endl;
itr = manager->subscribedProcesses[iface].erase(itr);
DebugOut()<<"new ref count: "<<manager->subscribedProcesses[iface].size()<<endl;
}
}
if(manager->subscribedProcesses[iface].empty())
{
DebugOut()<<"No more subscribers. Unregistering: "<<iface->objectPath()<<endl;
///Defer removal to not screw up the list
toRemove.push_back(iface);
iface->unregisterObject();
}
}
for(auto & i : toRemove)
{
manager->subscribedProcesses.erase(i);
}
}
g_free(name);
g_free(newOwner);
g_free(oldOwner);
}
示例14: main
int main() {
std::string name = "bob";
int age = 25;
DebugOut(L"HI");
DebugOut("my name is %s", name.c_str());
DebugOut() << name << " is age " << age;
return 0;
}
示例15: DebugOut
void WebSocketSinkManager::addSingleShotSink(libwebsocket* socket, VehicleProperty::Property property, Zone::Type zone, string id)
{
AsyncPropertyRequest request;
PropertyList foo = VehicleProperty::capabilities();
if (ListPlusPlus<VehicleProperty::Property>(&foo).contains(property))
{
request.property = property;
}
else
{
DebugOut(0)<<"websocketsink: Invalid property requested: "<<property;
return;
}
request.zoneFilter = zone;
request.completed = [socket,id,property](AsyncPropertyReply* reply)
{
DebugOut()<<"Got property: "<<reply->property.c_str()<<endl;
if(!reply->success || !reply->value)
{
DebugOut()<<"Property value is null"<<endl;
delete reply;
return;
}
QVariantMap data;
data["property"] = property.c_str();
data["zone"] = reply->value->zone;
data["value"] = reply->value->toString().c_str();
data["timestamp"] = reply->value->timestamp;
data["sequence"] = reply->value->sequence;
QVariantMap replyvar;
replyvar["type"]="methodReply";
replyvar["name"]="get";
replyvar["data"]= data;
replyvar["transactionid"]=id.c_str();
QByteArray replystr;
if(doBinary)
replystr = QJsonDocument::fromVariant(replyvar).toBinaryData();
else
{
replystr = QJsonDocument::fromVariant(replyvar).toJson();
cleanJson(replystr);
}
lwsWrite(socket, replystr, replystr.length());
delete reply;
};
AsyncPropertyReply* reply = routingEngine->getPropertyAsync(request);
}