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


C++ DebugOut函数代码示例

本文整理汇总了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();
}
开发者ID:MCherifiOSS,项目名称:automotive-message-broker,代码行数:27,代码来源:test.cpp

示例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;
};
开发者ID:bitkid83,项目名称:TinyCap,代码行数:26,代码来源:textureshader.cpp

示例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);
}
开发者ID:timkoma,项目名称:automotive-message-broker,代码行数:34,代码来源:testplugin.cpp

示例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;
}
开发者ID:asokang,项目名称:automotive-message-broker,代码行数:30,代码来源:websocketsinkmanager.cpp

示例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 ) ;
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:26,代码来源:CmdAlphaWeightModulate.cpp

示例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);
}
开发者ID:timkoma,项目名称:automotive-message-broker,代码行数:29,代码来源:obd2source.cpp

示例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);
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:7,代码来源:matrix34.cpp

示例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;
            }
        }
    }
开发者ID:rezanour,项目名称:randomoldstuff,代码行数:26,代码来源:SimpleAction.cpp

示例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();
}
开发者ID:fredcadete,项目名称:automotive-message-broker,代码行数:28,代码来源:testProtocolClient.cpp

示例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--;
		}
	}
}
开发者ID:toxicgumbo,项目名称:automotive-message-broker,代码行数:29,代码来源:websocketsinkmanager.cpp

示例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);
            }
        }
    }
开发者ID:ZephyrSurfer,项目名称:sanear,代码行数:25,代码来源:DspTempo.cpp

示例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;
}
开发者ID:VMXh,项目名称:DevAclSrv,代码行数:28,代码来源:service.cpp

示例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);
}
开发者ID:redheadedrod,项目名称:automotive-message-broker,代码行数:59,代码来源:automotivemanager.cpp

示例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;
}
开发者ID:CCJY,项目名称:coliru,代码行数:8,代码来源:main.cpp

示例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);
}
开发者ID:asokang,项目名称:automotive-message-broker,代码行数:56,代码来源:websocketsinkmanager.cpp


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