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


C++ dataSize函数代码示例

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


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

示例1: boundingRect

QwtDoubleRect QwtHistogram::boundingRect() const
{
	QwtDoubleRect rect = QwtPlotCurve::boundingRect();
	rect.setLeft(rect.left()-x(1));
	rect.setRight(rect.right()+x(dataSize()-1));
	rect.setTop(0);
	rect.setBottom(1.2*rect.bottom());
	return rect;
}
开发者ID:jkrueger1,项目名称:mantid,代码行数:9,代码来源:QwtHistogram.cpp

示例2: drawDots

/*!
  Draw a subset of the points

  \param painter Painter
  \param xMap Maps x-values into pixel coordinates.
  \param yMap Maps y-values into pixel coordinates.
  \param canvasRect Contents rect of the canvas
  \param from Index of the first sample to be painted
  \param to Index of the last sample to be painted. If to < 0 the
         series will be painted to its last sample.

  \sa drawDots()
*/
void QwtPlotSpectroCurve::drawSeries( QPainter *painter,
    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    const QRectF &canvasRect, int from, int to ) const
{
    if ( !painter || dataSize() <= 0 )
        return;

    if ( to < 0 )
        to = dataSize() - 1;

    if ( from < 0 )
        from = 0;

    if ( from > to )
        return;

    drawDots( painter, xMap, yMap, canvasRect, from, to );
}
开发者ID:Alex-Rongzhen-Huang,项目名称:OpenPilot,代码行数:31,代码来源:qwt_plot_spectrocurve.cpp

示例3: draw

	void draw(const ny::EventData*) override
	{
		if(!surface) return;

		auto bufferGuard = surface->buffer();
		auto buffer = bufferGuard.get();
		auto size = dataSize(buffer);
		std::memset(buffer.data, 0xCC, size);
	}
开发者ID:nyorain,项目名称:ny,代码行数:9,代码来源:dev.cpp

示例4: JSCell

