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

C++ Transfer类代码示例

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

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



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

示例1: getCurrentQueue

void MainWindow::displayDestroyed()
{
	Queue* q = getCurrentQueue();
	//QModelIndex i = treeTransfers->currentIndex();
	QList<int> sel = getSelection();
	Transfer* d = 0;
	
	if(q != 0 && sel.size() == 1)
		d = q->at(sel[0]);
	
	if(QWidget* w = stackedDetails->currentWidget())
	{
		//disconnect(w, SIGNAL(destroyed()), this, SLOT(displayDestroyed()));
		stackedDetails->removeWidget(w);
		delete w;
	}
	m_pDetailsDisplay = 0;
	
	if(d != 0)
	{
		QWidget* widgetDisplay = new QWidget(stackedDetails);
		m_pDetailsDisplay = d->createDetailsWidget(widgetDisplay);
		if(m_pDetailsDisplay)
		{
			stackedDetails->insertWidget(0,widgetDisplay);
			stackedDetails->setCurrentIndex(0);
			
			connect(m_pDetailsDisplay, SIGNAL(destroyed()), this, SLOT(displayDestroyed()));
		}
		else
			delete widgetDisplay;
	}
	
	doneQueue(q);
}
开发者ID:franckikalogic,项目名称:fatrat,代码行数:35,代码来源:MainWindow.cpp


示例2: libusb_fill_iso_transfer

bool LibusbSoundplaneDriver::processThreadScheduleTransfer(Transfer &transfer)
{
	if (processThreadShouldStopTransfers())
	{
		return false;
	}

	libusb_fill_iso_transfer(
		transfer.transfer,
		transfer.device,
		transfer.endpointAddress,
		reinterpret_cast<unsigned char *>(transfer.packets),
		sizeof(transfer.packets),
		transfer.numPackets(),
		processThreadTransferCallbackStatic,
		&transfer,
		1000);
	libusb_set_iso_packet_lengths(
		transfer.transfer,
		sizeof(transfer.packets) / transfer.numPackets());

	const auto result = libusb_submit_transfer(transfer.transfer);
	if (result < 0)
	{
		fprintf(stderr, "Failed to submit USB transfer: %s\n", libusb_error_name(result));
		return false;
	}
	else
	{
		mOutstandingTransfers++;
		return true;
	}
}
开发者ID:TheTechnobear,项目名称:soundplane,代码行数:33,代码来源:LibusbSoundplaneDriver.cpp


示例3: qCritical

Transfer * Client::registerTransfer (const QString& name, TransferType type,
	const QString& clientId) {

    Transfer * transfer = 0;

    if (d_ptr->interface == 0) {
        if (d_ptr->initDbusInterface() == false) {
            qCritical() << "Failed to create dbus interface";
            return transfer;
        }
    }


    QDBusReply<QString> reply =
        d_ptr->interface->registerTransientTransfer(name, type, clientId);

    if (reply.isValid()) {
        transfer = new TransientTransfer (d_ptr->interface, reply.value(), name,
            type, this);
        if (transfer != 0) {
            d_ptr->transfers[transfer->transferId()] = transfer;

            connect(d_ptr,SIGNAL(sendLastProgress()),transfer,
                SLOT(sendLastProgress()));

        } else {
            qCritical() << "Failed to create transfer";
        }
    } else {
        qWarning() << "Transfer UI returned error.";
    }

    return transfer;
}
开发者ID:chegestar,项目名称:Share-UI,代码行数:34,代码来源:client.cpp


示例4: g_warning

cairo_surface_t *
GalliumSurface::Cairo ()
{
	static cairo_user_data_key_t key;
	struct pipe_resource         *texture = sampler_view->texture;
	Transfer                     *transfer;
	unsigned char                *data;

	if (!pipe) {
		g_warning ("GalliumSurface::Cairo called with invalid "
			   "surface instance.");
		return NULL;
	}

	if (mapped)
		return cairo_surface_reference (mapped);

	transfer = new Transfer (pipe, texture);
	data     = (unsigned char *) transfer->Map ();

	mapped = cairo_image_surface_create_for_data (data,
						      CAIRO_FORMAT_ARGB32,
						      texture->width0,
						      texture->height0,
						      texture->width0 * 4);

	cairo_surface_set_user_data (mapped,
				     &key,
				     (void *) transfer,
				     CairoDestroy);

	return cairo_surface_reference (mapped);
}
开发者ID:kangaroo,项目名称:moon,代码行数:33,代码来源:surface-gallium.cpp


