• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LFATAL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: resolveproto

int resolveproto(const char *proto)
{
    struct protoent *protocol;
    protocol = getprotobyname(proto);
    if (!protocol) {
        LFATAL("resolveproto : getprotobyname failed for %s", proto);
        return -1;
    }

    return protocol->p_proto;
}
开发者ID:chineseneo,项目名称:lessfs,代码行数:11,代码来源:lib_net.c


示例2: loadDictionaryFromString

bool loadDictionaryFromString(
    const std::string& script,
    ghoul::Dictionary& dictionary,
    lua_State* state
    )
{
    const static std::string _loggerCat = "lua_loadDictionaryFromString";

    if (state == nullptr) {
        if (_state == nullptr) {
            LDEBUG("Creating Lua state");
            _state = luaL_newstate();
            if (_state == nullptr) {
                LFATAL("Error creating new Lua state: Memory allocation error");
                return false;
            }
            LDEBUG("Open libraries");
            luaL_openlibs(_state);
        }
        state = _state;
    }

    LDEBUG("Loading dictionary script '" << script.substr(0, 12) << "[...]'");
    int status = luaL_loadstring(state, script.c_str());
    if (status != LUA_OK) {
        LERROR("Error loading script: '" << lua_tostring(state, -1) << "'");
        return false;
    }

    LDEBUG("Executing script");
    if (lua_pcall(state, 0, LUA_MULTRET, 0)) {
        LERROR("Error executing script: " << lua_tostring(state, -1));
        return false;
    }

    if (lua_isnil(state, -1)) {
        LERROR("Error in script: '" << script.substr(0, 12)
                                    << "[...]'. Script did not return anything.");
        return false;
    }

    if (!lua_istable(state, -1)) {
        LERROR("Error in script: '" << script.substr(0, 12)
                                    << "[...]'. Script did not return a table.");
        return false;
    }

    luaDictionaryFromState(state, dictionary);

    // Clean up after ourselves by cleaning the stack
    lua_settop(state, 0);

    return true;
}
开发者ID:forsythrosin,项目名称:Ghoul,代码行数:54,代码来源:lua_helper.cpp


示例3: convertToString