PropertyTable::PropertyTable(VM& vm, unsigned initialCapacity)
    : JSCell(vm, vm.propertyTableStructure.get())
    , m_indexSize(sizeForCapacity(initialCapacity))
    , m_indexMask(m_indexSize - 1)
    , m_index(static_cast<unsigned*>(fastZeroedMalloc(dataSize())))
    , m_keyCount(0)
    , m_deletedCount(0)
{
    ASSERT(isPowerOf2(m_indexSize));
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:10,代码来源:PropertyTable.cpp

示例5: dataSize

void BoxCurve::draw(QPainter *painter, const QwtScaleMap &xMap,
                    const QwtScaleMap &yMap, int from, int to) const {
  if (!painter || dataSize() <= 0) return;

  int size = dataSize();
  if (to < 0) to = size - 1;

  painter->save();
  painter->setPen(QwtPlotCurve::pen());

  double *dat = new double[size];
  for (int i = from; i <= to; i++) dat[i] = y(i);

  drawBox(painter, xMap, yMap, dat, size);
  drawSymbols(painter, xMap, yMap, dat, size);

  painter->restore();
  delete[] dat;
}
开发者ID:gitter-badger,项目名称:AlphaPlot,代码行数:19,代码来源:BoxCurve.cpp

示例6: plot

double QwtBarCurve::dataOffset()
{
	if (bar_style == Vertical)
	{
		const QwtScaleMap &xMap = plot()->canvasMap(xAxis());
		int dx = abs(xMap.transform(x(1))-xMap.transform(x(0)));
		double bar_width = dx*(1-bar_gap*0.01);
		if (plot()->isVisible())
		{
			for (int i = 2; i<dataSize(); i++)
			{
				int min = abs(xMap.transform(x(i+1))-xMap.transform(x(i)));
				if (min <= dx)
					dx=min;
			}
			int x1 = xMap.transform(minXValue()) + int(bar_offset*0.01*bar_width);
			return xMap.invTransform(x1) - minXValue();
		}
		else
			return 0.5*bar_offset*0.01*bar_width;
	}
	else
	{
		const QwtScaleMap &yMap = plot()->canvasMap(yAxis());
		int dy = abs(yMap.transform(y(1))-yMap.transform(y(0)));
		double bar_width = dy*(1-bar_gap*0.01);
		if (plot()->isVisible())
		{
			for (int i=2; i<dataSize(); i++)
			{
				int min = abs(yMap.transform(y(i+1))-yMap.transform(y(i)));
				if (min <= dy)
					dy=min;
			}
			int y1 = yMap.transform(minYValue()) + int(bar_offset*0.01*bar_width);
			return yMap.invTransform(y1) - minYValue();
		}
		else
			return 0.5*bar_offset*0.01*bar_width;
	}
return 0;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:42,代码来源:QwtBarCurve.cpp

示例7: dataSize

bool MobileRecordStore::_resetDataSizeIfNeeded(OperationContext* opCtx, int64_t newDataSize) {
    bool wasReset = false;
    int64_t currDataSize = dataSize(opCtx);

    if (currDataSize != _dataSize) {
        wasReset = true;
        stdx::lock_guard<stdx::mutex> lock(_dataSizeMutex);
        _dataSize = newDataSize;
    }
    return wasReset;
}
开发者ID:acmorrow,项目名称:mongo,代码行数:11,代码来源:mobile_record_store.cpp

示例8: numRecords

/**
 * SQLite does not directly support truncate. The SQLite documentation recommends a DELETE
 * statement without a WHERE clause. A Truncate Optimizer deletes all of the table content
 * without having to visit each row of the table individually.
 */
Status MobileRecordStore::truncate(OperationContext* opCtx) {
    MobileSession* session = MobileRecoveryUnit::get(opCtx)->getSession(opCtx, false);

    int64_t numRecsBefore = numRecords(opCtx);
    _changeNumRecs(opCtx, -numRecsBefore);
    int64_t dataSizeBefore = dataSize(opCtx);
    _changeDataSize(opCtx, -dataSizeBefore);

    SqliteStatement::execQuery(session, "DELETE FROM \"", _ident, "\";");

    return Status::OK();
}
开发者ID:acmorrow,项目名称:mongo,代码行数:17,代码来源:mobile_record_store.cpp

示例9: dataSize

/*!
  \brief Checks if a range of indices is valid and corrects it if necessary
  \param i1 Index 1
  \param i2 Index 2
*/
int QwtCurve::verifyRange(int &i1, int &i2)
{
    int size = dataSize();

    if (size < 1) return 0;

    i1 = qwtLim(i1, 0, size-1);
    i2 = qwtLim(i2, 0, size-1);
    qwtSort(i1, i2, i1, i2);

    return (i2 - i1 + 1);
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:17,代码来源:qwt_curve.cpp

示例10: MakMek

EXPORT_C HBufC8* Roap::RRoapStorageClient::GetMeteringDataL(
    TDesC8& aRiId,
    TDes8& aMacKey,
    TDes8& aEncKeyHash,
    HBufC8*& aEncryptedMekAndMak )
    {
    TInt error = KErrNone;
    HBufC8* meteringData = NULL;
    HBufC8* csBuffer = NULL;

    if ( aRiId.Length() )
        {
        TInt mekAndMakSize = 0;
        TInt meteringDataSize = 0;
        TPckg<TInt> MakMek( mekAndMakSize );
        TPckg<TInt> dataSize( meteringDataSize );

        error = SendReceive( Roap::EGetMeteringData, TIpcArgs( &aRiId,
            &MakMek, &dataSize ) );

        if ( error == KErrNotFound )
            {
            return NULL;
            }

        User::LeaveIfError( error );

        csBuffer = HBufC8::NewMaxLC( OmaCrypto::KMacSize + SHA1_HASH
            + mekAndMakSize + meteringDataSize );

        // Package 'object' into TPtr8.
        TPtr8 objectPkg( const_cast<TUint8*> ( csBuffer->Ptr() ),
            OmaCrypto::KMacSize + SHA1_HASH + mekAndMakSize
                + meteringDataSize, OmaCrypto::KMacSize + SHA1_HASH
                + mekAndMakSize + meteringDataSize );

        User::LeaveIfError( SendReceive( Roap::EGetData,
            TIpcArgs( &objectPkg ) ) );

        aMacKey = objectPkg.Mid( 0, OmaCrypto::KMacSize );
        aEncKeyHash = objectPkg.Mid( OmaCrypto::KMacSize, SHA1_HASH );
        aEncryptedMekAndMak = objectPkg.Mid( OmaCrypto::KMacSize + SHA1_HASH,
            mekAndMakSize ).AllocL();
        meteringData = objectPkg.Mid( OmaCrypto::KMacSize + SHA1_HASH
            + mekAndMakSize, meteringDataSize ).AllocL();
        CleanupStack::PopAndDestroy( csBuffer );
        }
    else
        {
        User::Leave( KErrArgument );
        }
    return meteringData;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:53,代码来源:RoapStorageClient.cpp

示例11: JSCell

PropertyTable::PropertyTable(VM& vm, const PropertyTable& other)
    : JSCell(vm, vm.propertyTableStructure.get())
    , m_indexSize(other.m_indexSize)
    , m_indexMask(other.m_indexMask)
    , m_index(static_cast<unsigned*>(fastMalloc(dataSize())))
    , m_keyCount(other.m_keyCount)
    , m_deletedCount(other.m_deletedCount)
{
    ASSERT(isPowerOf2(m_indexSize));

    memcpy(m_index, other.m_index, dataSize());

    iterator end = this->end();
    for (iterator iter = begin(); iter != end; ++iter)
        iter->key->ref();

    // Copy the m_deletedOffsets vector.
    Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get();
    if (otherDeletedOffsets)
        m_deletedOffsets = std::make_unique<Vector<PropertyOffset>>(*otherDeletedOffsets);
}
开发者ID:eocanha,项目名称:webkit,代码行数:21,代码来源:PropertyTable.cpp

示例12: runtime_error

void
AAKR::add(Math::Matrix v)
{
    if (dataSize() == 0)
        throw std::runtime_error("unable to add: data window size is undefined.");

    if (v.rows() != 1)
        throw std::runtime_error("unable to add: new sample is not a row vector.");

    if (sampleSize() == 0)
        m_data.resize(dataSize(), v.columns());

    if ((unsigned)v.columns() != sampleSize())
        throw std::runtime_error("unable to add: sample size does not match.");

    // Write to the data set.
    m_data.set(m_index, m_index, 0, sampleSize() - 1, v);

    // Increment data set index.
    increment();
}
开发者ID:posilva,项目名称:dune,代码行数:21,代码来源:AAKR.cpp

示例13: drawDots

/*!
  Draw a subset of the points

  \param painter Painter
  \param xMap Maps x-values into pixel coordinates.
  \param yMap Maps y-values into pixel coordinates.
  \param canvasRect Contents rectangle of the canvas
  \param from Index of the first sample to be painted
  \param to Index of the last sample to be painted. If to < 0 the
         series will be painted to its last sample.

  \sa drawDots()
*/
void
CpPlotCurve::drawSeries( QPainter *painter,
    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    const QRectF &canvasRect, int from, int to ) const
{
    if ( !painter || dataSize() <= 0 )
        return;

    if ( to < 0 )
        to = dataSize() - 1;

    if ( from < 0 )
        from = 0;

    if ( from > to )
        return;

    //drawDots( painter, xMap, yMap, canvasRect, from, to );

    // Not working, to debug...
    drawLines( painter, xMap, yMap, canvasRect, from, to );
}
开发者ID:27sparks,项目名称:GoldenCheetah,代码行数:35,代码来源:CpPlotCurve.cpp

示例14: needsDelete

    bool KVRecordStoreCapped::needsDelete(OperationContext* txn) const {
        if (dataSize(txn) >= _cappedMaxSize) {
            // .. too many bytes
            return true;
        }

        if ((_cappedMaxDocs != -1) && (numRecords(txn) > _cappedMaxDocs)) {
            // .. too many documents
            return true;
        }

        // we're ok
        return false;
    }
开发者ID:kingfs,项目名称:tokumxse,代码行数:14,代码来源:kv_record_store_capped.cpp

示例15: dataSize

void QwtPieCurve::draw(QPainter *painter, const QwtScaleMap &xMap,
                       const QwtScaleMap &yMap, int from, int to) const {
  int size = dataSize();
  if (!painter || size <= 0)
    return;

  if (to < 0)
    to = size - 1;

  if (size > 1)
    drawSlices(painter, xMap, yMap, from, to);
  else
    drawDisk(painter, xMap, yMap);
}
开发者ID:liyulun,项目名称:mantid,代码行数:14,代码来源:QwtPieCurve.cpp


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