示例5: setMessage

void JavaExtractor::finishedExtraction(QList<QString> list)
{
	if (list.isEmpty())
	{
		setMessage(tr("Empty or invalid link list"));
		setState(Failed);
		return;
	}

	QString clsName = m_engines[m_strClass].targetClass;
	if (clsName.isEmpty())
	{
		BestEngine e = bestEngine(list[0], Download);
		if (!e.engine)
		{
			setMessage(tr("Failed to detect URL class: %1").arg(list[0]));
			setState(Failed);
			return;
		}

		clsName = e.engine->shortName;
	}

	QList<Transfer*> ts;
	TransferFactory* f = TransferFactory::instance();
	foreach (QString url, list)
	{
		Transfer *t = f->createInstance(clsName);
		t->init(url, m_strTarget);
		t->setState(Waiting);
		ts << t;
	}
开发者ID:ActionLuzifer,项目名称:fatrat,代码行数:32,代码来源:JavaExtractor.cpp


示例6: checkWork

bool checkWork() {
    int flag;

    MPI_Iprobe(reqRank, WORK_TRANSMIT, MPI_COMM_WORLD, &flag, &status);
    if (flag) {
        file << "Process " << rank << " Prijma praci\n";
        
        // kontrola velkosti
        int testTransferSize;
        MPI_Get_count(&status, MPI_SHORT, &testTransferSize);

        file << "\nTransfer Size: " << testTransferSize << "\n";
        // prijmanie predoslej ziadosti
        Transfer * transfer = new Transfer(testTransferSize);
        MPI_Recv(transfer->transfer, testTransferSize, MPI_SHORT, reqRank, WORK_TRANSMIT, MPI_COMM_WORLD, &status);

        // pokial 1 == NO_WORK
        if (testTransferSize == 1)return false;

        file << "Process " << rank << " Prijal spravu o velkosti:" << testTransferSize << "\n";
        stack->add(transfer->unpack());
        delete transfer;
    }
    return flag == 0;
}
开发者ID:mazmar,项目名称:Kostra,代码行数:25,代码来源:main.cpp


示例7: checkSolution

void checkSolution() {
    LinkedStack<Kostra> tempStack;
    int flag, testTransferSize;
    for (int i = 0; i < worldSize; i++) {
        if (i == rank)continue;
        MPI_Iprobe(i, SOLUTION_TRANSMIT, MPI_COMM_WORLD, &flag, &status);
        file << "\nProcess " << rank << " : Checking Solutions from: " << i << "flag:" << flag << "\n";

        if (flag) {
            MPI_Get_count(&status, MPI_SHORT, &testTransferSize);
            Transfer * t = new Transfer(testTransferSize);
            file << "Prijmam solution o velkosti: " << testTransferSize << "\n";
            MPI_Recv(t->transfer, testTransferSize, MPI_SHORT, i, SOLUTION_TRANSMIT, MPI_COMM_WORLD, &status);
            file << "Prijal sem solution o velkosti: " << testTransferSize << "\n";

            tempStack = *t->unpack();
            if (solution == NULL || tempStack.front->k->krok < solution->krok)
                setSolution(tempStack.front->k);
            delete t;
        }

    }
    file << "\nProcess " << rank << " : Exiting Solutions: ";

}
开发者ID:mazmar,项目名称:Kostra,代码行数:25,代码来源:main.cpp


示例8: ConstructAndAddTransferTransaction

void TextFileDataSource::ConstructAndAddTransferTransaction(std::string line)
{

	enum
	{
		ID,
		AMOUNT,
		CUSTOMER_ID,
		DATE,
		TO_ACCOUNT_ID,
		FROM_ACCOUNT_ID,
		NUM_FIELDS
	};

	vector<std::string> lineSplit = stringUtils::splitstring(line, ',');
	date dt;

	Transfer t
	(
		TypeConverter(lineSplit[ID]),
		TypeConverter(lineSplit[AMOUNT]),
		TypeConverter(lineSplit[CUSTOMER_ID]),
		dt,
		TypeConverter(lineSplit[TO_ACCOUNT_ID]),
		TypeConverter(lineSplit[FROM_ACCOUNT_ID])
	);

	_transactions.add(t.getId(), &t);

}
开发者ID:bradbow,项目名称:inb305gui,代码行数:30,代码来源:TextFileDataSource.cpp


示例9: write

bool DeviceHandleLibUSB::write(const Transfer& transfer_, uint8_t endpoint_)
{
  int nBytesWritten = 0;
  if (static_cast<bool>(transfer_) == true)
  {
    int result = libusb_bulk_transfer(m_pCurrentDevice, // Device handle
      endpoint_,                                        // Endpoint
      const_cast<uint8_t*>(transfer_.data().data()),    // Data pointer
      transfer_.size(),                                 // Size of data
      &nBytesWritten,                                   // N. of bytes actually written
      kLibUSBWriteTimeout                               // Timeout
      );
    if ((LIBUSB_SUCCESS != result) || (nBytesWritten != transfer_.size()))
    {
      M_LOG(
        "[DeviceHandleLibUSB] write: error=" << result << " - transfer size: " << transfer_.size()
                                             << " written: "
                                             << nBytesWritten);
      return false;
    }
    return true;
  }

  return false;
}
开发者ID:shaduzlabs,项目名称:cabl,代码行数:25,代码来源:DeviceHandleLibUSB.cpp


示例10: Transfer

dbinterface::dbinterface()
{
    this->dbm=new dbmeth;
    if(dbm->Transfer(dbm->do_nothing)){//!
        Transfer *tr = new Transfer(this,dbm->transferMes());
        tr->exec();
    }
}
开发者ID:Shadasviar,项目名称:Diary-course-project-from-2015-,代码行数:8,代码来源:dbinterface.cpp


示例11:

void
GalliumSurface::CairoDestroy (void *data)
{
	Transfer *transfer = (Transfer *) data;

	transfer->Unmap ();
	delete transfer;
}
开发者ID:kangaroo,项目名称:moon,代码行数:8,代码来源:surface-gallium.cpp


示例12: shiftPressed

void TraktorF1MK2::processButtons(const Transfer& input_)
{
  bool shiftPressed(isButtonPressed(input_, Button::Shift));
  Device::Button changedButton(Device::Button::Unknown);
  bool buttonPressed(false);

  for (int i = 0; i < kF1MK2_buttonsDataSize - 1; i++) // Skip the last byte (encoder value)
  {
    for (int k = 0; k < 8; k++)
    {
      uint8_t btn = (i * 8) + k;
      Button currentButton(static_cast<Button>(btn));
      if (currentButton == Button::Shift)
      {
        continue;
      }
      buttonPressed = isButtonPressed(input_, currentButton);
      if (buttonPressed != m_buttonStates[btn])
      {
        m_buttonStates[btn] = buttonPressed;
        changedButton = deviceButton(currentButton);
        if (changedButton != Device::Button::Unknown)
        {
          if (currentButton >= Button::Pad8 && currentButton <= Button::Pad9)
          {
            keyChanged(btn, buttonPressed ? 1.0 : 0.0, shiftPressed);
          }
          else
          {
            buttonChanged(changedButton, buttonPressed, shiftPressed);
          }
        }
      }
    }
  }

  // encoder
  uint8_t currentValue = input_.data()[kF1MK2_buttonsDataSize];
  if (currentValue != m_encoderValue)
  {
    bool valueIncreased = ((static_cast<uint8_t>(m_encoderValue) < currentValue)
                            || ((m_encoderValue == 0xff) && (currentValue == 0x00)))
                          && (!((m_encoderValue == 0x0) && (currentValue == 0xff)));
    m_encoderValue = currentValue;
    encoderChanged(0, valueIncreased, shiftPressed);
  }

  // pots/faders
  for (uint8_t potIndex = 0, i = kF1MK2_buttonsDataSize + 1; potIndex < 8; i += 2, potIndex++)
  {
    unsigned value = (input_.data()[i]) | (input_.data()[i + 1] << 8);
    if (m_potentiometersValues[potIndex] != value)
    {
      m_potentiometersValues[potIndex] = value;
      controlChanged(potIndex, value / 1024.0, shiftPressed);
    }
  }
}
开发者ID:shaduzlabs,项目名称:cabl,代码行数:58,代码来源:TraktorF1MK2.cpp


示例13: Q_EMIT

void ClientPrivate::startSlot (const QString & id) {
    if (transfers.contains (id)) {
        Transfer * transfer = transfers[id];
        transfer->startSlot ();
        Q_EMIT(startTransfer (transfer));
    } else {
        qDebug() << "Ignore start signal for" << id;
    }
}
开发者ID:chegestar,项目名称:Share-UI,代码行数:9,代码来源:client.cpp


示例14: getTransfer

void TransfersContentsWidget::openTransfer(const QModelIndex &index)
{
	Transfer *transfer = getTransfer(index.isValid() ? index : m_ui->transfersViewWidget->currentIndex());

	if (transfer)
	{
		transfer->openTarget();
	}
}
开发者ID:lpxxn,项目名称:otter-browser,代码行数:9,代码来源:TransfersContentsWidget.cpp


示例15: qDebug

void ClientPrivate::cancelSlot (const QString & id) {
    qDebug() << "Transfer id " << id;
    if (transfers.contains (id)) {
        Transfer * transfer = transfers[id];
        transfer->cancelSlot ();
        Q_EMIT(cancelTransfer (transfer));
    } else {
        qDebug() << "Ignore cancel signal for" << id;
    }
}
开发者ID:chegestar,项目名称:Share-UI,代码行数:10,代码来源:client.cpp


示例16:

Transfer *TransferManager::FindTransferByName( const String &sName )
{
	for ( Transfer *pCur = (Transfer *)m_transferList.GetFirst(); pCur; pCur = (Transfer *)m_transferList.GetNext( pCur ) )
	{
		if ( sName == pCur->GetName() )
			return pCur; 
	}

	return (NULL);
}
开发者ID:Laxa,项目名称:quals-2016,代码行数:10,代码来源:transfer_manager.cpp


示例17: write

bool DeviceHandleHIDAPI::write(const Transfer& transfer_, uint8_t)
{
  if (transfer_)
  {
    int nBytesWritten = hid_write(m_pCurrentDevice, transfer_.data().data(), transfer_.size());
    return (nBytesWritten >= static_cast<int>(transfer_.size()));
  }

  return false;
}
开发者ID:shaduzlabs,项目名称:cabl,代码行数:10,代码来源:DeviceHandleHIDAPI.cpp


示例18: torrentDoubleClicked

void TransferListWidget::torrentDoubleClicked(const QModelIndex& index) {
  const QString hash = index.model()->data(index.model()->index(index.row(), TorrentModelItem::TR_HASH)).toString();//mapToSource(index).row();
  Transfer h = BTSession->getTransfer(hash);
  if (!h.is_valid()) return;
  int action;
  if (h.is_seed()) {
    action = Preferences().getActionOnDblClOnTorrentFn();
  } else {
    action = Preferences().getActionOnDblClOnTorrentDl();
  }

  switch(action) {
  case TOGGLE_PAUSE:
    if (h.is_paused()) {
      h.resume();
    } else {
      h.pause();
    }
    break;
  case OPEN_DEST:
    QString link = h.num_files() == 1 ? h.absolute_files_path().at(0) : h.save_path();
    QDesktopServices::openUrl(QUrl::fromLocalFile(link));
    break;
  }
}
开发者ID:nesterov,项目名称:qDonkey,代码行数:25,代码来源:transferlistwidget.cpp


示例19: transferStarted

void TransfersManager::transferStarted()
{
	Transfer *transfer = qobject_cast<Transfer*>(sender());

	if (transfer && transfer->getState() != Transfer::CancelledState)
	{
		emit transferStarted(transfer);

		scheduleSave();
	}
}
开发者ID:kyleivey,项目名称:otter-browser,代码行数:11,代码来源:TransfersManager.cpp


示例20: transferFinished

void Updater::transferFinished()
{
	Transfer *transfer = qobject_cast<Transfer*>(sender());

	if (transfer)
	{
		const QString path = transfer->getTarget();

		if ((transfer->getState() == Transfer::FinishedState) && QFile::exists(path))
		{
			if (QFileInfo(path).suffix() == QLatin1String("xml"))
			{
				QFile file(SessionsManager::getWritableDataPath(QLatin1String("update.txt")));

				if (file.open(QIODevice::ReadWrite | QIODevice::Text))
				{
					QTextStream stream(&file);
					stream << path;

					file.close();
				}
			}
		}
		else
		{
			Console::addMessage(QCoreApplication::translate("main", "Unable to download update: %1\nError: %2").arg(transfer->getSource().url()).arg(transfer->getState()), OtherMessageCategory, ErrorMessageLevel);

			m_transfersSuccessful = false;
		}

		transfer->deleteLater();
	}
	else
	{
		m_transfersSuccessful = false;
	}

	++m_transfersCount;

	if (m_transfersCount == 2)
	{
		if (!m_transfersSuccessful)
		{
			clearUpdate();
		}

		emit finished(m_transfersSuccessful);

		deleteLater();
	}
}
开发者ID:aurhat,项目名称:otter-browser,代码行数:51,代码来源:Updater.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Transform类代码示例发布时间:2022-05-31
下一篇:
C++ Transcripts类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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