本文整理匯總了C++中AddTag函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddTag函數的具體用法?C++ AddTag怎麽用?C++ AddTag使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddTag函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: CECTag
CEC_ConnState_Tag::CEC_ConnState_Tag(EC_DETAIL_LEVEL detail_level) : CECTag(EC_TAG_CONNSTATE,
(uint8)(
(theApp->IsConnectedED2K() ? 0x01 : 0x00)
|
(theApp->serverconnect->IsConnecting() ? 0x02 : 0x00)
|
(theApp->IsConnectedKad() ? 0x04 : 0x00)
|
(Kademlia::CKademlia::IsFirewalled() ? 0x08 : 0x00)
|
(Kademlia::CKademlia::IsRunning() ? 0x10 : 0x00)
))
{
if (theApp->IsConnectedED2K()) {
if ( theApp->serverconnect->GetCurrentServer() ) {
if (detail_level == EC_DETAIL_INC_UPDATE) {
// Send no full server tag, just the ECID of the connected server
AddTag(CECTag(EC_TAG_SERVER, theApp->serverconnect->GetCurrentServer()->ECID()));
} else {
AddTag(CEC_Server_Tag(theApp->serverconnect->GetCurrentServer(), detail_level));
}
}
AddTag(CECTag(EC_TAG_ED2K_ID, theApp->GetED2KID()));
} else if (theApp->serverconnect->IsConnecting()) {
AddTag(CECTag(EC_TAG_ED2K_ID, 0xffffffff));
}
AddTag(CECTag(EC_TAG_CLIENT_ID, theApp->GetID()));
}
示例2: CECTag
CEC_Category_Tag::CEC_Category_Tag(uint32 cat_index, wxString name, wxString path,
wxString comment, uint32 color, uint8 prio) : CECTag(EC_TAG_CATEGORY, cat_index)
{
AddTag(CECTag(EC_TAG_CATEGORY_PATH, path));
AddTag(CECTag(EC_TAG_CATEGORY_COMMENT, comment));
AddTag(CECTag(EC_TAG_CATEGORY_COLOR, color));
AddTag(CECTag(EC_TAG_CATEGORY_PRIO, prio));
AddTag(CECTag(EC_TAG_CATEGORY_TITLE, name));
}
示例3: AddTag
STagGroup::STagGroup( ){
//AddTag("/>",&CXML::parseEndEmptyElment);
AddTag("<![CDATA[",&CXML::parseCDataBegin);
AddTag("<!--",&CXML::parseComment);
AddTag("</",&CXML::parseEndElment);
AddTag("<?",&CXML::parseDeclaration);
AddTag("<",&CXML::parseLf);
//AddTag(">",&CXML::parseRf);
//AddTag("]]>",&CXML::parseCDataEnd);
}
示例4: PACKET_MGR_Init
/*-----------------------------------------------------------------------------
Data Members
------------------------------------------------------------------------------*/
PROTECTED PacketMgrInputBufferInfo packetMgrInputBuffer;
PROTECTED PacketMgrOutputBufferInfo packetMgrOutputBuffer;
PROTECTED pLIB_ARRAY_LIST_List packetMgrTagListenerList;
//*****************************************************************************
//
// Exported Functions
//
//*****************************************************************************
//****************************************************************************/
PUBLIC Result PACKET_MGR_Init( void )
{
Result result = PACKET_MGR_RESULT(SUCCESS);
LOG_Printf("Initializing Packet Mgr component\n");
ZeroMemory(&packetMgrInputBuffer, sizeof(PacketMgrInputBufferInfo));
ZeroMemory(&packetMgrOutputBuffer, sizeof(PacketMgrOutputBufferInfo));
SetMemory(&packetMgrInputBuffer.PacketInfo, PACKET_NULL_INDEX, sizeof(PacketMgrPacketInfo)*PACKET_MGR_INPUT_MAX_PACKETS);
packetMgrTagListenerList = NULL;
if( RESULT_IS_ERROR(result, OS_CREATE_MUTEX(&packetMgrInputBuffer.Mutex)) )
{
LOG_Printf("Failed to create read buffer mutex\n");
}
else if( RESULT_IS_ERROR(result, OS_CREATE_MUTEX(&packetMgrOutputBuffer.Mutex)) )
{
LOG_Printf("Failed to create write buffer mutex\n");
}
else if( RESULT_IS_ERROR(result, COMPOSITE_USB_RegisterReadVirComCallback(VirComReadCallback)) )
{
LOG_Printf("Failed to register virtual com read callback\n");
}
else if( RESULT_IS_ERROR(result, PacketMgrCreateTask()) )
{
LOG_Printf("Failed to create the packet mgr task\n");
}
else if( (packetMgrTagListenerList = LIB_ARRAY_LIST_CreateList(sizeof(PacketMgrTagListenerInfo), 1)) == NULL )
{
result = PACKET_MGR_RESULT(CREATE_LIS_LIST_FAIL);
LOG_Printf("Failed to create array list\n");
}
return result;
}
//****************************************************************************/
PUBLIC Result PACKET_MGR_PowerUp( void )
{
Result result = PACKET_MGR_RESULT_INIT();
return result;
}
//****************************************************************************/
PUBLIC Result PACKET_MGR_PowerDown( void )
{
Result result = PACKET_MGR_RESULT_INIT();
return result;
}
//****************************************************************************/
PUBLIC Result PACKET_MGR_AddPacket(pLIB_XML_Tag PacketData, uint32 PacketId)
{
Result result = PACKET_MGR_RESULT(SUCCESS);
uint32 packetSize, dataSize, pi, byteCount;
dataSize = strnlen(PacketData->Data, PACKET_MGR_OUTPUT_BUFFER_SIZE);
packetSize = strnlen(PacketData->Tag, LIB_XML_MAX_TAG_LEN)*2 + 5 + dataSize;
pi = packetMgrOutputBuffer.NextPacketIndex;
OS_TAKE_MUTEX(packetMgrOutputBuffer.Mutex);
if( (packetMgrOutputBuffer.BytesUsed + packetSize <= PACKET_MGR_OUTPUT_BUFFER_SIZE) &&
(packetMgrOutputBuffer.PacketsAvailable < PACKET_MGR_OUTPUT_MAX_PACKETS))
{
packetMgrOutputBuffer.PacketInfo[pi].StartIndex = packetMgrOutputBuffer.FirstFreeIndex;
AddTag(PacketData->Tag, TRUE);
if( packetMgrOutputBuffer.FirstFreeIndex + dataSize <= PACKET_MGR_OUTPUT_BUFFER_SIZE )
{
CopyMemory(&packetMgrOutputBuffer.Buffer[packetMgrOutputBuffer.FirstFreeIndex], PacketData->Data, dataSize);
}
else
//.........這裏部分代碼省略.........
示例5: Entity
Ball::Ball() : Entity(), texture(NULL)
{
AddTag("Ball");
SetCollider(new RectangleCollider(25.0f, 25.0f));
//Collision::AddRectangleCollider(this, 25.0f, 25.0f);
velocity = Vector2::right * 200.0f;
}
示例6: SubRead
static long SubRead ( LFA_FileRef inFileRef, RiffState & inOutRiffState, long parentid, UInt32 parentlen, UInt64 & inOutPosition )
{
long tag;
long subtype = 0;
long parentnum;
UInt32 len, total, childlen;
UInt64 oldpos;
total = 0;
parentnum = (long) inOutRiffState.tags.size() - 1;
UInt64 maxOffset = inOutPosition + parentlen;
while ( parentlen > 0 ) {
oldpos = inOutPosition;
ReadTag ( inFileRef, &tag, &len, &subtype, inOutPosition, maxOffset );
AddTag ( inOutRiffState, tag, len, inOutPosition, parentid, parentnum, subtype );
len += (len & 1); //padding byte
if ( subtype == 0 ) {
childlen = 8 + len;
} else {
childlen = 12 + SubRead ( inFileRef, inOutRiffState, subtype, len, inOutPosition );
}
if ( parentlen < childlen ) parentlen = childlen;
parentlen -= childlen;
total += childlen;
}
return total;
}
示例7: addDataFieldFromNDfield
int addDataFieldFromNDfield(NDskel *skl,NDfield *f, const char *name, int periodic)
{
int done=1;
if (f->ndims==1)
{
if (f->dims[0] == skl->nnodes)
AddTagFromVal(skl,NULL,f,name,periodic);
else if (f->dims[0] == skl->nsegs)
AddTagFromVal(skl,f,NULL,name,periodic);
else done=0;
}
else if ((f->ndims==2)&&(f->dims[1]==2)&&(f->dims[0]==skl->nsegs))
{
AddTagFromVal(skl,f,NULL,name,periodic);
}
else if (f->ndims==skl->ndims)
{
AddTag(skl,f,name,periodic);
}
else done=0;
if (!done)
{
fprintf(stderr,"ERROR adding data field from NDfield.\n");
fprintf(stderr," input field has wrong dimensions.\n");
fprintf(stderr," should be a grid, with dims [%ld] [%ld] [%ld,%ld] or ndims=%ld.\n",
(long)skl->nnodes,(long)skl->nsegs,(long)skl->nsegs,(long)2,(long)skl->ndims);
return -1;
}
return 0;
}
示例8: ProfileStart
/* Starts timer for given tag. If it does not exist yet,
it is added.
Note: 1. The tag may not be nested with the same name
2. The tag may not equal "" */
void ProfileStart (char* str_tag) {
entry_t* p_entry ;
/* One the first call, we must initialize the profiler. */
if (!g_init) {
Init () ;
}
/* Test for "" */
if (*str_tag == '\0') {
fprintf (stdout, "ERROR in ProfileStart: a tag may not be \"\". Call is denied.") ;
return ;
}
/* Search the entry with the given name */
p_entry = LookupTag (str_tag) ;
if (!p_entry) {
/* New tag, add it*/
p_entry = AddTag (str_tag) ;
if (!p_entry) {
fprintf (stdout, "WARNING in ProfileStart: no more space to store the tag (\"%s\"). Increase NUM_TAGS in \"profile.h\". Call is denied.\n", str_tag) ;
return ;
}
}
/* Check for nesting of equal tag.*/
if (Nested (str_tag)) {
fprintf (stdout, "ERROR in ProfileStart: nesting of equal tags not allowed (\"%s\"). Call is denied.\n", str_tag) ;
return ;
}
/* Increase the number of hits */
++p_entry->i_calls ;
/* Set the start time */
p_entry->start_time = clock () ;
p_entry->i_stopped = 0 ;
}
示例9: SetSpawnWeight
void CRoomTemplate::LoadFromKeyValues( const char *pRoomName, KeyValues *pKeyValues )
{
m_nTilesX = pKeyValues->GetInt( "TilesX", 1 );
m_nTilesY = pKeyValues->GetInt( "TilesY", 1 );
SetSpawnWeight( pKeyValues->GetInt( "SpawnWeight", MIN_SPAWN_WEIGHT ) );
SetFullName( pRoomName );
Q_strncpy( m_Description, pKeyValues->GetString( "RoomTemplateDescription", "" ), m_nMaxDescriptionLength );
Q_strncpy( m_Soundscape, pKeyValues->GetString( "Soundscape", "" ), m_nMaxSoundscapeLength );
SetTileType( pKeyValues->GetInt( "TileType", ASW_TILETYPE_UNKNOWN ) );
m_Tags.RemoveAll();
// search through all the exit subsections
KeyValues *pkvSubSection = pKeyValues->GetFirstSubKey();
bool bClearedExits = false;
while ( pkvSubSection )
{
// mission details
if ( Q_stricmp(pkvSubSection->GetName(), "EXIT")==0 )
{
if ( !bClearedExits )
{
// if we haven't cleared previous exits yet then do so now
m_Exits.PurgeAndDeleteElements();
bClearedExits = true;
}
CRoomTemplateExit *pExit = new CRoomTemplateExit();
pExit->m_iXPos = pkvSubSection->GetInt("XPos");
pExit->m_iYPos = pkvSubSection->GetInt("YPos");
pExit->m_ExitDirection = (ExitDirection_t) pkvSubSection->GetInt("ExitDirection");
pExit->m_iZChange = pkvSubSection->GetInt("ZChange");
Q_strncpy( pExit->m_szExitTag, pkvSubSection->GetString( "ExitTag" ), sizeof( pExit->m_szExitTag ) );
pExit->m_bChokepointGrowSource = !!pkvSubSection->GetInt("ChokeGrow", 0);
// discard exits outside the room bounds
if ( pExit->m_iXPos < 0 || pExit->m_iYPos < 0 || pExit->m_iXPos >= m_nTilesX || pExit->m_iYPos >= m_nTilesY )
{
delete pExit;
}
else
{
m_Exits.AddToTail(pExit);
}
}
else if ( Q_stricmp(pkvSubSection->GetName(), "Tags")==0 && TagList() )
{
for ( KeyValues *sub = pkvSubSection->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{
if ( !Q_stricmp( sub->GetName(), "tag" ) )
{
AddTag( sub->GetString() );
}
}
}
pkvSubSection = pkvSubSection->GetNextKey();
}
}
示例10: MarkChunkAsPadding
bool MarkChunkAsPadding ( LFA_FileRef inFileRef, RiffState & inOutRiffState, long riffType, long tagID, long subtypeID )
{
UInt32 len;
UInt64 pos;
atag tag;
try {
bool found = FindChunk ( inOutRiffState, tagID, riffType, subtypeID, NULL, &len, &pos );
if ( ! found ) return false;
if ( subtypeID != 0 ) {
pos -= 12;
} else {
pos -= 8;
}
tag.id = MakeUns32LE ( ckidPremierePadding );
LFA_Seek ( inFileRef, pos, SEEK_SET );
LFA_Write ( inFileRef, &tag, 4 );
pos += 8;
AddTag ( inOutRiffState, ckidPremierePadding, len, pos, 0, 0, 0 );
} catch(...) {
return false; // If a write fails, it throws, so we return false.
}
return true;
}
示例11: AddTag
//初期化
void FixedBox::OnCreate() {
auto PtrTransform = GetComponent<Transform>();
PtrTransform->SetScale(m_Scale);
PtrTransform->SetRotation(m_Rotation);
PtrTransform->SetPosition(m_Position);
//OBB衝突j判定を付ける
auto PtrColl = AddComponent<CollisionObb>();
PtrColl->SetFixed(true);
//タグをつける
AddTag(L"FixedBox");
//影をつける
auto ShadowPtr = AddComponent<Shadowmap>();
ShadowPtr->SetMeshResource(L"DEFAULT_CUBE");
auto PtrDraw = AddComponent<BcPNTStaticDraw>();
PtrDraw->SetFogEnabled(true);
PtrDraw->SetMeshResource(L"DEFAULT_CUBE");
PtrDraw->SetOwnShadowActive(true);
PtrDraw->SetTextureResource(L"SKY_TX");
}
示例12: Entity
// T H E P L A Y E R (entity)
Player::Player(int x, int y) : Entity(),
FRICTION_GROUND(800),
FRICTION_AIR(400),
GRAVITY(300),
JUMP(120.0f),
MAXSPEED_GROUND(60.0f),
MAXSPEED_AIR(100.0f),
ACCELERATION(800),
WALLJUMP(160.0f),
doubleJump(false),
cling(0),
onGround(false)
{
position = Vector2(x, y);
AddTag("PLAYER");
SetCollider(new RectangleCollider(8, 8));
sprite = new SpriteAnimation("player.png", FILTER_NONE, 8, 8);
sprite->Add("stand", 0, 0, 0);
sprite->Add("run", 0, 3, 12.0f);
sprite->Add("jumpUp", 8, 8, 0);
sprite->Add("jumpDown", 9, 9, 0);
sprite->Play("run");
SetLayer(-1);
SetGraphic(sprite);
direction = true;
}
示例13: Node
void TurretManager::CreateNodes()
{
for (int i = 0; i < 6; i++)
{
auto node = std::shared_ptr<Node>(new Node(1, i, orbit01Angle, node01Texture));
nodes.emplace_back(node);
AddChild(node);
node->AddTag("Node");
}
for (int i = 0; i < 12; i++)
{
auto node = std::shared_ptr<Node>(new Node(2, i, orbit02Angle, node01Texture));
nodes.emplace_back(node);
AddChild(node);
node->AddTag("Node2");
}
}
示例14: AddTag
void CECTag::AddTag(ec_tagname_t name, uint64_t data, CValueMap* valuemap)
{
if (valuemap) {
valuemap->CreateTag(name, data, this);
} else {
AddTag(CECTag(name, data));
}
}
示例15: AddTag
void Player::OnCreate() {
vector<VertexPositionNormalTexture> vertices;
vector<uint16_t> indices;
MeshUtill::CreateSphere(1.0f, m_Division, vertices, indices);
//メッシュの作成(変更できない)
m_SphereMesh = MeshResource::CreateMeshResource(vertices, indices, false);
//タグの追加
AddTag(L"Player");
}