本文整理汇总了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;
}
示例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 );
}
示例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);
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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 );
}
示例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;
}
示例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);
}