// ######################################################################
std::string convertToString(const MapCombineType typ)
{
  switch (typ)
    {
    case MAPCOMBINE_SUM: return "Sum"; break;
    case MAPCOMBINE_MAX: return "Max"; break;
    }

  LFATAL("invalid MapCombineType '%d'", int(typ));
  /* can't happen */ return std::string();
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:12,代码来源:MapCombineType.C


示例4: SingleChannel

ForegroundDetectionChannel::ForegroundDetectionChannel(OptionManager& mgr) :
  SingleChannel(mgr, "ForegroundDetectionChannel", "ForegroundDetectionChannel", FOREGROUND, rutz::shared_ptr<PyrBuilder<float> >()),
  itsMap(),
  itsLevelSpec(&OPT_LevelSpec, this)
{
#ifdef HAVE_OPENCV
  itsStatModel_cv = NULL;
#else
  LFATAL("OpenCV is needed for Foreground Detection Channel!");
#endif
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:11,代码来源:ForegroundDetectionChannel.C


示例5: LFATAL

// ######################################################################
Dims ForegroundDetectionChannel::getMapDims() const
{
  if (!this->hasInput())
    LFATAL("Oops! I haven't received any input yet");

  const Dims indims = this->getInputDims();

  return Dims(indims.w() >> itsLevelSpec.getVal().mapLevel(),
              indims.h() >> itsLevelSpec.getVal().mapLevel());

}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:12,代码来源:ForegroundDetectionChannel.C


示例6: LFATAL

// ######################################################################
void QuickTimeGrabber::start1()
{
  FrameIstream::start1();

#ifndef HAVE_QUICKTIME_QUICKTIME_H
  LFATAL("you must have QuickTime installed to use QuickTimeGrabber");
#else
  ASSERT(rep == 0);
  rep = new Impl(itsDims.getVal());
#endif
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:12,代码来源:QuickTimeGrabber.C


示例7: LFATAL

bool CLCommandQueue::initialize(cl_context context, cl_device_id device) {
    int err = 0;
    _commands = std::make_shared<cl_command_queue>(clCreateCommandQueue(context, device, 0, &err));
    
    if (err != CL_SUCCESS) {
        LFATAL("Could not create program queue: " << getErrorString(err));
        _commands = 0;
        return false;
    }
    return true;
}
开发者ID:waschkbaer,项目名称:BrainVis,代码行数:11,代码来源:clcommandqueue.cpp


示例8: clEnqueueReleaseGLObjects

cl_event CLCommandQueue::enqueueReleaseGLObjects(std::vector<cl_mem> glObjects) {
	int err = 0;
	cl_event event = 0;

	if (glObjects.size() > 0) {
		err = clEnqueueReleaseGLObjects(*_commands, glObjects.size(), &glObjects[0], 0, NULL, &event);
		if (err != 0) {
			LFATAL("Could not aquire GL object: " << getErrorString(err));
		}
	}
	return event;
}
开发者ID:waschkbaer,项目名称:BrainVis,代码行数:12,代码来源:clcommandqueue.cpp


示例9: socketaddr_host

int socketaddr_host(struct sockaddr_in *socketaddr, const char *host)
{
    struct hostent *hostaddr;
    hostaddr = gethostbyname(host);
    if (!hostaddr) {
        LFATAL("socketaddr_host: gethostbyname failed for %s", host);
        return -1;
    }

    memcpy(&socketaddr->sin_addr, hostaddr->h_addr, hostaddr->h_length);
    return 0;
}
开发者ID:chineseneo,项目名称:lessfs,代码行数:12,代码来源:lib_net.c


示例10: if

// ######################################################################
void DirectFeedChannel::doInput(const InputFrame& inframe)
{
  if (inframe.grayFloat().initialized()) LINFO("using bwimg");
  else if (inframe.colorFloat().initialized()) LINFO("using colimg");
  else LFATAL("Need to have either colimg or bwimg as input!");

  itsInputTime = inframe.time();

  LDEBUG("itsInputTime: %fms", itsInputTime.msecs());

  if (itsInputTime != itsPyrTime)
    LFATAL("I don't have any direct-feed input for time=%fms "
           "(last input was at time=%fms)",
           itsInputTime.msecs(), itsPyrTime.msecs());

  const float fac = pow(0.5f,float(itsMapLevel.getVal()));
  itsMapDims = Dims(int(this->getInputDims().w()*fac),
                    int(this->getInputDims().h()*fac));
  LDEBUG("itsMapDims = %s; itsInputDims = %s",toStr(itsMapDims).c_str(),
        toStr(this->getInputDims()).c_str());
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:22,代码来源:DirectFeedChannel.C


示例11: LFATAL

void NeuralSimModule<T>::update(const SimTime& time)
{
  //reset module if its currently not valid
  if (!itsStructure.is_valid())
    LFATAL("The module must recieve input before it updated.");
  
  for (uint ii = 0; ii < itsInput.size(); ++ii)
    if (itsInput.getImage(ii).initialized())
      itsStructure->input(itsInput.getImage(ii)*itsInputGain[ii], ii - 1); 
  
  itsStructure->evolve(time);
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:12,代码来源:NeuralSimModule.C


示例12: switch

// ######################################################################
Rectangle BitObject::getBoundingBox(const BitObject::Coords coords) const
{
  switch(coords)
    {
    case OBJECT: return Rectangle::tlbrI(0, 0, itsBoundingBox.height() - 1,
                                  itsBoundingBox.width() - 1);
    case IMAGE: return itsBoundingBox;
    default: LFATAL("Unknown Coords type - don't know what to do.");
    }
  //this is never reached but we have to make the compiler happy
  return Rectangle();
}
开发者ID:binary42,项目名称:avedac,代码行数:13,代码来源:BitObject.C


示例13: LFATAL

// ######################################################################
void EyeTrackerEyeLink::setBackgroundColor(nub::soft_ref<PsychoDisplay> d)
{
#ifndef HAVE_EYELINK
  LFATAL("Proprietary EyeLink developer API not installed");
#else
	SDL_Color bgcolor = { d->getGrey().red(), d->getGrey().green(), d->getGrey().blue()};
	SDL_Color fgcolor = { 192, 192, 192};
	
	set_calibration_colors(&fgcolor, &bgcolor);
	LINFO("RGB: %i %i %i", d->getGrey().red(), d->getGrey().green(), d->getGrey().blue());
#endif
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:13,代码来源:EyeTrackerEyeLink.C


示例14: getPCAMatrix

// ######################################################################
void TaskRelevanceMapGistClassify::
getPCAMatrix()
{
  FILE* itsFile = fopen(itsPCAMatrixName.getVal().c_str(), "rb");
  ASSERT(itsFile != 0);

  int gistDims = 0;
  if(fread(&gistDims, sizeof(int), 1, itsFile) != 1) LFATAL("fread failed");

  Image<float> matrixTmp(gistDims, itsPCADims.getVal(), NO_INIT);
  size_t sz = itsPCADims.getVal()*gistDims;
  if(fread(matrixTmp.beginw(), sizeof(float), sz, itsFile) != sz) LFATAL("fread failed"); 

  itsPCAMatrix = transpose(matrixTmp);

  LDEBUG("itsPCAMatrix first 5 num: %f, %f, %f, %f, %f", itsPCAMatrix.getVal(0,0),
        itsPCAMatrix.getVal(1,0), itsPCAMatrix.getVal(2,0),
        itsPCAMatrix.getVal(3,0), itsPCAMatrix.getVal(4,0));

  fclose(itsFile);
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:22,代码来源:TaskRelevanceMap.C


示例15: paramChanged

// ######################################################################
void SaccadeControllerEyeConfigurator::
paramChanged(ModelParamBase* const param,
             const bool valueChanged,
             ParamClient::ChangeStatus* status)
{
  ModelComponent::paramChanged(param, valueChanged, status);

  // was that a change of our baby's name?
  if (param == &itsSacCtrlType) {
    // if we had one, let's unregister it (when we later reset() the
    // nub::ref, the current SaccadeController will unexport its
    // command-line options):
    removeSubComponent(*itsSC);

    // instantiate a controller of the appropriate type:
    if (itsSacCtrlType.getVal().compare("None") == 0 ||
        itsSacCtrlType.getVal().compare("Stub") == 0)
      itsSC.reset(new StubSaccadeController(getManager(),
                                            SaccadeBodyPartEye));
    else if (itsSacCtrlType.getVal().compare("Trivial") == 0)
      itsSC.reset(new TrivialSaccadeController(getManager(),
                                               SaccadeBodyPartEye));
    else if (itsSacCtrlType.getVal().compare("Fixed") == 0)
      itsSC.reset(new FixedSaccadeController(getManager(),
                                             SaccadeBodyPartEye));
    else if (itsSacCtrlType.getVal().compare("Friction") == 0)
      itsSC.reset(new FrictionSaccadeController(getManager(),
                                                SaccadeBodyPartEye));
    else if (itsSacCtrlType.getVal().compare("Threshold") == 0)
      itsSC.reset(new ThresholdSaccadeController(getManager(),
                                                 SaccadeBodyPartEye));
    else if (itsSacCtrlType.getVal().compare("Threshfric") == 0)
      itsSC.reset(new ThresholdFrictionSaccadeController(getManager(),
                                                         SaccadeBodyPartEye));
    else
      LFATAL("Unknown eye SaccadeController type %s",
             itsSacCtrlType.getVal().c_str());

    // add our baby as a subcomponent of us so that it will become
    // linked to the manager through us (hopefully we are registered
    // with the manager), which in turn will allow it to export its
    // command-line options and get configured:

    addSubComponent(itsSC);

    // tell the controller to export its options:
    itsSC->exportOptions(MC_RECURSE);

    // some info message:
    LINFO("Selected Eye SC of type %s", itsSacCtrlType.getVal().c_str());
  }
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:53,代码来源:SaccadeControllerConfigurator.C


示例16: pthread_mutex_lock

compr *lzo_decompress(unsigned char *buf, int buflen)
{
    int r;
    lzo_bytep in;
    lzo_bytep out;
    lzo_bytep wrkmem;
    lzo_uint out_len = 0;
    lzo_uint in_len = 0;
    compr *retdata;

    FUNC;

    pthread_mutex_lock(&lzo_mutex);
    retdata = s_malloc(sizeof(compr));
 
    in_len = buflen-1;
    in = (lzo_bytep) &buf[1];
    out = (lzo_bytep) lzo_malloc(BLKSIZE);
    wrkmem = (lzo_bytep) lzo_malloc(LZO1A_MEM_COMPRESS);        //FASTER
    if (in == NULL || out == NULL || wrkmem == NULL) {
        LFATAL("out of memory\n");
        exit(3);
    }

    r = lzo1a_decompress(in, in_len, out, &out_len, NULL);
    if (r != LZO_E_OK) {
        /* this should NEVER happen */
        LFATAL("internal error - decompression failed: %d\n", r);
        exit(22);
    }

    retdata->data = s_malloc(out_len);
    retdata->size = out_len;
    memcpy(retdata->data, out, out_len);
    lzo_free(wrkmem);
    lzo_free(out);
    pthread_mutex_unlock(&lzo_mutex);
    return retdata;
}
开发者ID:crass,项目名称:lessfs,代码行数:39,代码来源:lib_lzo.c


示例17: fopen

// ######################################################################
void BeoWebServer::writeToLogFile(std::string line)
{
    its_logFilename_mutex.lock();
    FILE *rFile = fopen(itsLogFilename.c_str(), "at");
    if (rFile != NULL)
    {
        fputs(line.c_str(), rFile);
        fclose (rFile);
    }
    else LFATAL("can't append to file: %s", itsLogFilename.c_str());

    its_logFilename_mutex.unlock();
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:14,代码来源:BeoWebServer.C


示例18: createNewLuaState

lua_State* createNewLuaState() {
    const std::string _loggerCat = "createNewLuaState";
    lua_State* s;
    LDEBUG("Creating Lua state");
    s = luaL_newstate();
    if (s == nullptr) {
        LFATAL("Error creating new Lua state: Memory allocation error");
        return nullptr;
    }
    LDEBUG("Open libraries");
    luaL_openlibs(s);
    return s;
}
开发者ID:forsythrosin,项目名称:Ghoul,代码行数:13,代码来源:lua_helper.cpp


示例19: printf

//// ######################################################################
bool Bayes::load(const char *filename)
{
  int fd;

  if ((fd = open(filename, 0644)) == -1) {
    printf("Can not open %s for reading\n", filename);
    return false;
  }

  itsNumClasses = 0;
  itsNumFeatures = 0;
  //read the #  Features and Classes
  if(read(fd, &itsNumFeatures, sizeof(uint)) != sizeof(uint)) LFATAL("Failed to read from: %s", filename);
  if(read(fd, &itsNumClasses, sizeof(uint)) != sizeof(uint)) LFATAL("Failed to read from: %s", filename);

  //read the class freq
  itsClassFreq.clear();
  itsClassFreq.resize(itsNumClasses);
  itsClassNames.resize(itsNumClasses);

  for(uint i=0; i<itsNumClasses; i++)
  {
    if(read(fd, &itsClassFreq[i], sizeof(uint64)) != sizeof(uint64)) LFATAL("Failed to read from: %s", filename);

    uint clsNameLength;
    if(read(fd, &clsNameLength, sizeof(uint)) != sizeof(uint)) LFATAL("Failed to read from: %s", filename);
    char clsName[clsNameLength];
    int sz = sizeof(char)*clsNameLength;
    if(read(fd, &clsName, sz) != sz) LFATAL("Failed to read from: %s", filename);
    itsClassNames[i] = std::string(clsName);
  }


  //Write the mean and stdev
  itsMean.clear();
  itsMean.resize(itsNumClasses, std::vector<double>(itsNumFeatures,0));

  itsStdevSq.clear();
  itsStdevSq.resize(itsNumClasses, std::vector<double>(itsNumFeatures,0));

  for(uint cls=0; cls<itsNumClasses; cls++)
  {
    for (uint i=0; i<itsNumFeatures; i++) //get the posterior prob
    {
      if(read(fd, &itsMean[cls][i], sizeof(double)) != sizeof(double)) LFATAL("Failed to read from: %s", filename);
      if(read(fd, &itsStdevSq[cls][i], sizeof(double)) != sizeof(double)) LFATAL("Failed to read from: %s", filename);
    }
  }

  close(fd);

  return true;
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:54,代码来源:Bayes.C


示例20: switch

// ##############################################################################################################
void jevois::VideoDisplay::send(jevois::RawImage const & img)
{
  // OpenCV uses BGR color for display:
  cv::Mat imgbgr;

  // Convert the image to openCV and to BGR:
  switch (img.fmt)
  {
  case V4L2_PIX_FMT_YUYV:
  {
    cv::Mat imgcv(img.height, img.width, CV_8UC2, img.buf->data());
    cv::cvtColor(imgcv, imgbgr, CV_YUV2BGR_YUYV);
  }
  break;

  case V4L2_PIX_FMT_GREY:
  {
    cv::Mat imgcv(img.height, img.width, CV_8UC1, img.buf->data());
    cv::cvtColor(imgcv, imgbgr, CV_GRAY2BGR);
  }
  break;

  case V4L2_PIX_FMT_SRGGB8:
  {
    cv::Mat imgcv(img.height, img.width, CV_8UC1, img.buf->data());
    cv::cvtColor(imgcv, imgbgr, CV_BayerBG2BGR);
  }
  break;

  case V4L2_PIX_FMT_RGB565:
  {
    cv::Mat imgcv(img.height, img.width, CV_8UC2, img.buf->data());
    cv::cvtColor(imgcv, imgbgr, CV_BGR5652BGR);
  }
  break;

  default: LFATAL("Unsupported video format");
  }
      
  // Display image:
  cv::imshow(itsName, imgbgr);

  // OpenCV needs this to actually update the display. Delay is in millisec:
  cv::waitKey(1);

  // Just push the buffer back into our queue. Note: we do not bother clearing the data or checking that the image is
  // legit, i.e., matches one that was obtained via get():
  itsImageQueue.push(img);
  LDEBUG("Empty image " << img.bufindex << " ready for filling in by application code");
}
开发者ID:Dennis-Wijngaarden,项目名称:jevois,代码行数:51,代码来源:VideoDisplay.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LFUNCVAL函数代码示例发布时间:2022-05-30
下一篇:
C++ LE_INFO函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap