• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetDataPtr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Allocate

KString::KString(LPCTSTR pStr1, size_t szLength1, LPCTSTR pStr2, size_t szLength2)
{
	Allocate(szLength1 + szLength2);

	memcpy(GetDataPtr(), pStr1, GetStreamCharsLength(szLength1));
	memcpy(GetDataPtr(szLength1), pStr2, GetStreamCharsLength(szLength2));
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:7,代码来源:kstring.cpp


示例2: DeleteAllColumns

void CPageDocuments::DisplayShips(int index)
{
  CString info;
  m_list.DeleteAllItems();
  DeleteAllColumns();
  m_list.InsertColumn(0 , "船舰名字" , LVCFMT_LEFT , 100);
  m_list.InsertColumn(1 , "建造金属" , LVCFMT_LEFT , 80);
  m_list.InsertColumn(2 , "建造晶体" , LVCFMT_LEFT , 80);
  m_list.InsertColumn(3 , "建造重氢" , LVCFMT_LEFT , 80);
  m_list.InsertColumn(4 , "建造时间" , LVCFMT_LEFT , 80); 
  m_list.InsertColumn(5 , "攻击能力" , LVCFMT_LEFT , 80); 
  m_list.InsertColumn(6 , "运载能力" , LVCFMT_LEFT , 80); 
  m_list.InsertColumn(7 , "飞行速度" , LVCFMT_LEFT , 80); 
  m_list.InsertColumn(8 , "技术需求" , LVCFMT_LEFT , 250);

  for(int i = 0 ; i < BOAT_MAX ; ++i)
  {
    info.Format("%s" , BOATS_NAME[i]);
    m_list.InsertItem(i , info);

   //metal
    info.Format("%d" , BOATS_RESOURCE_NEED_BASE[i][0] );
    m_list.SetItemText(i , 1 , info);

    //crystal
    info.Format("%d" , BOATS_RESOURCE_NEED_BASE[i][1] );
    m_list.SetItemText(i , 2 , info);

    //diplogen
    info.Format("%d" , BOATS_RESOURCE_NEED_BASE[i][2] );
    m_list.SetItemText(i , 3 , info);

    //time
    double t = get_boat_produce_seconds(
                        GetDataPtr()->GetBuildingLevel(FACTORY_BUILDING_BOATYARD), //shipyard level
                        GetDataPtr()->GetBuildingLevel(FACTORY_BUILDING_NANITE),   //nanitefactory level
                        BOATS_RESOURCE_NEED_BASE[i][0] , 
                        BOATS_RESOURCE_NEED_BASE[i][1], 
                        1.0);
    
    HighFrequencyElapsedTimer timer;
    timer.Init(t * 1000);
    m_list.SetItemText(i , 4 , timer.ToCString());

    //attack force
    info.Format("%d" , UINT(SHIP_ATTACK_FORCE_BASE[i] * (1 + 0.1 * GetDataPtr()->GetResearchLevel(RESEARCH_WEAPON))) );
    m_list.SetItemText(i , 5 , info);

    //transfer capacity force    
    info.Format("%d" , SHIP_TRANSFER_CAPACITY[i] );
    m_list.SetItemText(i , 6 , info);

    //speed
    info.Format("%d" , kernel_.GetShipSpeed(ITEM_TYPE(i) , 0));
    m_list.SetItemText(i , 7 , info);

    //tech needed    
    m_list.SetItemText(i , 8 , Boats_Entry(i)->GetTechNeeded());
   }
}
开发者ID:chengpenghui,项目名称:UGame,代码行数:60,代码来源:pagedocuments.cpp


示例3: DEBUG_VERIFY

size_t KString::Find(LPCTSTR pSString, size_t szStart) const
{
	DEBUG_VERIFY(szStart <= GetLength());

	LPCTSTR ptr = _tcsstr(GetDataPtr() + szStart, pSString);

	return ptr ? ptr - GetDataPtr() : UINT_MAX;
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:8,代码来源:kstring.cpp


示例4: assert

BOOL CPageBoatyard::IsResourceEnough(int index , UINT number)
{
  assert(index >= 0 && index < boat_keeper_->Size());
  if(GetDataPtr()->GetResource(RESOURCE_METAL) >=   (Boats_Entry(index)->GetProduceMinal() * number)    &&
    GetDataPtr()->GetResource(RESOURCE_CRYSTAL) >=  (Boats_Entry(index)->GetProduceCrystal()  * number) &&
    GetDataPtr()->GetResource(RESOURCE_DIPLOGEN) >= (Boats_Entry(index)->GetProduceDiplogen() * number))
    return TRUE;
  return FALSE;
}
开发者ID:chengpenghui,项目名称:UGame,代码行数:9,代码来源:pageboatyard.cpp


示例5: wcslen

TWideString::TWideString(LPCWSTR pWideString)
{
	const size_t szLength = wcslen(pWideString);

	AllocateAdd(szLength + 1);

	memcpy(GetDataPtr(), pWideString, szLength * sizeof(WCHAR));

	GetDataPtr()[szLength] = 0;
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:10,代码来源:kstring.cpp


示例6: strlen

TAnsiString::TAnsiString(LPCSTR pAnsiString)
{
	const size_t szLength = strlen(pAnsiString);

	AllocateAdd(szLength + 1);

	memcpy(GetDataPtr(), pAnsiString, szLength * sizeof(CHAR));

	GetDataPtr()[szLength] = 0;
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:10,代码来源:kstring.cpp


示例7: KString

KString KString::operator + (TAlignment Alignment) const
{
	if(Alignment == ALIGNMENT_MIN)
		return KString(GetDataPtr(), GetLength(), TEXT("min"), 3);

	if(Alignment == ALIGNMENT_MID)
		return KString(GetDataPtr(), GetLength(), TEXT("mid"), 3);

	if(Alignment == ALIGNMENT_MAX)
		return KString(GetDataPtr(), GetLength(), TEXT("max"), 3);

	INITIATE_FAILURE;
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:13,代码来源:kstring.cpp


示例8: _stprintf

KString KString::operator + (float fValue) const
{
	TCHAR Buf[32];
	_stprintf(Buf, TEXT("%.2f"), fValue);

	return KString(GetDataPtr(), GetLength(), Buf, _tcslen(Buf));
};
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:7,代码来源:kstring.cpp


示例9: WTRACE

void* MMsgRoutingUnsubscribeDataObject::Pack(void)
{
	WTRACE("MMsgRoutingUnsubscribeDataObject::Pack");

	SetServiceType(WONMsg::MiniRoutingServer);
	SetMessageType(WONMsg::RoutingUnsubscribeDataObject);
	RoutingServerMessage::Pack();

	WDBG_LL("MMsgRoutingUnsubscribeDataObject::Pack Appending message data");

	// append the client/group id
	AppendClientOrGroupId(mLinkId);
	
	// append the datatype length followed by the datatype itself
	AppendByte(mDataType.size());
	AppendBytes(mDataType.size(), mDataType.data());

	// append the flags
	unsigned char aFlags = 0;
	if (mExactOrRecursiveFlag) aFlags |= 0x01;
	if (mGroupOrMembersFlag)   aFlags |= 0x02;
	AppendByte(aFlags);

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:25,代码来源:MMsgRoutingUnsubDataObject.cpp


示例10: WTRACE

void* MMsgRoutingCreateGroup::Pack(void)
{
	WTRACE("MMsgRoutingCreateGroup::Pack");

	SetServiceType(WONMsg::MiniRoutingServer);
	SetMessageType(WONMsg::RoutingCreateGroup);
	RoutingServerMessage::Pack();

	WDBG_LL("MMsgRoutingCreateGroup::Pack Appending message data");

	// append group name
	AppendGroupName(mGroupName);

	// append flags
	unsigned char aFlags = 0;
	if (mIsPublic)             aFlags |= 0x01;
	if (mAnnounceGroupChanges) aFlags |= 0x02;
	AppendByte(aFlags);

	// append client count
	_ASSERT(mClientList.size() <= USHRT_MAX);
	AppendShort(mClientList.size());

	// append client list
	std::list<unsigned short>::iterator itr = mClientList.begin();
	while (itr != mClientList.end())
		AppendClientId(*(itr++));

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:30,代码来源:MMsgRoutingCreateGroup.cpp


示例11: TCPSendDataCallback

err_t
TCPSendDataCallback(struct netif *netif, struct pbuf *p, struct ip_addr *dest)
{
    NDIS_STATUS NdisStatus;
    PNEIGHBOR_CACHE_ENTRY NCE;
    IP_PACKET Packet = { 0 };
    IP_ADDRESS RemoteAddress, LocalAddress;
    PIPv4_HEADER Header;
    UINT i;
    struct pbuf *p1;
    
    /* The caller frees the pbuf struct */
    
    if (((*(u8_t*)p->payload) & 0xF0) == 0x40)
    {
        Header = p->payload;
        
        LocalAddress.Type = IP_ADDRESS_V4;
        LocalAddress.Address.IPv4Address = Header->SrcAddr;
        
        RemoteAddress.Type = IP_ADDRESS_V4;
        RemoteAddress.Address.IPv4Address = Header->DstAddr;
    }
    else 
    {
        return ERR_IF;
    }

    if (!(NCE = RouteGetRouteToDestination(&RemoteAddress)))
    {
        return ERR_RTE;
    }
    
    NdisStatus = AllocatePacketWithBuffer(&Packet.NdisPacket, NULL, p->tot_len);
    if (NdisStatus != NDIS_STATUS_SUCCESS)
    {
        return ERR_MEM;
    }
    
    GetDataPtr(Packet.NdisPacket, 0, (PCHAR*)&Packet.Header, &Packet.ContigSize);
    
    for (i = 0, p1 = p; i < p->tot_len; i += p1->len, p1 = p1->next)
    {
        ASSERT(p1);
        RtlCopyMemory(((PUCHAR)Packet.Header) + i, p1->payload, p1->len);
    }
    
    Packet.HeaderSize = sizeof(IPv4_HEADER);
    Packet.TotalSize = p->tot_len;
    Packet.SrcAddr = LocalAddress;
    Packet.DstAddr = RemoteAddress;
    
    if (!NT_SUCCESS(IPSendDatagram(&Packet, NCE, TCPPacketSendComplete, NULL)))
    {
        FreeNdisPacket(Packet.NdisPacket);
        return ERR_IF;
    }
    
    return 0;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:60,代码来源:if.c


示例12: WTRACE

// TMsgDirFindServiceReply::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgDirFindServiceReply::Pack(void)
{
	WTRACE("TMsgDirFindServiceReply::Pack");
	SetServiceType(WONMsg::DirServer);
	SetMessageType(WONMsg::DirFindServiceReply);
	TMessage::Pack();

	WDBG_LL("TMsgDirFindServiceReply::Pack Appending message data");
	AppendShort(static_cast<short>(mStatus));

	// Service info only sent if status is ok
	if (mStatus == WONMsg::StatusCommon_Success)
	{
		Append_PW_STRING(mService.mPath);
		Append_PW_STRING(mService.mName);
		Append_PW_STRING(mService.mDisplayName);
		Append_PW_STRING(mService.mVersion);
		Append_PW_STRING(mService.mProtoName);
		Append_PW_STRING(mService.mProtoVersion);
		Append_PW_STRING(mService.mNetAddress);
		AppendLong(mService.mLifespan);
		AppendLong(mService.mCreated);
		AppendShort(mService.mBlobLen);
		AppendBytes(mService.mBlobLen, mService.mBlob);
	}

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:32,代码来源:TMsgDirFindService.cpp


示例13: WTRACE

// SMsgDirG2ModifyService::Pack
// Virtual method from SmallMessage.  Packs data into message buffer.
void*
SMsgDirG2ModifyService::Pack(void)
{
	WTRACE("SMsgDirG2ModifyService::Pack");
	SetKeyType(KT_SERVICE);
	SetServiceType(WONMsg::SmallDirServerG2);
	if (IsExtended())
	{
		SetMessageType(WONMsg::DirG2ModifyServiceEx);
		SetExtended(true, true);
	}
	else
		SetMessageType(WONMsg::DirG2ModifyService);

	SMsgDirG2UpdateExtendBase::Pack();
	AppendByte(mEntityFlags);
	PackKey(*this);
	Append_PW_STRING(mNewName);

	unsigned char aLen = mNewNetAddress.size();
	AppendByte(aLen);
	if (aLen > 0)
		AppendBytes(aLen, mNewNetAddress.data());

	Append_PW_STRING(mNewDisplayName);
	AppendLong(mNewLifespan);
	PackExtended();
	PackPeerData();

	return GetDataPtr();
}
开发者ID:vgck,项目名称:opendr2,代码行数:33,代码来源:SMsgDirG2ModifyService.cpp


示例14: WTRACE

void* MMsgRoutingModifyDataObject::Pack(void)
{
	WTRACE("MMsgRoutingModifyDataObject::Pack");

	SetServiceType(WONMsg::MiniRoutingServer);
	SetMessageType(WONMsg::RoutingModifyDataObject);
	RoutingServerMessage::Pack();

	WDBG_LL("MMsgRoutingModifyDataObject::Pack Appending message data");

	// append the client/group id
	AppendClientOrGroupId(mLinkId);
	
	// append the datatype, preceded by datatype length
	AppendByte(mDataType.size());
	AppendBytes(mDataType.size(), mDataType.data());
	
	// append the offset
	AppendShort(mOffset);

	// append the IsInsert flag
	AppendBool(mIsInsert);

	// append the data length followed by the data itself
	AppendShort(mData.size());
	AppendBytes(mData.size(), mData.data());

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:29,代码来源:MMsgRoutingModifyDataObject.cpp


示例15: WTRACE

// TMsgAuth1Complete::Pack
// Virtual method from TMessage.  Packs data into message buffer and
// sets the new message length.
void*
TMsgAuth1Complete::Pack(void)
{
	WTRACE("TMsgAuth1Complete::Pack");
	SetServiceType(WONMsg::Auth1PeerToPeer);
	SetMessageType(WONMsg::Auth1Complete);
	TMsgAuthRawBufferBase::Pack();

	WDBG_LL("TMsgAuth1Complete::Pack Appending message data");
	AppendShort(static_cast<short>(mStatus));

	// Append error info if status implies failure
	if (mStatus < 0)
	{
		WDBG_LL("TMsgAuth1Complete::Pack Failure status, append error info");
		AppendShort(mErrList.size());
		ErrorList::iterator anItr(mErrList.begin());
		for (; anItr != mErrList.end(); anItr++)
			Append_PA_STRING(*anItr);
	}

	// Otherwise append success info
	else
	{
		WDBG_LL("TMsgAuth1Complete::Pack Success status, append secret and optional session");
		PackRawBuf();
		if (mSessionId != 0) AppendShort(mSessionId);
	}

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:34,代码来源:TMsgAuth1PeerToPeer.cpp


示例16: WTRACE

void* MMsgRoutingSendData::Pack(void)
{
	WTRACE("MMsgRoutingSendData::Pack");

	SetServiceType(WONMsg::MiniRoutingServer);
	SetMessageType(WONMsg::RoutingSendData);
	RoutingServerMessage::Pack();

	WDBG_LL("MMsgRoutingSendData::Pack Appending message data");

	// append the flags
	unsigned char aFlags = 0;
	if (mShouldSendReply)    aFlags |= 0x01;
	if (mIncludeExcludeFlag) aFlags |= 0x02;
	AppendByte(aFlags);

	// append the message length and data
	_ASSERT(mData.size() <= USHRT_MAX);
	AppendShort(mData.size());
	AppendBytes(mData.size(), mData.data());
	
	// append the addressee list
	AppendAddresseeList(this);

	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:26,代码来源:MMsgRoutingSendData.cpp


示例17: WTRACE

// SMsgDirG2ExplicitSetDataObjects::Pack
// Virtual method from SmallMessage.  Packs data into message buffer.
void*
SMsgDirG2ExplicitSetDataObjects::Pack(void)
{
	WTRACE("SMsgDirG2ExplicitSetDataObjects::Pack");
	SetServiceType(WONMsg::SmallDirServerG2);
	SetMessageType(mKeyType == KT_SERVICE ? WONMsg::DirG2ServiceExplicitSetDataObjects : WONMsg::DirG2DirectoryExplicitSetDataObjects);
	SMsgDirG2UpdateBase::Pack();

	PackKey(*this);

	AppendShort(mObjects.size());
	ExplicitDOInfoList::iterator anItr(mObjects.begin());
	for (; anItr != mObjects.end(); anItr++)
	{
		AppendByte(static_cast<unsigned char>(anItr->mSetMode));

		unsigned char aTypeLen = anItr->mData.GetDataType().size();
		AppendByte(aTypeLen);
		if (aTypeLen > 0)
			AppendBytes(aTypeLen, anItr->mData.GetDataType().data());

		unsigned short aDataLen = anItr->mData.GetData().size();
		AppendShort(aDataLen);
		if (aDataLen > 0)
			AppendBytes(aDataLen, anItr->mData.GetData().data());
	}

	PackPeerData();
	return GetDataPtr();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:32,代码来源:SMsgDirG2ExplicitSetDOs.cpp


示例18: PL_ASSERT

// Set all columns by value into this tuple.
void Tuple::SetValue(oid_t column_offset, const common::Value &value) {
  PL_ASSERT(tuple_schema);
  PL_ASSERT(tuple_data);

  const common::Type::TypeId type = tuple_schema->GetType(column_offset);

  const bool is_inlined = tuple_schema->IsInlined(column_offset);
  char *value_location = GetDataPtr(column_offset);
  UNUSED_ATTRIBUTE int32_t column_length =
      tuple_schema->GetLength(column_offset);
  if (is_inlined == false)
    column_length = tuple_schema->GetVariableLength(column_offset);

  // const bool is_in_bytes = false;
  // Allocate in heap or given data pool depending on whether a pool is provided
  // Skip casting if type is same
  if (type == value.GetTypeId()) {
    value.SerializeTo(value_location, is_inlined, nullptr);
  } else {
    common::Value *casted_value = value.CastAs(type);
    casted_value->SerializeTo(value_location, is_inlined, nullptr);
    // Do not clean up immediately
    // casted_value.SetCleanUp(false);
  }
}
开发者ID:ranxian,项目名称:peloton-1,代码行数:26,代码来源:tuple.cpp


示例19: GetDataPtr

LPCWSTR CDialogItemTemplate::GetClassName() const
{
	const WORD* pw = GetDataPtr();
	if ( *pw == 0xFFFF )
		return (LPCWSTR) MAKEINTATOM(pw[1]);
	else
		return (LPCWSTR) pw;
}
开发者ID:EmuxEvans,项目名称:sailing,代码行数:8,代码来源:DialogItemTemplate.cpp


示例20: GetDataPtr

void CPageBoatyard::CancelCurrentProducing()
{
  GetDataPtr()->IncreaseResource(buff_cosume_metal , buff_cosume_cryst ,  buff_cosume_diplo);
  GetCommander()->Notify_Resource_Changed();
  is_producing_ = false;
  SetWorkFlag(false);
  UpdateItemText();
}
开发者ID:chengpenghui,项目名称:UGame,代码行数:8,代码来源:pageboatyard.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDataViewPeer函数代码示例发布时间:2022-05-30
下一篇:
C++ GetDataNode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap