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


C++ setFailed函数代码示例

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


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

示例1: adoptPtr

void PNGImageDecoder::decode(bool onlySize)
{
    if (failed())
        return;

    if (!m_reader)
        m_reader = adoptPtr(new PNGImageReader(this));

    // If we couldn't decode the image but we've received all the data, decoding
    // has failed.
    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
        setFailed();
    // If we're done decoding the image, we don't need the PNGImageReader
    // anymore.  (If we failed, |m_reader| has already been cleared.)
    else if (isComplete())
        m_reader.clear();
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:17,代码来源:PNGImageDecoder.cpp

示例2: PLATFORM

void BMPImageDecoder::decode(bool onlySize)
{
#if PLATFORM(CHROMIUM)
    TRACE_EVENT("BMPImageDecoder::decode", this, 0);
#endif
    if (failed())
        return;

    // If we couldn't decode the image but we've received all the data, decoding
    // has failed.
    if (!decodeHelper(onlySize) && isAllDataReceived())
        setFailed();
    // If we're done decoding the image, we don't need the BMPImageReader
    // anymore.  (If we failed, |m_reader| has already been cleared.)
    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete))
        m_reader.clear();
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:17,代码来源:BMPImageDecoder.cpp

示例3: ASSERT

bool ICOImageDecoder::processDirectory() {
  // Read directory.
  ASSERT(!m_decodedOffset);
  if (m_data->size() < sizeOfDirectory)
    return false;
  const uint16_t fileType = readUint16(2);
  m_dirEntriesCount = readUint16(4);
  m_decodedOffset = sizeOfDirectory;

  // See if this is an icon filetype we understand, and make sure we have at
  // least one entry in the directory.
  if (((fileType != ICON) && (fileType != CURSOR)) || (!m_dirEntriesCount))
    return setFailed();

  m_fileType = static_cast<FileType>(fileType);
  return true;
}
开发者ID:mirror,项目名称:chromium,代码行数:17,代码来源:ICOImageDecoder.cpp

示例4: adoptPtr

void JPEGImageDecoder::decode(bool onlySize)
{
    if (failed())
        return;

    if (!m_reader)
        m_reader = adoptPtr(new JPEGImageReader(this));

    // If we couldn't decode the image but we've received all the data, decoding
    // has failed.
    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
        setFailed();
    // If we're done decoding the image, we don't need the JPEGImageReader
    // anymore.  (If we failed, |m_reader| has already been cleared.)
    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete))
        m_reader.clear();
}
开发者ID:jparound30,项目名称:webkit,代码行数:17,代码来源:JPEGImageDecoder.cpp

示例5: adoptPtr

void PNGImageDecoder::decode(bool onlySize)
{
    if (failed())
        return;

    if (!m_reader)
        m_reader = adoptPtr(new PNGImageReader(this));

    // If we couldn't decode the image but have received all the data, decoding
    // has failed.
    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
        setFailed();

    // If decoding is done or failed, we don't need the PNGImageReader anymore.
    if (isComplete(this) || failed())
        m_reader.clear();
}
开发者ID:dstockwell,项目名称:blink,代码行数:17,代码来源:PNGImageDecoder.cpp

示例6: setFailed

void ICOImageDecoder::decode(size_t index, bool onlySize)
{
    if (failed())
        return;

    // If we couldn't decode the image but we've received all the data, decoding
    // has failed.
    if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived())
        setFailed();
    // If we're done decoding this frame, we don't need the BMPImageReader or
    // PNGImageDecoder anymore.  (If we failed, these have already been
    // cleared.)
    else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == ImageFrame::FrameComplete)) {
        m_bmpReaders[index] = nullptr;
        m_pngDecoders[index] = nullptr;
    }
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:17,代码来源:ICOImageDecoder.cpp

示例7: AMListAction3

