本文整理汇总了C++中GetPointer函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPointer函数的具体用法?C++ GetPointer怎么用?C++ GetPointer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPointer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSize
// Message retrieved from Payload
bool OTPayload::GetMessage(OTMessage & theMessage) const
{
// validate checksum
uint32_t lSize = GetSize();
uint32_t lIndex = lSize-2; // the index to where the NULL terminator SHOULD be if they
// sent us a string like they were supposed to. (A contract.)
// (nSize-1 would be the location of the checksum at the end.)
if (0 == lSize)
return false;
if (IsChecksumValid((OT_BYTE*)GetPointer(), (uint32_t)lSize))
{
// We add the null-terminator ourselves at this point, for security reasons,
// since we will process the data, after this point, as a string.
((OT_BYTE *)GetPointer())[lIndex] = 0;
theMessage.Release();
// Why is this safe, where I cast the Payload data pointer as
// a char * and tell the string to set itself from that?
// Because (1) I just validated the checksum, and
// (2) There place where the NULL should be, I set to 0, by hand,
// just above 2 lines. So when this set operation occurs, the
// farthest it will go is to that 0.
theMessage.m_strRawFile.Set((const char *)GetPointer());
return true;
}
else {
OTLog::Error("Invalid Checksum in OTPayload::GetMessage\n");
return false;
}
}
示例2: GetImageStatisticsInvalid
void GetImageStatisticsInvalid()
{
CreateNodeRelationImage(m_statisticsContainer.GetPointer(), m_image.GetPointer());
CPPUNIT_ASSERT_THROW(mitk::ImageStatisticsContainerManager::GetImageStatistics(nullptr, m_image.GetPointer()), mitk::Exception);
auto standaloneDataStorage = mitk::StandaloneDataStorage::New();
CPPUNIT_ASSERT_THROW(mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), nullptr), mitk::Exception);
CPPUNIT_ASSERT_THROW(mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), nullptr, m_mask.GetPointer()), mitk::Exception);
CPPUNIT_ASSERT_THROW(mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), nullptr, m_planarFigure.GetPointer()), mitk::Exception);
}
示例3: CHECK
HRESULT CMfxBufferFactory::CreateCopy( MFX_HBUFFER hbufOld, DWORD dwLength, MFX_HBUFFER* phbufNew )
{
void* pvSrc;
void* pvDst;
DWORD cbSrc, cbDst;
CHECK( GetPointer( hbufOld, &pvSrc, &cbSrc ) );
CHECK( Create( dwLength, phbufNew ) );
CHECK( GetPointer( *phbufNew, &pvDst, &cbDst ) );
memcpy( pvDst, pvSrc, min( cbSrc, cbDst ) );
return S_OK;
}
示例4: SetPayloadSize
bool OTPayload::SetMessage(const OTMessage & theMessage)
{
uint32_t lSize = theMessage.m_strRawFile.GetLength()+1; //+1 for the null terminater
if (theMessage.m_strRawFile.GetLength())
{
SetPayloadSize(lSize + 1); // +1 for the checksum byte.
memcpy((void *)GetPointer(), theMessage.m_strRawFile.Get(), lSize);
// Add the checksum
AppendChecksum( (OT_BYTE*)GetPointer(), lSize );
return true;
}
return false;
}
示例5: DoState
void DoState(PointerWrap &p)
{
auto s = p.Section("Memory", 1, 2);
if (!s)
return;
if (s < 2) {
if (!g_RemasterMode)
g_MemorySize = RAM_NORMAL_SIZE;
g_PSPModel = PSP_MODEL_FAT;
} else {
u32 oldMemorySize = g_MemorySize;
p.Do(g_PSPModel);
p.DoMarker("PSPModel");
if (!g_RemasterMode) {
g_MemorySize = g_PSPModel == PSP_MODEL_FAT ? RAM_NORMAL_SIZE : RAM_DOUBLE_SIZE;
if (oldMemorySize < g_MemorySize) {
Shutdown();
Init();
}
}
}
p.DoArray(GetPointer(PSP_GetKernelMemoryBase()), g_MemorySize);
p.DoMarker("RAM");
p.DoArray(m_pVRAM, VRAM_SIZE);
p.DoMarker("VRAM");
p.DoArray(m_pScratchPad, SCRATCHPAD_SIZE);
p.DoMarker("ScratchPad");
}
示例6: Java_com_aio4c_Connection_close
JNIEXPORT void JNICALL Java_com_aio4c_Connection_close(JNIEnv* jvm, jobject connection, jboolean force) {
void* myConnection = NULL;
GetPointer(jvm, connection, &myConnection);
ConnectionClose(myConnection, force);
}
示例7: pa_simple_read
/**
* Contiguous Fetch.
* The simple API is blocking, which is perfect for tracter. Fab.
*/
Tracter::SizeType
Tracter::PulseAudioSource::ContiguousFetch(
IndexType iIndex, SizeType iLength, SizeType iOffset
)
{
if (mMaxIndex)
if (iIndex > mMaxIndex)
return 0;
/* I'm assuming that it reads a whole buffer-full here */
int error;
int ret = pa_simple_read(
mHandle,
GetPointer(iOffset),
iLength * sizeof(float),
&error
);
if (ret < 0)
throw Exception("%s: Failed to read %d samples. %s",
mObjectName, iLength, pa_strerror(error));
if (mMaxIndex)
if (iIndex + iLength > mMaxIndex)
return mMaxIndex - iIndex;
return iLength;
}
示例8: IsValid
bool Entity::IsValid()
{
if( !GetPointer() )
return false;
if( !GetBoneMatrix() )
return false;
if( !GetTeamNum() )
return false;
if( IsDead() )
return false;
if( IsDormant() )
return false;
if( GetOrigin().IsZero() )
return false;
if( GetHealth() < 1 )
return false;
return true;
}
示例9: memcpy
void OTIdentifier::CopyTo(uint8_t * szNewLocation) const
{
if (GetSize())
{
memcpy((void*)GetPointer(), szNewLocation, GetSize()); // todo cast
}
}
示例10: Java_com_aio4c_Connection_enableWriteInterest
JNIEXPORT void JNICALL Java_com_aio4c_Connection_enableWriteInterest(JNIEnv* jvm, jobject connection) {
void* myConnection = NULL;
GetPointer(jvm, connection, &myConnection);
EnableWriteInterest(myConnection);
}
示例11: GetPointer
void CBotVar::SetInit(int bInit)
{
m_binit = bInit;
if ( bInit == 2 ) m_binit = IS_DEF; // cas spécial
if ( m_type.Eq(CBotTypPointer) && bInit == 2 )
{
CBotVarClass* instance = GetPointer();
if ( instance == NULL )
{
instance = new CBotVarClass(NULL, m_type);
// instance->SetClass((static_cast<CBotVarPointer*>(this))->m_pClass);
SetPointer(instance);
}
instance->SetInit(1);
}
if ( m_type.Eq(CBotTypClass) || m_type.Eq(CBotTypIntrinsic) )
{
CBotVar* p = (static_cast<CBotVarClass*>(this))->m_pVar;
while( p != NULL )
{
p->SetInit( bInit );
p->m_pMyThis = static_cast<CBotVarClass*>(this);
p = p->GetNext();
}
}
}
示例12: Commit
void CKConfig::Commit() const
{
if ( rc_t rc = KConfigCommit(const_cast<KConfig*>(GetPointer())) ) {
NCBI_THROW2(CSraException, eOtherError,
"CKConfig: Cannot commit config changes", rc);
}
}
示例13: GetPointer
void CBotVar::SetInit(CBotVar::InitType initType)
{
m_binit = initType;
if (initType == CBotVar::InitType::IS_POINTER ) m_binit = CBotVar::InitType::DEF; // cas spécial
if ( m_type.Eq(CBotTypPointer) && initType == CBotVar::InitType::IS_POINTER )
{
CBotVarClass* instance = GetPointer();
if ( instance == nullptr )
{
instance = new CBotVarClass(CBotToken(), m_type);
// instance->SetClass((static_cast<CBotVarPointer*>(this))->m_classes);
SetPointer(instance);
}
instance->SetInit(CBotVar::InitType::DEF);
}
if ( m_type.Eq(CBotTypClass) || m_type.Eq(CBotTypIntrinsic) )
{
CBotVar* p = (static_cast<CBotVarClass*>(this))->m_pVar;
while( p != nullptr )
{
p->SetInit(initType);
p->m_pMyThis = static_cast<CBotVarClass*>(this);
p = p->GetNext();
}
}
}
示例14: AudioSamplePtr
AudioSamplePtr ETHAudioResourceManager::GetPointer(AudioPtr audio,
const str_type::string &fileRelativePath, const str_type::string &programPath,
const str_type::string &searchPath, const GS_SAMPLE_TYPE type)
{
if (fileRelativePath == GS_L(""))
return AudioSamplePtr();
if (!m_resource.empty())
{
str_type::string fileName = ETHGlobal::GetFileName(fileRelativePath);
std::map<str_type::string, AudioSamplePtr>::iterator iter = m_resource.find(fileName);
if (iter != m_resource.end())
return iter->second;
}
// we can set a search path to search the file in case
// it hasn't been loaded yet
if (searchPath != GS_L(""))
{
str_type::string fileName = ETHGlobal::GetFileName(fileRelativePath);
str_type::string path = programPath;
path += searchPath;
path += fileName;
AddFile(audio, path, type);
return GetPointer(audio, fileName, programPath, GS_L(""), type);
}
return AudioSamplePtr();
}
示例15: _GetBuffer
static Buffer* _GetBuffer(JNIEnv* jvm, jobject buffer) {
void* _buffer = NULL;
GetPointer(jvm, buffer, &_buffer);
return (Buffer*)_buffer;
}