本文整理汇总了C++中GetHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHeader函数的具体用法?C++ GetHeader怎么用?C++ GetHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHeader函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetHeader
void BeaconTransmitter::Configure(const std::string& name, unsigned int protocolID, unsigned int listenerPort, unsigned int serverPort, Serializable* userData)
{
GetHeader().GetData().SetName(name);
GetHeader().GetData().mProtocolID = protocolID;
mListenerPort = listenerPort;
GetHeader().GetData().mServerPort = serverPort;
mpUserData = userData;
mIsConfigured = true;
}
开发者ID:Danathus,项目名称:net-set-go,代码行数:10,代码来源:Beacon.cpp
示例2: GetHeader
void STRING::assign(const char *cstr, int len) {
STRING_HEADER* this_header = GetHeader();
this_header->used_ = 0; // dont bother copying data if need to realloc
char* this_cstr = ensure_cstr(len + 1); // +1 for '\0'
this_header = GetHeader(); // for realloc
memcpy(this_cstr, cstr, len);
this_cstr[len] = '\0';
this_header->used_ = len + 1;
assert(InvariantOk());
}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:12,代码来源:strngs.cpp
示例3: memcpy
char* Packet::GetPacket(){
if (completebuffer){
if (!m_bSplitted)
memcpy(completebuffer,GetHeader(),6);
return completebuffer;
}
else{
delete[] tempbuffer;
tempbuffer = NULL; // 'new' may throw an exception
tempbuffer = new char[size+10];
memcpy(tempbuffer,GetHeader(),6);
memcpy(tempbuffer+6,pBuffer,size);
return tempbuffer;
}
}
开发者ID:SomeSupport,项目名称:eMule,代码行数:15,代码来源:packets.cpp
示例4: FastCheck
bool FastCheck() const
{
if (Size < sizeof(RawHeader))
{
return false;
}
const RawHeader& header = GetHeader();
BOOST_STATIC_ASSERT(sizeof(header.ID) == sizeof(FDI_ID));
if (0 != std::memcmp(header.ID, FDI_ID, sizeof(FDI_ID)))
{
return false;
}
const std::size_t dataOffset = fromLE(header.DataOffset);
if (dataOffset < sizeof(header) ||
dataOffset > Size)
{
return false;
}
const uint_t cylinders = fromLE(header.Cylinders);
if (!Math::InRange(cylinders, MIN_CYLINDERS_COUNT, MAX_CYLINDERS_COUNT))
{
return false;
}
const uint_t sides = fromLE(header.Sides);
if (!Math::InRange(sides, MIN_SIDES_COUNT, MAX_SIDES_COUNT))
{
return false;
}
return true;
}
开发者ID:fgroen,项目名称:zxtune,代码行数:30,代码来源:fulldiskimage.cpp
示例5: GetSchema
Tile *Tile::CopyTile(BackendType backend_type) {
auto schema = GetSchema();
bool tile_columns_inlined = schema->IsInlined();
auto allocated_tuple_count = GetAllocatedTupleCount();
// Create a shallow copy of the old tile
TileGroupHeader *new_header = GetHeader();
Tile *new_tile = TileFactory::GetTile(
backend_type, INVALID_OID, INVALID_OID, INVALID_OID, INVALID_OID,
new_header, *schema, tile_group, allocated_tuple_count);
PL_MEMCPY(static_cast<void *>(new_tile->data), static_cast<void *>(data),
tile_size);
// Do a deep copy if some column is uninlined, so that
// the values in that column point to the new pool
if (!tile_columns_inlined) {
auto uninlined_col_cnt = schema->GetUninlinedColumnCount();
// Go over each uninlined column, making a deep copy
for (oid_t col_itr = 0; col_itr < uninlined_col_cnt; col_itr++) {
auto uninlined_col_offset = schema->GetUninlinedColumn(col_itr);
// Copy the column over to the new tile group
for (oid_t tuple_itr = 0; tuple_itr < allocated_tuple_count;
tuple_itr++) {
type::Value val =
(new_tile->GetValue(tuple_itr, uninlined_col_offset));
new_tile->SetValue(val, tuple_itr, uninlined_col_offset);
}
}
}
return new_tile;
}
开发者ID:Michael-Tieying-Zhang,项目名称:peloton,代码行数:35,代码来源:tile.cpp
示例6: GetHeader
SubMediaPiecePtr Storage::GetSubPiece(UINT pieceIndex, UINT8 subPieceIndex) const
{
//SubMediaPiecePtr subPiece = m_unfinishedDataPieces.GetSubPiece(pieceIndex, subPieceIndex);
//if ( subPiece )
// return subPiece;
SubMediaPiecePtr subPiece;
PieceInfo pieceInfo = this->GetPieceInfo(pieceIndex);
if (pieceInfo.IsValid())
{
// 从piece中提取sub piece
subPiece = pieceInfo.GetSubPiece(subPieceIndex);
//LIVE_ASSERT( subPiece );
}
else
{
// 检查headers
//subPiece = m_unfinishedHeaderPieces.GetSubPiece(pieceIndex, subPieceIndex);
//if ( subPiece )
// return subPiece;
MediaHeaderPiecePtr headerPiece = GetHeader(pieceIndex);
if ( headerPiece )
{
subPiece = SubMediaPiecePtr(headerPiece->GetSubPiece(subPieceIndex));
//LIVE_ASSERT( subPiece );
}
}
return subPiece;
}
开发者ID:huangyt,项目名称:MyProjects,代码行数:28,代码来源:MediaStorage.cpp
示例7: SetAttribute
void CListUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
if( _tcscmp(pstrName, _T("header")) == 0 ) GetHeader()->SetVisible(_tcscmp(pstrValue, _T("hidden")) != 0);
else if( _tcscmp(pstrName, _T("footer")) == 0 ) GetFooter()->SetVisible(_tcscmp(pstrValue, _T("hidden")) != 0);
else if( _tcscmp(pstrName, _T("expanding")) == 0 ) SetExpanding(_tcscmp(pstrValue, _T("true")) == 0);
else CVerticalLayoutUI::SetAttribute(pstrName, pstrValue);
}
开发者ID:0buffer,项目名称:DirectUI,代码行数:7,代码来源:UIList.cpp
示例8: GetHeader
size_t BindTransmitter::Size() const
{
const size_t size = GetHeader().Size() + systemId_.Size() + password_.Size() + systemType_.Size() \
+ interfaceVersion_.Size() + addrTon_.Size() + addrNpi_.Size() + addressRange_.Size();
return size;
}
开发者ID:neugenn,项目名称:SMPPSim,代码行数:7,代码来源:BindTransmitter.cpp
示例9: GetHeader
bool YL_CHTTPRequest::GetHeaderItem( const string& strItemName,string& strContent )
{
long lHeadLen = 0;
unsigned char* pszHead = GetHeader( lHeadLen );
if( pszHead != NULL && lHeadLen > 0)
{
char* pTmpBuf = new char[lHeadLen+1];
memcpy(pTmpBuf,pszHead,lHeadLen);
pTmpBuf[lHeadLen] = '\0';
char* pPos = strstr( pTmpBuf,strItemName.c_str());
if( pPos == NULL )
{
delete pTmpBuf;
return false;
}
pPos = strstr( pPos+1,":");
if( pPos == NULL )
{
delete pTmpBuf;
return false;
}
while (*++pPos)
{
if (*pPos != ' ')
break;
}
char* pPos2 = strstr( pPos,"\r\n");
*pPos2 = '\0';
strContent = pPos;
delete[] pTmpBuf;
return true;
}
return false;
}
开发者ID:2Dou,项目名称:PlayBox,代码行数:35,代码来源:HTTPRequest.cpp
示例10: add_or_update_alarm
int add_or_update_alarm(uint8_t hour, uint8_t min, uint8_t mode,
uint8_t repeat_factor, char *name)
{
pthread_mutex_t *bucket_mtx = GetLock(hour, min);
pthread_mutex_lock(bucket_mtx);
AlarmClockInfo *header = GetHeader(hour, min);
AlarmClockInfo *temp = header;
// Check whether an existing entry should be updated
while (temp)
{
if (temp->hour == hour && temp->min == min)
{
temp->mode = mode;
temp->repeat_factor = repeat_factor;
strcpy(temp->name, name);
pthread_mutex_unlock(bucket_mtx);
return 0;
}
temp = temp->next;
}
// A new entry is inserted
AlarmClockInfo *naci = CreateNewInfo(hour,min,mode,repeat_factor,name);
naci->next = header;
*AC_TABLE_ENTRY(hour,min) = naci;
pthread_mutex_unlock(bucket_mtx);
return 1;
}
开发者ID:Milchdealer,项目名称:Atlas,代码行数:27,代码来源:alarm_clock.c
示例11: cancel_alarm
// Return 1 if found and removed, otherwise return 0
int cancel_alarm(uint8_t hour, uint8_t min, int play)
{
pthread_mutex_t *bucket_mtx = GetLock(hour, min);
pthread_mutex_lock(bucket_mtx);
AlarmClockInfo *cand = GetHeader(hour, min);
AlarmClockInfo *prev = NULL;
while (cand)
{
if (cand->hour == hour && cand->min == min)
{
// Optionally, play the alarm here before essentially removing it
// ...
if (play)
; // sound an alarm
if (!prev) *AC_TABLE_ENTRY(hour, min) = cand->next;
else prev->next = cand->next;
free(cand);
pthread_mutex_unlock(bucket_mtx);
return 1;
}
prev = cand;
cand = cand->next;
}
pthread_mutex_unlock(bucket_mtx);
return 0;
}
开发者ID:Milchdealer,项目名称:Atlas,代码行数:28,代码来源:alarm_clock.c
示例12: FastCheck
bool FastCheck() const
{
if (Size <= sizeof(RawHeader))
{
return false;
}
const RawHeader& header = GetHeader();
const uint_t endOfBlock = fromLE(header.LastSrcRestBytes) + 1;
const uint_t lastBytesAddr = endOfBlock - LAST_BYTES_COUNT;
const uint_t bitStreamAddr = lastBytesAddr - fromLE(header.SizeOfPacked);
const uint_t srcPacked = fromLE(header.SrcPacked);
if (bitStreamAddr == srcPacked)
{
//move forward
}
else if (lastBytesAddr == srcPacked + 1)
{
//move backward
}
else
{
return false;
}
const std::size_t usedSize = GetUsedSize();
return Math::InRange(usedSize, sizeof(header), Size);
}
开发者ID:fgroen,项目名称:zxtune,代码行数:27,代码来源:mspack.cpp
示例13: GetHeader
//Draw the border and background, leave clip set to the windows client area
bool SummerfaceWindow::PrepareDraw ()
{
if(UseBorder)
{
ESVideo::SetClip(Area(0, 0, ESVideo::GetScreenWidth(), ESVideo::GetScreenHeight()));
//TODO: Make border color
ESVideo::FillRectangle(Area(Region.X, Region.Y, Region.Width, BorderWidth), 0xFFFFFFFF);
ESVideo::FillRectangle(Area(Region.X + BorderWidth, Region.Bottom(), Region.Width, BorderWidth), 0x00000080);
ESVideo::FillRectangle(Area(Region.X, Region.Bottom() - BorderWidth, Region.Width, BorderWidth), 0xFFFFFFFF);
ESVideo::FillRectangle(Area(Region.X, Region.Y + BorderWidth, BorderWidth, Region.Height - BorderWidth * 2), 0xFFFFFFFF);
ESVideo::FillRectangle(Area(Region.Right(), Region.Y + BorderWidth, BorderWidth, Region.Height - BorderWidth), 0x00000080);
ESVideo::FillRectangle(Area(Region.Right() - BorderWidth, Region.Y + BorderWidth, BorderWidth, Region.Height - BorderWidth * 2), 0xFFFFFFFF);
ESVideo::FillRectangle(Client, Colors::BackGround);
ESVideo::SetClip(Client);
std::string header = GetHeader();
if(!header.empty())
{
FontManager::GetBigFont()->PutString(header.c_str(), 1, 1, Colors::Normal, true);
ESVideo::FillRectangle(Area(0, FontManager::GetBigFont()->GetHeight() + 1, Client.Width, 1), 0xFFFFFFFF);
ESVideo::SetClip(Area(Client.X, Client.Y + FontManager::GetBigFont()->GetHeight() + 3, Client.Width, Client.Height - (FontManager::GetBigFont()->GetHeight() + 3)));
}
}
else
{
ESVideo::SetClip(Region);
}
return Draw();
}
开发者ID:cdenix,项目名称:psmame,代码行数:35,代码来源:SummerfaceWindow.cpp
示例14: GetHeader
SysStatus
MPMsgMgr::MsgSync::send(DispatcherID dspid)
{
MsgHeader *const hdr = GetHeader(this);
SysStatus rc;
MPMsgMgr *targetMgr;
rc = DREF(hdr->manager->getRegistry())->lookupMgr(dspid, targetMgr);
tassert(_SUCCESS(rc), err_printf("MPMsgAsync: lookupMgr failed.\n"));
hdr->sender = Scheduler::GetCurThread();
targetMgr->addPendingSend(hdr);
/*
* This is the trivial implementation, where we immediately block when
* sending a cross processor message. We have a more sophisticated
* algorithm which attempts to spin for a while and then blocks if
* information in the reply queue is not for us. FIXME, implement this
*/
while (hdr->sender != Scheduler::NullThreadID) {
Scheduler::Block();
}
/*
* With the message queue implementation, message returned is the same
* as message sent.
*/
return 0;
}
开发者ID:BillTheBest,项目名称:k42,代码行数:27,代码来源:MPMsgMgr.C
示例15: LOG_TRACE
// Return false if the tuple's table (tile group) is dropped.
// In such case, this recycled tuple can not be added to the recycled_list.
// Since no one will use it any more, keeping track of it is useless.
// Note that, if we drop a single tile group without dropping the whole table,
// such assumption is problematic.
bool GCManager::ResetTuple(const TupleMetadata &tuple_metadata) {
auto &manager = catalog::Manager::GetInstance();
auto tile_group = manager.GetTileGroup(tuple_metadata.tile_group_id);
// During the resetting, a table may deconstruct because of the DROP TABLE request
if (tile_group == nullptr) {
LOG_TRACE("Garbage tuple(%u, %u) in table %u no longer exists",
tuple_metadata.tile_group_id, tuple_metadata.tuple_slot_id,
tuple_metadata.table_id);
return false;
}
// From now on, the tile group shared pointer is held by us
// It's safe to set headers from now on.
auto tile_group_header = tile_group->GetHeader();
// Reset the header
tile_group_header->SetTransactionId(tuple_metadata.tuple_slot_id,
INVALID_TXN_ID);
tile_group_header->SetBeginCommitId(tuple_metadata.tuple_slot_id, MAX_CID);
tile_group_header->SetEndCommitId(tuple_metadata.tuple_slot_id, MAX_CID);
tile_group_header->SetPrevItemPointer(tuple_metadata.tuple_slot_id,
INVALID_ITEMPOINTER);
tile_group_header->SetNextItemPointer(tuple_metadata.tuple_slot_id,
INVALID_ITEMPOINTER);
PL_MEMSET(
tile_group_header->GetReservedFieldRef(tuple_metadata.tuple_slot_id), 0,
storage::TileGroupHeader::GetReservedSize());
LOG_TRACE("Garbage tuple(%u, %u) in table %u is reset",
tuple_metadata.tile_group_id, tuple_metadata.tuple_slot_id,
tuple_metadata.table_id);
return true;
}
开发者ID:aelroby,项目名称:peloton,代码行数:40,代码来源:gc_manager.cpp
示例16:
size_t
DWARFMappedHash::MemoryTable::FindCompleteObjCClassByName (const char *name,
DIEArray &die_offsets,
bool must_be_implementation)
{
DIEInfoArray die_info_array;
if (FindByName(name, die_info_array))
{
if (must_be_implementation && GetHeader().header_data.ContainsAtom (eAtomTypeTypeFlags))
{
// If we have two atoms, then we have the DIE offset and
// the type flags so we can find the objective C class
// efficiently.
DWARFMappedHash::ExtractTypesFromDIEArray (die_info_array,
UINT32_MAX,
eTypeFlagClassIsImplementation,
die_offsets);
}
else
{
// We don't only want the one true definition, so try and see
// what we can find, and only return class or struct DIEs.
// If we do have the full implementation, then return it alone,
// else return all possible matches.
const bool return_implementation_only_if_available = true;
DWARFMappedHash::ExtractClassOrStructDIEArray (die_info_array,
return_implementation_only_if_available,
die_offsets);
}
}
return die_offsets.size();
}
开发者ID:wiltonlazary,项目名称:swift-lldb,代码行数:32,代码来源:HashedNameToDIE.cpp
示例17: GetHeader
void BaseWordForm::PrepareHeader()
{
Header *header = GetHeader();
if (header)
{
if (!__pICHeader)
__pICHeader = Utils::GetBitmapN("ic_header.png");
header->SetTitleIcon(__pICHeader);
header->RemoveAllButtons();
header->RemoveAllItems();
if (__pContextMenu)
{
ButtonItem btnMenu;
btnMenu.Construct(BUTTON_ITEM_STYLE_ICON, ID_MENU);
btnMenu.SetIcon(BUTTON_ITEM_STATUS_NORMAL, Utils::GetBitmapN(L"ic_menu.png"));
header->SetButton(BUTTON_POSITION_RIGHT, btnMenu);
}
// ButtonItem btnAddWord;
// btnAddWord.Construct(BUTTON_ITEM_STYLE_ICON, ID_ADD_WORD);
// //btnAddWord.SetText(GetString("IDS_ADD_WORD_BUTTON"));
// btnAddWord.SetIcon(BUTTON_ITEM_STATUS_NORMAL, Utils::GetBitmap(L"ic_add_word.png"));
// HeaderItem headerItem1;
// header->SetTitleText("voc4u");
// header->SetButton(BUTTON_POSITION_RIGHT, btnAddWord);
// header->PlayWaitingAnimation(HEADER_ANIMATION_POSITION_BUTTON_LEFT);
header->SetTitleText("Voc4u");
header->AddActionEventListener(*this);
}
}
开发者ID:m1uan,项目名称:voc4u_bada,代码行数:33,代码来源:BaseWordForm.cpp
示例18: wxLogInfo
void edbPackage::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
{
if (!expandedKids)
{
expandedKids=true;
browser->RemoveDummyChild(this);
// Log
wxLogInfo(wxT("Adding child object to package %s"), GetIdentifier().c_str());
browser->AppendCollection(this, packageFunctionFactory);
browser->AppendCollection(this, packageProcedureFactory);
browser->AppendCollection(this, packageVariableFactory);
}
if (properties)
{
CreateListColumns(properties);
properties->AppendItem(_("Name"), GetName());
properties->AppendItem(_("OID"), GetOid());
properties->AppendItem(_("Owner"), GetOwner());
properties->AppendItem(_("Header"), firstLineOnly(GetHeader()));
properties->AppendItem(_("Body"), firstLineOnly(GetBody()));
properties->AppendItem(_("ACL"), GetAcl());
properties->AppendItem(_("System package?"), GetSystemObject());
if (GetConnection()->EdbMinimumVersion(8, 2))
properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
}
}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:32,代码来源:edbPackage.cpp
示例19: GetItem
BOOL CItemList::OnLButtonDown(UINT flags, LPPOINT point, LPRECT prect )
{
DWORD i = GetItem( point, prect );
// Select items
SelectItem( i, TRUE, TRUE, ( GetKeyState( VK_CONTROL ) & 0x8000 ),
( GetKeyState( VK_SHIFT ) & 0x8000 ) != 0 );
// Set scroll information
if ( i < m_dwPtr && m_pIndex[ i ] != NULL &&
( m_pIndex[ i ]->flags & LIF_GROUP ) != 0 )
{
// Validate max scroll line
DWORD slm = GetScrollLineMax( prect );
DWORD cl = GetCurLine();
if ( cl > slm ) SetCurLine( slm );
} // end if
// Punt if item clicked
if ( i != MAXDWORD )return TRUE;
// Are we clicking a header resize area?
m_phii = GetHeader().GetHeaderResizeColumn( prect, point, m_lHScroll );
if ( m_phii != NULL )
{
m_phiiwidth = m_phii->width;
} // end if
// Save click location
m_lbuttondown.x = point->x; m_lbuttondown.y = point->y;
return FALSE;
}
开发者ID:sanyaade-webdev,项目名称:wpub,代码行数:33,代码来源:ItemList.cpp
示例20: GetHeader
int CWav::Load(const char* fn) {
GetHeader(fn, &m_PCM.length, &m_PCM.sample_per_sec, &m_PCM.play_time, &m_PCM.raw_offset);
FILE* fp = fopen(fn, "rb");
if (!fp) { return -1; }
fseek(fp, m_PCM.raw_offset, SEEK_SET);
m_PCM.raw = (short*)malloc(m_PCM.length * 2 * sizeof(short));
int idx = 0;
for(int i = 0; i < m_PCM.length; i++) {
short data;
fread(&data, 2, 1, fp);
m_PCM.raw[idx++] = data;
fread(&data, 2, 1, fp);
m_PCM.raw[idx++] = data;
}
fclose(fp);
m_AL.device = alcOpenDevice(NULL);
m_AL.context = alcCreateContext(m_AL.device, NULL);
alcMakeContextCurrent(m_AL.context);
alGenBuffers(1, &m_AL.buffer);
alBufferData(m_AL.buffer, AL_FORMAT_STEREO16, m_PCM.raw, m_PCM.length * 2 * sizeof(ALshort), 44100);
alGenSources(1, &m_AL.source);
alSourcei(m_AL.source, AL_BUFFER, m_AL.buffer);
// alSourcei(m_AL.source, AL_LOOPING, AL_TRUE );
Play();
return 0;
}
开发者ID:nnkgw,项目名称:perfume,代码行数:26,代码来源:wav.cpp
注:本文中的GetHeader函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论