CLSSIS3820ScalerDarkCurrentMeasurementAction::CLSSIS3820ScalerDarkCurrentMeasurementAction(CLSSIS3820ScalerDarkCurrentMeasurementActionInfo *info, QObject *parent) :
    AMListAction3(info, AMListAction3::Sequential, parent)
{
	CLSSIS3820Scaler *scaler = CLSBeamline::clsBeamline()->scaler();
	double secondsDwell = scalerDarkCurrentMeasurementActionInfo()->dwellTime();

	connect( this, SIGNAL(failed()), this, SLOT(onActionFailed()) );

	if (scaler && scaler->isConnected() && secondsDwell > 0) {

		// pre-measurement settings.
		double oldDwell = scaler->dwellTime();

		// first turn off beam.
//		addSubAction(AMBeamline::bl()->createTurnOffBeamActions());

		// set the scaler's dwell time to new time.
		addSubAction(scaler->createDwellTimeAction3(secondsDwell));

		// initiate a scaler measurement and wait until it is complete.
		addSubAction(scaler->createStartAction3(true));
		addSubAction(scaler->createWaitForDwellFinishedAction(secondsDwell + 5.0));

		// notify attached and able scaler channel detectors that the latest measurement was a dark current measurement.
		AMListAction3 *notifyChannelDetectors = new AMListAction3(new AMListActionInfo3("Set last measurement as dark current measurement", "Set last measurement as dark current measurement"));

		for (int i = 0; i < scaler->channels().count(); i++) {
			CLSSIS3820ScalerChannel *channel = scaler->channelAt(i);

			if (channel && channel->isEnabled() && channel->detector() && channel->detector()->canDoDarkCurrentCorrection()) {
				notifyChannelDetectors->addSubAction(channel->detector()->createSetLastMeasurementAsDarkCurrentAction());
			}
		}

		addSubAction(notifyChannelDetectors);

		// reset settings to pre-measurement conditions.
		addSubAction(scaler->createDwellTimeAction3(oldDwell));

	} else {
		AMErrorMon::alert(this, CLSSIS3820SCALERDARKCURRENTMEASUREMENTACTION_SCALER_NOT_VALID, "Failed to complete dark current measurement--scaler not valid.");
		setFailed();
	}

}
开发者ID:anukat2015,项目名称:acquaman,代码行数:45,代码来源:CLSSIS3820ScalerDarkCurrentMeasurementAction.cpp

示例8: QString

void VESPERSSetStringAction::onValueChanged()
{
	const AMProcessVariable *pv = ((AMPVControl *)(control_))->readPV();
	QString string = VESPERS::pvToString(pv);
	QString text = ((VESPERSSetStringActionInfo *)info())->text();

	if (string == text){

		AMErrorMon::debug(this, VESPERSSETSTRINGACTION_SUCCEEDED, QString("[SUCCEEDED] Set string.  Desired: %1 Result: %2.").arg(text).arg(string));
		setSucceeded();
	}

	else{

		AMErrorMon::debug(this, VESPERSSETSTRINGACTION_FAILED, QString("[FAILED] Set string.  Desired: %1 Result: %2.").arg(text).arg(string));
		setFailed();
	}
}
开发者ID:acquaman,项目名称:acquaman,代码行数:18,代码来源:VESPERSSetStringAction.cpp

示例9: disconnect

void AMScanAction::onControllerInitialized()
{
	if (state() == AMAction3::Skipping){

		disconnect(controller_, SIGNAL(cancelled()), this, SLOT(onControllerCancelled()));
		connect(controller_, SIGNAL(cancelled()), this, SLOT(onControllerSucceeded()));
		controller_->cancel();
	}

	else if (!controller_->start()){

		AMErrorMon::alert(this, AMSCANACTION_CANT_START_CONTROLLER, "Could not start the scan controller.");
		setFailed();
	}

	else {
		setStarted();
	}
}
开发者ID:acquaman,项目名称:acquaman,代码行数:19,代码来源:AMScanAction.cpp

示例10: U_TRACE

UString URPCObject::processMessage(URPCEnvelope& envelope, bool& bContainsFault)
{
   U_TRACE(0, "URPCObject::processMessage(%p,%p)", &envelope, &bContainsFault)

   U_INTERNAL_ASSERT_POINTER(URPCMethod::encoder)

   UString retval;

   // Iterate over the list of methods

   URPCMethod* method = find(envelope.getMethodName());

   if (method == 0)
      {
      // Return object not found error. This would be a Client fault

      setFailed();

      URPCMethod::pFault->setFaultReason(U_CONSTANT_TO_PARAM("The requested method does not exist on this server"));

      bContainsFault = true;
      retval         = URPCMethod::encoder->encodeFault(URPCMethod::pFault);
      }
   else
      {
      UString ns = envelope.getNsName();

      U_INTERNAL_DUMP("envelope.nsName = %V", ns.rep)

      // check the name of namespace qualified element information (gSOAP)

      if (ns.empty()) ns = method->getNamespaces();
      if (ns.empty()) ns = *UString::str_ns;

      bContainsFault = (method->execute(envelope) == false);
      retval         = URPCMethod::encoder->encodeMethodResponse(*method, ns);
      }

   U_RETURN_STRING(retval);
}
开发者ID:paul-nema,项目名称:ULib,代码行数:40,代码来源:rpc_object.cpp

示例11: setFailed

