这篇教程C++ GetPointer函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetPointer函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPointer函数的具体用法?C++ GetPointer怎么用?C++ GetPointer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetPointer函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetSize// Message retrieved from Payloadbool 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; }}
开发者ID:batouzo,项目名称:Open-Transactions,代码行数:33,
示例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); }
开发者ID:Cdebus,项目名称:MITK,代码行数:12,
示例3: CHECKHRESULT 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;}
开发者ID:agangzz,项目名称:foo_midi,代码行数:14,
示例4: SetPayloadSizebool 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;}
开发者ID:batouzo,项目名称:Open-Transactions,代码行数:15,
示例5: DoStatevoid 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");}
开发者ID:ANR2ME,项目名称:ppsspp,代码行数:31,
示例6: Java_com_aio4c_Connection_closeJNIEXPORT void JNICALL Java_com_aio4c_Connection_close(JNIEnv* jvm, jobject connection, jboolean force) { void* myConnection = NULL; GetPointer(jvm, connection, &myConnection); ConnectionClose(myConnection, force);}
开发者ID:blakawk,项目名称:Aio4c,代码行数:7,
示例7: pa_simple_read/** * Contiguous Fetch. * The simple API is blocking, which is perfect for tracter. Fab. */Tracter::SizeTypeTracter::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;}
开发者ID:idiap,项目名称:tracter,代码行数:30,
示例8: IsValidbool 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;}
开发者ID:A5-,项目名称:CSGO-External,代码行数:25,
示例9: memcpyvoid OTIdentifier::CopyTo(uint8_t * szNewLocation) const{ if (GetSize()) { memcpy((void*)GetPointer(), szNewLocation, GetSize()); // todo cast }}
开发者ID:Tectract,项目名称:Open-Transactions,代码行数:7,
示例10: Java_com_aio4c_Connection_enableWriteInterestJNIEXPORT void JNICALL Java_com_aio4c_Connection_enableWriteInterest(JNIEnv* jvm, jobject connection) { void* myConnection = NULL; GetPointer(jvm, connection, &myConnection); EnableWriteInterest(myConnection);}
开发者ID:blakawk,项目名称:Aio4c,代码行数:7,
示例11: GetPointervoid 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(); } }}
开发者ID:colobotLeaner,项目名称:colobot,代码行数:28,
示例12: Commitvoid CKConfig::Commit() const{ if ( rc_t rc = KConfigCommit(const_cast<KConfig*>(GetPointer())) ) { NCBI_THROW2(CSraException, eOtherError, "CKConfig: Cannot commit config changes", rc); }}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:7,
示例13: GetPointervoid 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(); } }}
开发者ID:Grunaka,项目名称:colobot,代码行数:28,
示例14: AudioSamplePtrAudioSamplePtr 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();}
开发者ID:nikki93,项目名称:ethanon,代码行数:29,
示例15: _GetBufferstatic Buffer* _GetBuffer(JNIEnv* jvm, jobject buffer) { void* _buffer = NULL; GetPointer(jvm, buffer, &_buffer); return (Buffer*)_buffer;}
开发者ID:blakawk,项目名称:Aio4c,代码行数:7,
示例16: assert/** * Fetch speaker ID. This is done by sending a timestamp to the * server. It should respond immediately with a speaker ID, otherwise * everything will grind to a halt. */bool Tracter::SpeakerIDSocketSource::UnaryFetch(IndexType iIndex, int iOffset){ assert(mFrame.size == 1); Verbose(2, "Fetching SpeakerID for index %ld/n", iIndex); char* cache = (char*)GetPointer(iOffset); // Send time stamp to the socket: converting from nanoseconds // to milliseconds //TimeType timestamp = ( TimeStamp(0)+TimeOffset(iIndex) ) / 1000000; //TimeType timestamp = TimeStamp(iIndex) / 1000000; ///<--- This doesn't seem to work! // PNG: Incoming index is absoute time in seconds TimeType timestamp = (TimeType)iIndex * ONEe3 + mTimeOffset; Verbose(2, "Sending time %lld ms/n", timestamp);#if 1 mSocket.Send(sizeof(TimeType), (char*)×tamp); // Read the data from the socket Verbose(2, "Waiting for response/n"); int nGet = sizeof(float); int nGot = mSocket.Receive(nGet, cache); Verbose(2, "Got %d bytes/n", (int)nGot); if (nGot < nGet) return false;#else arraySize += 1; //dummy cache[0] = 'a'; cache[1] = 'b'; cache[2] = 'c'; cache[3] = 0;#endif return true;}
开发者ID:koemei,项目名称:tracter,代码行数:39,
示例17: CommandToBlobMCmdParamBlob* CommandToBlob(MCommand& Command){ size_t BlobSize = Command.GetSize(); auto Param = new MCmdParamBlob(BlobSize); Command.GetData(static_cast<char*>(Param->GetPointer()), BlobSize); return Param;}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:7,
示例18: getPointerstaticPyObject* getPointer(PyObject* self, PyObject* args) { PyObject* obj; if (!PyArg_ParseTuple(args, "O", &obj)){ return NULL; } return GetPointer(obj);}
开发者ID:KennethNielsen,项目名称:llvmpy,代码行数:8,
示例19: CopyFromEmuvoid CopyFromEmu(void* data, u32 address, size_t size){ if (!ValidCopyRange(address, size)) { PanicAlert("Invalid range in CopyFromEmu. %lx bytes from 0x%08x", (unsigned long)size, address); return; } memcpy(data, GetPointer(address), size);}
开发者ID:bradparks,项目名称:dolphin,代码行数:9,
示例20: Hash160// This method implements the (ripemd160 . sha256) hash,// so the result is 20 bytes long.bool Identifier::CalculateDigest(const unsigned char* data, size_t len){ // The Hash160 function comes from the Bitcoin reference client, where // it is implemented as RIPEMD160 ( SHA256 ( x ) ) => 20 byte hash auto hash160 = Hash160(data, data + len); SetSize(20); memcpy(const_cast<void*>(GetPointer()), hash160, 20); return true;}
开发者ID:yamamushi,项目名称:opentxs,代码行数:11,
示例21: MainWndProcLRESULT CALLBACK MainWndProc( HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam ){ // Pointer to the (C++ object that is the) window. Window *pWindow = GetPointer( hWnd ); TMSG Msg={iMessage,wParam,lParam,0}; if (pWindow->WndProc(Msg)) return Msg.RetVal; return pWindow->DefProc( hWnd, iMessage, wParam, lParam );}
开发者ID:DavidKinder,项目名称:Level9,代码行数:9,
示例22: CopyToEmuvoid CopyToEmu(u32 address, const void* data, size_t size){ if (!ValidCopyRange(address, size)) { PanicAlert("Invalid range in CopyToEmu. %lx bytes to 0x%08x", (unsigned long)size, address); return; } memcpy(GetPointer(address), data, size);}
开发者ID:bradparks,项目名称:dolphin,代码行数:9,
示例23: TInputGroupBoxConvertToDecNumMenuItemOnClickvoid __fastcall TInputGroupBox::TInputGroupBoxConvertToDecNumMenuItemOnClick(TObject*){ //TODO: Add your source code hereunsigned long num;num=0;num=GetPointer();TypeBox->ItemIndex=DEC_NUM;TextBox->Text=AnsiString(ulongToAnsi(num).c_str());}
开发者ID:BackupTheBerlios,项目名称:cheater2008,代码行数:9,
示例24: Java_com_aio4c_Connection_closingJNIEXPORT jboolean JNICALL Java_com_aio4c_Connection_closing(JNIEnv* jvm, jobject connection) { void* pConnection = NULL; Connection* myConnection = NULL; GetPointer(jvm, connection, &pConnection); myConnection = (Connection*)pConnection; return (jboolean)(myConnection->state == AIO4C_CONNECTION_STATE_PENDING_CLOSE);}
开发者ID:blakawk,项目名称:Aio4c,代码行数:9,
示例25: SetParamvoid CVDBCursor::SetParam(const char* name, const CTempString& value) const{ if ( rc_t rc = VCursorParamsSet ((struct VCursorParams *)GetPointer(), name, "%.*s", value.size(), value.data()) ) { NCBI_THROW2_FMT(CSraException, eNotFound, "Cannot set VDB cursor param: "<<*this<<": "<<name, rc); }}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:10,
示例26: GetSize// Envelope retrieved from payload.bool OTPayload::GetEnvelope(OTEnvelope & theEnvelope) 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 base64-encoded string, containing an encrypted message. (which we expect...) // (lSize-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, soon after this function, as a string. ((OT_BYTE *)GetPointer())[lIndex] = 0; theEnvelope.m_dataContents.Release(); OTASCIIArmor theArmor; // Why is this safe, where I cast the Payload data pointer as // a char * and tell the data object 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. theArmor.Set((const char *)GetPointer()); // Todo NOTE: If I ever want to process bookends here instead of assuming they aren't there, // IT'S VERY EASY!! All I have to do is call theArmor.LoadFromString instead of theArmor.Set. // Now the ascii-armored string that was sent across is decoded back to binary into the // Envelope object. theEnvelope.SetAsciiArmoredData(theArmor); return true; } else { OTLog::Error("Invalid Checksum in OTPayload::GetEnvelope/n"); return false; }}
开发者ID:Guratri,项目名称:Open-Transactions,代码行数:43,
示例27: assertTracter::SizeTypeTracter::Normalise::Fetch(IndexType iIndex, CacheArea& iOutputArea){ assert(iIndex >= 0); assert(mFrame.size); CacheArea inputArea; SizeType lenGot = mInput->Read(inputArea, iIndex, iOutputArea.Length()); short* input = mInput->GetPointer(inputArea.offset); float* output = GetPointer(iOutputArea.offset); SizeType rOffset = 0; SizeType wOffset = 0; for (SizeType i=0; i<lenGot; i++) { if (i == inputArea.len[0]) { input = mInput->GetPointer(0); rOffset = 0; } if (i == iOutputArea.len[0]) { output = GetPointer(0); wOffset = 0; } if (mByteOrder.WrongEndian()) for (int j=0; j<mFrame.size; j++) { // Inefficient! short s = input[rOffset++]; mByteOrder.Swap(&s, 2, 1); output[wOffset++] = (float)s / 32768.0f; } else for (int j=0; j<mFrame.size; j++) { output[wOffset++] = (float)input[rOffset++] / 32768.0f; } } return lenGot;}
开发者ID:idiap,项目名称:tracter,代码行数:42,
示例28: GetParams/************* * DESCRIPTION: Gets the paramters from the argument list. * Parses the arguments with a argument description. * INPUT: list argument list * OUTPUT: TRUE if failed else FALSE *************/BOOL GetParams(va_list *list, PARAM *para){ BOOL done = FALSE, identified = FALSE; PARAM *curpara; int type; int ret = FALSE; while(!done) { // Watcom seems to have a bug#ifdef __WATCOMC__ type = *((ULONG*)(**list));#else type = *((ULONG*)(*list));#endif if(type == rsiTDone) { done = TRUE; continue; } va_arg(*list,int); if(type == rsiTMore) { *list = *((va_list*)(*list)); continue; } curpara = para; while(curpara->tag_id != rsiTDone) { if(curpara->tag_id == type) { identified = TRUE; switch(curpara->type) { case rsiTypeInt: *((int*)curpara->data) = GetInt(list); break; case rsiTypeFloat: *((float*)curpara->data) = GetFloat(list); break; case rsiTypePointer: *((void**)curpara->data) = GetPointer(list); break; } } curpara++; } if(!identified) return TRUE; } va_end(*list); return ret;}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:60,
注:本文中的GetPointer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetPoints函数代码示例 C++ GetPoint函数代码示例 |