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


C++ LDEBUG函数代码示例

本文整理汇总了C++中LDEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ LDEBUG函数的具体用法?C++ LDEBUG怎么用?C++ LDEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LDEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: JEVOIS_TRACE

// ##############################################################################################################
void jevois::Gadget::streamOff()
{
  JEVOIS_TRACE(2);
  
  // Note: we allow for several streamOff() without complaining, this happens, e.g., when destroying a Gadget that is
  // not currently streaming.

  LDEBUG("Turning off gadget stream");

  // Abort stream in case it was not already done, which will introduce some sleeping in our run() thread, thereby
  // helping us acquire our needed double lock:
  abortStream();

  JEVOIS_TIMED_LOCK(itsMtx);

  // Stop streaming over the USB link:
  int type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
  try { XIOCTL_QUIET(itsFd, VIDIOC_STREAMOFF, &type); } catch (...) { }
  
  // Nuke all our buffers:
  if (itsBuffers) { delete itsBuffers; itsBuffers = nullptr; }
  itsImageQueue.clear();
  itsDoneImgs.clear();

  LDEBUG("Gadget stream is off");
}
开发者ID:Dennis-Wijngaarden,项目名称:jevois,代码行数:27,代码来源:Gadget.C

示例2: w_check_rtcp_ipport

int w_check_rtcp_ipport(msg_t *msg)
{

	int i = 0;
	miprtcp_t *mp = NULL;
	char ipptmp[256];
	char callid[256];


	snprintf(callid, sizeof(callid), "%.*s", msg->sip.callId.len, msg->sip.callId.s);

	for (i = 0; i < msg->sip.mrp_size; i++) {
		mp = &msg->sip.mrp[i];

		if (mp->rtcp_ip.len > 0 && mp->rtcp_ip.s) {
			snprintf(ipptmp, sizeof(ipptmp), "%.*s:%d", mp->rtcp_ip.len, mp->rtcp_ip.s, mp->rtcp_port);			
			LDEBUG("RTCP CALLID: %.*s", msg->sip.callId.len, msg->sip.callId.s);
			LDEBUG("RTCP IP PORT: %s", ipptmp);

			/* one pair = one timer */
			if(!find_and_update(ipptmp, callid))			
			{
			       add_timer(ipptmp);			
                               add_ipport(ipptmp, callid);
                        }
		}
	}

	return 1;
}
开发者ID:aphistic,项目名称:captagent,代码行数:30,代码来源:database_hash.c

示例3: reader