void EglWaylandBackend::init()
{
    if (!initRenderingContext()) {
        setFailed("Could not initialize rendering context");
        return;
    }

    initEGL();
    GLPlatform *glPlatform = GLPlatform::instance();
    glPlatform->detect(EglPlatformInterface);
    glPlatform->printResults();
    initGL(EglPlatformInterface);

    setSupportsBufferAge(false);

    if (hasGLExtension("EGL_EXT_buffer_age")) {
        const QByteArray useBufferAge = qgetenv("KWIN_USE_BUFFER_AGE");

        if (useBufferAge != "0")
            setSupportsBufferAge(true);
    }
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:22,代码来源:egl_wayland_backend.cpp

示例12: QString

void AMDetectorReadAction::startImplementation(){
	// If you still don't have a detector, check the exposed detectors one last time.
	//if(!detector_)
	//	detector_ = AMBeamline::bl()->exposedDetectorByInfo(*(detectorReadInfo()->detectorInfo()));
	if(!detector_ && AMBeamlineSupport::beamlineDetectorAPI())
		detector_ = AMBeamlineSupport::beamlineDetectorAPI()->exposedDetectorByInfo(*(detectorReadInfo()->detectorInfo()));

	if(!detector_) {
		AMErrorMon::alert(this,
						  AMDETECTORREADACTION_NO_VALID_DETECTOR,
						  QString("There was an error reading the detector '%1', because the detector was not found. Please report this problem to the Acquaman developers.").arg(detectorReadInfo()->name()));
		setFailed();
		return;
	}

	if(detector_->readMethod() == AMDetectorDefinitions::WaitRead){
		// connect to detector initialization signals
		connect(detector_, SIGNAL(newValuesAvailable()), this, SLOT(onDetectorNewValuesAvailable()));
	}
	else
		internalSetSucceeded();
}
开发者ID:anukat2015,项目名称:acquaman,代码行数:22,代码来源:AMDetectorReadAction.cpp

示例13: adoptPtr

void GIFImageDecoder::parse(GIFParseQuery query)
{
    if (failed())
        return;

    if (!m_reader) {
        m_reader = adoptPtr(new GIFImageReader(this));
        m_reader->setData(m_data);
    }

    if (!m_reader->parse(query)) {
        setFailed();
        return;
    }

    const size_t oldSize = m_frameBufferCache.size();
    m_frameBufferCache.resize(m_reader->imagesCount());

    for (size_t i = oldSize; i < m_reader->imagesCount(); ++i) {
        ImageFrame& buffer = m_frameBufferCache[i];
        const GIFFrameContext* frameContext = m_reader->frameContext(i);
        buffer.setPremultiplyAlpha(m_premultiplyAlpha);
        buffer.setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i));
        buffer.setDuration(frameContext->delayTime);
        buffer.setDisposalMethod(frameContext->disposalMethod);

        // Initialize the frame rect in our buffer.
        IntRect frameRect(frameContext->xOffset, frameContext->yOffset, frameContext->width, frameContext->height);

        // Make sure the frameRect doesn't extend outside the buffer.
        if (frameRect.maxX() > size().width())
            frameRect.setWidth(size().width() - frameContext->xOffset);
        if (frameRect.maxY() > size().height())
            frameRect.setHeight(size().height() - frameContext->yOffset);

        buffer.setOriginalFrameRect(frameRect);
    }
}
开发者ID:windyuuy,项目名称:opera,代码行数:38,代码来源:GIFImageDecoder.cpp

示例14: isAllDataReceived

void ICOImageDecoder::decode(size_t index, bool onlySize) {
  if (failed())
    return;

  // Defensively clear the FastSharedBufferReader's cache, as another caller
  // may have called SharedBuffer::mergeSegmentsIntoBuffer().
  m_fastReader.clearCache();

  // If we couldn't decode the image but we've received all the data, decoding
  // has failed.
  if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) &&
      isAllDataReceived()) {
    setFailed();
    // If we're done decoding this frame, we don't need the BMPImageReader or
    // PNGImageDecoder anymore.  (If we failed, these have already been
    // cleared.)
  } else if ((m_frameBufferCache.size() > index) &&
             (m_frameBufferCache[index].getStatus() ==
              ImageFrame::FrameComplete)) {
    m_bmpReaders[index].reset();
    m_pngDecoders[index].reset();
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:23,代码来源:ICOImageDecoder.cpp

示例15: setFailed

void ICOImageDecoder::decode(size_t index, bool onlySize)
{
    if (failed())
        return;

    // If we couldn't decode the image but we've received all the data, decoding
    // has failed.
    if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived())
        setFailed();
    // If we're done decoding this frame, we don't need the BMPImageReader or
    // PNGImageDecoder anymore.  (If we failed, these have already been
    // cleared.)
    else if ((m_frameBufferCache.size() > index) && m_frameBufferCache[index].isComplete()) {
        m_bmpReaders[index] = nullptr;
        m_pngDecoders[index] = nullptr;
    }

    if (m_frameBufferCache.isEmpty())
        m_frameBufferCache.resize(m_dirEntries.size());
    // CAUTION: We must not resize m_frameBufferCache again after this, as
    // decodeAtIndex() may give a BMPImageReader a pointer to one of the
    // entries.
}
开发者ID:ollie314,项目名称:webkit,代码行数:23,代码来源:ICOImageDecoder.cpp


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