本文整理汇总了C++中dataPtr函数的典型用法代码示例。如果您正苦于以下问题:C++ dataPtr函数的具体用法?C++ dataPtr怎么用?C++ dataPtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dataPtr函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rebuildBuffers
void rebuildBuffers()
{
if (!mapData)
return;
groundVert.clear();
aboveVert.clear();
TileAtlasVX::readTiles(*this, *mapData, flags,
mapViewp.x, mapViewp.y, mapViewp.w, mapViewp.h);
groundQuads = groundVert.size() / 4;
aboveQuads = aboveVert.size() / 4;
size_t totalQuads = groundQuads + aboveQuads;
VBO::bind(vbo);
if (totalQuads > allocQuads)
{
VBO::allocEmpty(quadBytes(totalQuads), GL_DYNAMIC_DRAW);
allocQuads = totalQuads;
}
VBO::uploadSubData(0, quadBytes(groundQuads), dataPtr(groundVert));
VBO::uploadSubData(quadBytes(groundQuads), quadBytes(aboveQuads), dataPtr(aboveVert));
VBO::unbind();
shState->ensureQuadIBO(totalQuads);
}
开发者ID:Daverball,项目名称:mkxp,代码行数:30,代码来源:tilemapvx.cpp
示例2: ACE_TRACE
PppConfOption* PppConfPacket::optionAt (const int optIdx) {
ACE_TRACE("PppConfPacket::optionAt");
int optNum = 0;
if (codeVal() != Configure_Request &&
codeVal() != Configure_Ack &&
codeVal() != Configure_Nak)
throw std::runtime_error("No options in this type of packet.");
ACE_UINT8 optType, bufLen;
ACE_UINT8* optPtr;
int optPos = 0;
do {
optType = *(dataPtr() + optPos);
bufLen = *(dataPtr() + optPos + 1) - 2;
optPtr = dataPtr() + optPos + 2;
optPos += bufLen + 2;
} while ( optPos < dataLength() && optNum++ <= optIdx );
if ( optNum != optIdx )
throw std::runtime_error("Could not reach specified option index.");
// TODO: use an auto_ptr here so there's no worry about deleting later
return new PppConfOption(optType, bufLen, optPtr);
}
开发者ID:E-LLP,项目名称:channel-emulator,代码行数:27,代码来源:PppConfPacket.cpp
示例3: curSlice
bool VectorRecord::allValuesAreLoaded() const
{
if (!dataPtr() || !dataPtr()->pagedAndPageletTreeValueCount())
return true;
IntegerSequence curSlice(size(), offset(), stride());
IntegerSequence restrictedSlice = curSlice.intersect(IntegerSequence(pagedAndPageletTreeValueCount()));
if (restrictedSlice.size() == 0)
return true;
Nullable<long> slotIndex;
Fora::Interpreter::ExecutionContext* context = Fora::Interpreter::ExecutionContext::currentExecutionContext();
if (context)
slotIndex = context->getCurrentBigvecSlotIndex();
else
slotIndex = 0;
lassert(slotIndex);
if (!dataPtr()->bigvecHandleForSlot(*slotIndex))
return false;
bool tr = dataPtr()->
bigvecHandleForSlot(*slotIndex)->allValuesAreLoadedBetween(
restrictedSlice.smallestValue(),
restrictedSlice.largestValue() + 1
);
return tr;
}
开发者ID:Sandy4321,项目名称:ufora,代码行数:33,代码来源:VectorRecord.cpp
示例4: cleanup
void QDeclarativeVMEVariant::setValue(QObject *v)
{
if (type != QMetaType::QObjectStar) {
cleanup();
type = QMetaType::QObjectStar;
new (dataPtr()) QDeclarativeGuard<QObject>();
}
*(QDeclarativeGuard<QObject>*)(dataPtr()) = v;
}
开发者ID:fluxer,项目名称:katie,代码行数:9,代码来源:qdeclarativevmemetaobject.cpp
示例5: cleanup
void QQmlVMEVariant::setValue(QObject *v, QQmlVMEMetaObject *target, int index)
{
if (type != QMetaType::QObjectStar) {
cleanup();
type = QMetaType::QObjectStar;
new (dataPtr()) QQmlVMEVariantQObjectPtr(false);
}
reinterpret_cast<QQmlVMEVariantQObjectPtr*>(dataPtr())->setGuardedValue(v, target, index);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:9,代码来源:qqmlvmemetaobject.cpp
示例6: dataPtr
bool VectorRecord::entirelyCoveredByJOV(const JudgmentOnValue& inJOV) const
{
if (!dataPtr())
return true;
VectorHandle* handle = dataPtr();
lassert(allValuesAreLoaded());
int64_t curIndex = 0;
while (curIndex < size())
{
TypedFora::Abi::ForaValueArraySlice slice = sliceForOffset(curIndex);
lassert_dump(
slice.array(),
"We should have guaranteed that this value was loaded by calling 'allValuesAreLoaded'"
);
if (slice.mapping().stride() == 1)
{
bool allAreCovered = true;
auto visitor = [&](const PackedForaValues& vals) {
if (!allAreCovered || !inJOV.covers(vals.elementJOV()))
allAreCovered = false;
};
slice.array()->visitValuesSequentially(
visitor,
slice.mapping().range().offset(),
slice.mapping().range().endValue()
);
if (!allAreCovered)
return false;
}
else
{
while (curIndex < slice.mapping().highIndex())
{
if (!inJOV.covers(slice.jovFor(curIndex)))
return false;
curIndex++;
}
}
curIndex = slice.mapping().highIndex();
}
return true;
}
开发者ID:Sandy4321,项目名称:ufora,代码行数:53,代码来源:VectorRecord.cpp
示例7: BL_ASSERT
void
BaseFab<Real>::performCopy (const BaseFab<Real>& src,
const Box& srcbox,
int srccomp,
const Box& destbox,
int destcomp,
int numcomp)
{
BL_ASSERT(destbox.ok());
BL_ASSERT(src.box().contains(srcbox));
BL_ASSERT(box().contains(destbox));
BL_ASSERT(destbox.sameSize(srcbox));
BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= src.nComp());
BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= nComp());
if (destbox == domain && srcbox == src.box())
{
Real* data_dst = dataPtr(destcomp);
const Real* data_src = src.dataPtr(srccomp);
for (long i = 0, N = numcomp*numpts; i < N; i++)
{
*data_dst++ = *data_src++;
}
}
else
{
const int* destboxlo = destbox.loVect();
const int* destboxhi = destbox.hiVect();
const int* _th_plo = loVect();
const int* _th_phi = hiVect();
const int* _x_lo = srcbox.loVect();
const int* _x_plo = src.loVect();
const int* _x_phi = src.hiVect();
Real* _th_p = dataPtr(destcomp);
const Real* _x_p = src.dataPtr(srccomp);
FORT_FASTCOPY(_th_p,
ARLIM(_th_plo),
ARLIM(_th_phi),
D_DECL(destboxlo[0],destboxlo[1],destboxlo[2]),
D_DECL(destboxhi[0],destboxhi[1],destboxhi[2]),
_x_p,
ARLIM(_x_plo),
ARLIM(_x_phi),
D_DECL(_x_lo[0],_x_lo[1],_x_lo[2]),
&numcomp);
}
}
开发者ID:memmett,项目名称:BoxLib,代码行数:49,代码来源:BaseFab.cpp
示例8: setValue
double QDeclarativeVMEVariant::asDouble()
{
if (type != QMetaType::Double)
setValue(double(0));
return *(double *)(dataPtr());
}
开发者ID:fluxer,项目名称:katie,代码行数:7,代码来源:qdeclarativevmemetaobject.cpp
示例9: TagBox
TagBox*
TagBox::coarsen (const IntVect& ratio)
{
TagBox* crse = new TagBox(BoxLib::coarsen(domain,ratio));
const Box& cbox = crse->box();
Box b1(BoxLib::refine(cbox,ratio));
const int* flo = domain.loVect();
const int* fhi = domain.hiVect();
IntVect d_length = domain.size();
const int* flen = d_length.getVect();
const int* clo = cbox.loVect();
IntVect cbox_len = cbox.size();
const int* clen = cbox_len.getVect();
const int* lo = b1.loVect();
int longlen = b1.longside();
TagType* fdat = dataPtr();
TagType* cdat = crse->dataPtr();
Array<TagType> t(longlen,TagBox::CLEAR);
int klo = 0, khi = 0, jlo = 0, jhi = 0, ilo, ihi;
D_TERM(ilo=flo[0]; ihi=fhi[0]; ,
开发者ID:suhasjains,项目名称:BoxLib,代码行数:26,代码来源:TagBox.cpp
示例10: loVect
BaseFab<Real>&
BaseFab<Real>::saxpy (Real a, const BaseFab<Real>& src,
const Box& srcbox,
const Box& destbox,
int srccomp,
int destcomp,
int numcomp)
{
const int* destboxlo = destbox.loVect();
const int* destboxhi = destbox.hiVect();
const int* _th_plo = loVect();
const int* _th_phi = hiVect();
const int* _x_lo = srcbox.loVect();
const int* _x_plo = src.loVect();
const int* _x_phi = src.hiVect();
Real* _th_p = dataPtr(destcomp);
const Real* _x_p = src.dataPtr(srccomp);
FORT_FASTSAXPY(_th_p,
ARLIM(_th_plo),
ARLIM(_th_phi),
D_DECL(destboxlo[0],destboxlo[1],destboxlo[2]),
D_DECL(destboxhi[0],destboxhi[1],destboxhi[2]),
&a,
_x_p,
ARLIM(_x_plo),
ARLIM(_x_phi),
D_DECL(_x_lo[0],_x_lo[1],_x_lo[2]),
&numcomp);
return *this;
}
开发者ID:memmett,项目名称:BoxLib,代码行数:32,代码来源:BaseFab.cpp
注:本文中的dataPtr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论