void VolumeSeriesSource::openSeries() {
    if(volumeHandle_)
        delete volumeHandle_;
    volumeHandle_ = 0;

    try {
        TextFileReader reader(filename_.get());
        if (!reader)
            throw tgt::FileNotFoundException("Reading sdat file failed", filename_.get());

        std::string type;
        std::istringstream args;
        std::string format, model;
        tgt::ivec3 resolution(0);
        tgt::vec3 sliceThickness(1.f);
        spreadMin_ = 0.f;
        spreadMax_ = 0.f;

        files_.clear();
        std::string blockfile;

        while (reader.getNextLine(type, args, false)) {
            if (type == "ObjectFileName:") {
                std::string s;
                args >> s;
                LDEBUG(type << " " << s);
                files_.push_back(tgt::FileSystem::dirName(filename_.get()) + "/" + s);
            } else if (type == "Resolution:") {
                args >> resolution[0];
                args >> resolution[1];
                args >> resolution[2];
                LDEBUG(type << " " << resolution[0] << " x " <<
                       resolution[1] << " x " << resolution[2]);
            } else if (type == "SliceThickness:") {
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:34,代码来源:volumeseriessource.cpp

示例4: LERR

static uint8_t *extract_from_m2pa(msg_t *msg, size_t *len)
{
	uint8_t *data;
	uint32_t data_len;

	if (msg->len < 8) {
		LERR("M2PA hdr too short %u", msg->len);
		return NULL;
	}
	data = msg->data;

	/* check the header */
	if (data[0] != 0x01) {
		LERR("M2PA unknown version number %d", data[0]);
		return NULL;
	}
	if (data[1] != 0x00) {
		LERR("M2PA unknown reserved fields %d", data[1]);
		return NULL;
	}
	if (data[2] != M2PA_CLASS) {
		LDEBUG("M2PA unhandled message class %d", data[2]);
		return NULL;
	}
	if (data[3] != M2PA_DATA) {
		LDEBUG("M2PA not data msg but %d", data[3]);
		return NULL;
	}

	/* check the length */
	memcpy(&data_len, &data[4], sizeof(data_len));
	data_len = ntohl(data_len);
	if (msg->len < data_len) {
		LERR("M2PA data can't fit %u vs. %u", msg->len, data_len);
		return NULL;
	}

	/* skip the header */
	data += 8;
	data_len -= 8;

	/* BSN, FSN and then priority */
	if (data_len < 8) {
		LERR("M2PA no space for BSN/FSN %u\n", data_len);
		return NULL;
	}
	data += 8;
	data_len -= 8;
	if (data_len == 0)
		return NULL;
	else if (data_len < 1) {
		LERR("M2PA no space for prio %u\n", data_len);
		return NULL;
	}
	data += 1;
	data_len -= 1;

	*len = data_len;
	return data;
}
开发者ID:SipSeb,项目名称:captagent,代码行数:60,代码来源:protocol_ss7.c

示例5: instantiatePatternsHash

 void instantiatePatternsHash ( Data& d ) {
   d.hpinstances.clear();
   LINFO ( "maxspan_=" << maxspan_ << ",gapmaxspan=" << gapmaxspan_ );
   std::vector<std::string> ss;
   boost::algorithm::split ( ss, d.sentence, boost::algorithm::is_any_of ( " " ) );
   const std::unordered_set<std::string>& patterns = d.grammar->patterns;
   for ( std::unordered_set<std::string>::const_iterator itx = patterns.begin();
         itx != patterns.end(); ++itx ) { /// for each grammar-specific pattern.
     LDEBUG ( "pattern:" << *itx );
     std::vector<std::string> spattern;
     boost::algorithm::split ( spattern, *itx, boost::algorithm::is_any_of ( "_" ) );
     for ( unsigned j = 0; j < ss.size(); ++j ) { // for each word in the sentence
       std::vector< std::vector<std::string> > pinstances;
       LDEBUG ( "starting word:" << ss[j] );
       //Map each pattern into words.
       //If there are gaps, then expand them from 1 to given threshold gapmaxspan
       if ( spattern.size() <= maxspan_ && j + spattern.size() - 1 < ss.size() ) {
         std::vector<std::string> empty;
         pinstances.push_back ( empty ); //add empty one.
         //Create all instances that apply to this particular pattern.
         buildNextElementFromPattern ( spattern, ss, pinstances, j, 0 );
       }
       for ( unsigned k = 0; k < pinstances.size(); ++k )  {
         LDEBUG ( "pattern:" << *itx << ":" << "Inserting in " <<
                  boost::algorithm::join ( pinstances[k],
                                           "_" ) << "values=(" << j << "," << spattern.size() - 1 );
         d.hpinstances[boost::algorithm::join ( pinstances[k],
                                                "_" )].push_back ( std::pair<unsigned, unsigned> ( j, spattern.size() - 1 ) );
       }
     }
   }
 }
开发者ID:ucam-smt,项目名称:ucam-smt,代码行数:32,代码来源:task.patternstoinstances.hpp

示例6: run

  /**
   * \brief Method inherited from ucam::util::TaskInterface. Loads the language model and stores in lm data structure.
   * \param &d: data structure in which the null filter is to be stored.
   * \returns false (does not break the chain of tasks)
   */
  bool run ( Data& d ) {
    mylmfst_.DeleteStates();
    if ( !USER_CHECK ( d.klm.size() ,
                       "No language models available" ) ) return true;
    if ( !USER_CHECK ( d.klm.find ( lmkey_ ) != d.klm.end() ,
                       "No language models available (key not initialized) " ) ) return true;
    if ( !USER_CHECK ( d.fsts.find ( latticeloadkey_ ) != d.fsts.end() ,
                       " Input fst not available!" ) ) return true;
    mylmfst_ = * (static_cast<fst::VectorFst<Arc> * > ( d.fsts[latticeloadkey_] ) );
    if (deletelmscores_) {
      LINFO ( "Delete old LM scores first" );
      //Deletes LM scores if using lexstdarc. Note -- will copy through on stdarc!
      fst::MakeWeight2<Arc> mwcopy;
      fst::Map<Arc> ( &mylmfst_,
                      fst::GenericWeightAutoMapper<Arc, fst::MakeWeight2<Arc> > ( mwcopy ) );
    }
    LINFO ( "Input lattice loaded with key=" << latticeloadkey_ << ", NS=" <<
            mylmfst_.NumStates() );
    fst::MakeWeight<Arc> mw;
    for ( uint k = 0; k < d.klm[lmkey_].size(); ++k ) {
      if ( !USER_CHECK ( d.klm[lmkey_][k]->model != NULL,
                         "Language model " << k << " not available!" ) ) return true;
      KenLMModelT& model = *d.klm[lmkey_][k]->model;
#ifndef USE_GOOGLE_SPARSE_HASH
      unordered_set<Label> epsilons;
#else
      google::dense_hash_set<Label> epsilons;
      epsilons.set_empty_key ( numeric_limits<Label>::max() );
#endif
      ///We want the language model to ignore these guys:
      epsilons.insert ( DR );
      epsilons.insert ( OOV );
      epsilons.insert ( EPSILON );
      epsilons.insert ( SEP );
      LINFO ( "Applying language model " << k
              << " with lmkey=" << lmkey_
              << ", using lmscale=" << d.klm[lmkey_][k]->lmscale );
      LDEBUG ( "lattice NS=" << mylmfst_.NumStates() );
      fst::ApplyLanguageModelOnTheFly<Arc, fst::MakeWeight<Arc>, KenLMModelT> *f
        = new fst::ApplyLanguageModelOnTheFly<Arc, fst::MakeWeight<Arc>, KenLMModelT >
      ( mylmfst_
        , model
        , epsilons
        , natlog_
        , d.klm[lmkey_][k]->lmscale
        , d.klm[lmkey_][k]->lmwp
        , d.klm[lmkey_][k]->idb);
      f->setMakeWeight ( mw );
      d.stats->setTimeStart ( "on-the-fly-composition " +  ucam::util::toString (
                                k ) );
      mylmfst_ = * ( ( *f ) () );
      delete f;
      d.stats->setTimeEnd ( "on-the-fly-composition " + ucam::util::toString ( k ) );
      LDEBUG ( mylmfst_.NumStates() );
      mw.update();
    }
    d.fsts[latticestorekey_] = &mylmfst_;
    LINFO ( "Done!" );
    return false;
  };
开发者ID:Libardo1,项目名称:ucam-smt,代码行数:65,代码来源:task.applylm.hpp

示例7: w_parse_rtcp_to_json

int w_parse_rtcp_to_json(msg_t *_m)
{
	  int json_len;
	  char *json_rtcp_buffer;

	  _m->mfree = 0;
	  json_rtcp_buffer = malloc(JSON_BUFFER_LEN);	  
	  json_rtcp_buffer[0] = '\0';
	  
	  if((json_len = capt_parse_rtcp((char *)_m->data, _m->len, json_rtcp_buffer, JSON_BUFFER_LEN)) > 0) {
	      _m->rcinfo.proto_type = rtcp_proto_type;
	      _m->data = json_rtcp_buffer;
	      _m->len = json_len;
	      _m->mfree = 1;
	  }
	  else {
	    	LDEBUG("GOODBYE or APP MESSAGE. Ignore!\n");
	    	if(json_rtcp_buffer) free(json_rtcp_buffer);
	    	if(_m->corrdata) 
	    	{
	    	      free(_m->corrdata);
	    	      _m->corrdata = NULL;
                }
	      	return -1;
	  }

	  LDEBUG("JSON RTCP %s\n", json_rtcp_buffer);

	  return 1;
}
开发者ID:mslehto,项目名称:captagent,代码行数:30,代码来源:protocol_rtcp.c

示例8: main

int main(int argc, char **argv)
{
	int maxsock,sockfd,sock_auth;
	unsigned int myport,listnum;
	fd_set fdsr;
	struct timeval tv;
	char *url = "OK OK";
	int ret;
	
	myport = DEF_LISTEN_PORT;
	// listnum = 10;
	listnum = SOMAXCONN;
	if(argc > 1)
	{
		myport = atoi(argv[1]);
	}
	
	if(myport <= 0 )
	{
		printf("%s invalid paramters!\n",argv[0]);
		return 0;
	}
	
	sockfd = create_server_socket(myport,listnum);
	if(sockfd == -1)
	{
		return 0;
	}
	maxsock = sockfd;

	LDEBUG("%s start to listen\n",argv[0]);

	while(1)
	{
		//init file desc set
		FD_ZERO(&fdsr);
		FD_SET(sockfd, &fdsr);
		// timeout setting
		tv.tv_sec = 30;
		tv.tv_usec = 0;
		
		ret = select(maxsock + 1, &fdsr, NULL, NULL, &tv);
		if(ret < 0)
		{
			printf("select error");
			break;
		}
		else if(ret == 0) 
		{
			LDEBUG("timeout\n");
			continue;
		}

 		if(FD_ISSET(sockfd, &fdsr))
 		{
 			handleRequest(sockfd,url);
 		}
	}
	return 0;
}
开发者ID:finove,项目名称:testCode,代码行数:60,代码来源:tcpd.c

示例9: LDEBUG

	Json::Value DotNetClient::sendRequest(std::string url) {

		//TODO remove log lines
		LDEBUG("Camera") << "sendRequest: " << url << LE;

		std::string sendUrl = params.query + url;

		LDEBUG("Camera") << "sendRequest full: " << sendUrl << LE;

		std::cout << "query " << sendUrl << std::endl;

		Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, sendUrl);
		request.setContentType("application/json");
		request.set("charsets:", "utf-8");
		request.setContentLength(0); //(int) message.length()
		client->sendRequest(request);
		Poco::Net::HTTPResponse response;
		std::istream& rs = client->receiveResponse(response);
		std::stringstream outstr;
		Poco::StreamCopier::copyStream(rs, outstr);
		std::string rawOutput = outstr.str();
		std::cout << "response " << rawOutput << std::endl;
		LDEBUG("Camera") << "resposne raw: " << rawOutput << LE;
		Json::Value ov;
		Json::Reader r;
		r.parse(rawOutput, ov);

		//LDEBUG("Camera") << "parsed: " << ov << LE;

		return ov;
	}
开发者ID:hadzim,项目名称:bb,代码行数:31,代码来源:DotNetClient.cpp

示例10: LDEBUG

void CacheManager::cleanDirectory(const Directory& dir) const {
    LDEBUG("Cleaning directory '" << dir << "'");
    // First search for all subdirectories and call this function recursively on them
	std::vector<std::string> contents = dir.readDirectories();
	for (const auto& content : contents) {
        if (FileSys.directoryExists(content)) {
			cleanDirectory(content);
        }
	}
    // We get to this point in the recursion if either all subdirectories have been
    // deleted or there exists a file somewhere in the directory tree

	contents = dir.read();
    bool isEmpty = contents.empty();
#ifdef __APPLE__
    // Apple stores the .DS_Store directory in the directory which can be removed
    std::string dsStore = FileSys.pathByAppendingComponent(dir, ".DS_Store");
    isEmpty |= ((contents.size() == 1) && contents[0] == dsStore);
#endif
    // If this directory is empty, we can delete it
    if (isEmpty) {
        LDEBUG("Deleting directory '" << dir << "'");
		FileSys.deleteDirectory(dir);
    }
}
开发者ID:forsythrosin,项目名称:Ghoul,代码行数:25,代码来源:cachemanager.cpp

示例11: getVideoFileInfoFromFilename

VideoFileInfo getVideoFileInfoFromFilename(const std::string& fname)
{
    VideoFileInfo result;

    std::string base;
    std::string ext = nodotExtension(fname, &base);

    LDEBUG("ext is %s", ext.c_str());

    if (ext.compare("gz") == 0)
    {
        ext = nodotExtension(base, &base);
        LDEBUG("new ext is %s", ext.c_str());
        result.ctype = COMP_GZIP;
    }
    else if (ext.compare("bz2") == 0)
    {
        ext = nodotExtension(base, &base);
        LDEBUG("new ext is %s", ext.c_str());
        result.ctype = COMP_BZIP2;
    }
    else
    {
        result.ctype = COMP_NONE;
    }

    const std::string dimsstr = nodotExtension(base);

    LDEBUG("dimsstr is '%s'", dimsstr.c_str());

    if (dimsstr.size() == 0)
    {
        LERROR("no <width>x<height> specification found in '%s'; "
               "assuming default dims of %dx%d instead",
               fname.c_str(), defaultDims.w(), defaultDims.h());
        result.dims = defaultDims;

        // we didn't get explicit dims, so let's be picky about the
        // file size matching the defaultDims (--yuv-dims), unless the
        // user also requests loose matching (--yuv-dims-loose)
        result.beStrict = strictLength;
    }
    else
    {
        result.dims = fromStr<Dims>(dimsstr);
        LDEBUG("parsed dims as %dx%d",
               result.dims.w(), result.dims.h());

        // OK, the user gave us some explicit dims, so let's not be
        // picky about whether the file size matches the
        // dims+pixformat
        result.beStrict = false;
    }

    result.format = fromStr<VideoFormat>(ext);

    return result;
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:58,代码来源:YuvParser.C

示例12: LDEBUG

	void BioRadar::GoRelBase(const double & speed) {
		if (speed == 0) {
			LDEBUG("HAL")<< "BioRadar antena stop" << LE;
				baseExecution.addTask(baseMotorModule.taskStop());
			} else {
				LDEBUG("HAL")<< "BioRadar antena goRel: " << speed << " by " << maxRelDurationTimeInMs << LE;
				baseExecution.addTask(baseMotorModule.taskGoRel(speed, maxRelDurationTimeInMs));
			}
		}
开发者ID:hadzim,项目名称:fit-mbot,代码行数:9,代码来源:BioRadar.cpp

示例13: internalGoRel

static void internalGoRel(TBS::Task::OneActiveTaskExectution & execution,
		MBot::CameraMotorModule & module, double speed, int maxDuration) {
	if (speed == 0) {
		LDEBUG("HAL")<< "Camera motor stop" << LE;
			execution.addTask(module.taskStop());
		} else {
			LDEBUG("HAL")<< "Camera motor goRel: " << speed << " by " << maxDuration << LE;
			execution.addTask(module.taskGoRel(speed, maxDuration));
		}
	}
开发者ID:hadzim,项目名称:fit-mbot,代码行数:10,代码来源:Camera.cpp

示例14: findPrimaryDevicesKey

DWORD GpuCapabilitiesWindows::readVRAMSizeFromReg() {
    DWORD memSize = 0;
    char* devicesKey = findPrimaryDevicesKey();
    if ( devicesKey == 0 ) {
        LERROR("Failed to determine primary graphics adapter by calling findPrimaryDevicesKey()!");
        return 0;
    }

    for ( size_t i = 0; i < strlen(devicesKey); i++ )
        devicesKey[i] = tolower(devicesKey[i]);

    char* substr = strstr(devicesKey, "\\registry\\machine\\");
    if ( substr != 0 )
        substr += strlen("\\registry\\machine\\");
    else
        substr = devicesKey;
    LDEBUG("registry key: " << substr);

    HKEY hKey = NULL;
    LONG stat = RegOpenKeyEx(HKEY_LOCAL_MACHINE, substr, 0, KEY_READ, &hKey);
    if ( stat == ERROR_SUCCESS ) {
        DWORD type = 0;
        DWORD bufferSize = 4;
        char* data = new char[bufferSize + 1];
        memset(data, 0, bufferSize + 1);
        stat = RegQueryValueEx(hKey, "HardwareInformation.MemorySize",
            NULL, &type, (BYTE*) data, &bufferSize);
        if ((stat == ERROR_SUCCESS) && ((type == REG_BINARY) ||
            (getOSVersion() == GpuCapabilities::OS_WIN_VISTA && type == REG_DWORD)))
        {
            LDEBUG("read " << bufferSize << " BYTES from key 'HardwareInformation.MemorySize'...");
            for ( DWORD i = (bufferSize - 1); ; i-- ) {
                LDEBUG("data[" << i << "]: " << static_cast<DWORD>(data[i]));
                memSize |= (data[i] << (i * 8));

                // As DWORD is unsigned, the loop would never exit if
                // it would not be broken...
                //
                if ( i == 0 )
                    break;
             }
             LDEBUG("data converted to " << memSize << " (means " << (memSize / (1024 * 1024)) << " MByte)\n");
        }
        RegCloseKey(hKey);
        hKey = NULL;
        delete [] data;
        data = 0;
    }
    else
        LERROR("Error opening key " << substr << ". Reason: " << stat);

    delete [] devicesKey;
    devicesKey = 0;
    return memSize;
}
开发者ID:tusharuiit,项目名称:2014-2015_HiwiMedicalXTTVisualization,代码行数:55,代码来源:gpucapabilitieswindows.cpp

示例15: LDEBUG

	void Parameters::resetParameters(const int argc, char * argv[])
	{
		std::vector<std::string> m_temp;
		LDEBUG("Parsing parameters...");
		LDEBUG("Number of parameters: "<<argc);
		for (int i(0); i < argc; ++i) {
			m_temp.emplace_back(argv[i]);
			LDEBUG("Parameter: " << argv[i]);
		}
		_resetParameters(std::move(m_temp));
	}
开发者ID:LeDYoM,项目名称:sgh,代码行数:11,代码来源:parameters.cpp


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