本文整理汇总了C++中LFATAL函数的典型用法代码示例。如果您正苦于以下问题:C++ LFATAL函数的具体用法?C++ LFATAL怎么用?C++ LFATAL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LFATAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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
}
示例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());
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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);
}
示例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();
}
示例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
}
示例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);
}
示例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());
}
}