當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddTag函數代碼示例

本文整理匯總了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()));	
}
開發者ID:0vermind,項目名稱:hmule,代碼行數:29,代碼來源:ECSpecialCoreTags.cpp

示例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));
}
開發者ID:windreamer,項目名稱:amule-dlp,代碼行數:9,代碼來源:ECSpecialMuleTags.cpp

示例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);
	}
開發者ID:dengchao000,項目名稱:fge,代碼行數:10,代碼來源:fgeXML.cpp

示例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
//.........這裏部分代碼省略.........
開發者ID:t0mac0,項目名稱:wiimouse,代碼行數:101,代碼來源:packet_mgr.c

示例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;
	}
開發者ID:elmato,項目名稱:Monocle-Engine,代碼行數:7,代碼來源:Pong.cpp

示例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;
	
	}
開發者ID:JJWTimmer,項目名稱:Uforia,代碼行數:35,代碼來源:RIFF_Support.cpp

示例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;
}
開發者ID:thierry-sousbie,項目名稱:dice,代碼行數:32,代碼來源:NDskel_tags.c

示例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 ;
}
開發者ID:Miinky-Arcade,項目名稱:yabause,代碼行數:37,代碼來源:profile.c

示例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();
    }
}
開發者ID:Cre3per,項目名稱:hl2sdk-csgo,代碼行數:60,代碼來源:RoomTemplate.cpp

示例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;
	}
開發者ID:JJWTimmer,項目名稱:Uforia,代碼行數:32,代碼來源:RIFF_Support.cpp

示例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");


	}
開發者ID:WiZFramework,項目名稱:BaseCross,代碼行數:26,代碼來源:Character.cpp

示例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;
	}
開發者ID:imaginationac,項目名稱:Monocle-Engine,代碼行數:31,代碼來源:Ogmo.cpp

示例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");
	}
}
開發者ID:Freeman117,項目名稱:Orbital-DefenseRemade,代碼行數:17,代碼來源:TurretManager.cpp

示例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));
	}
}
開發者ID:Artoria2e5,項目名稱:amule-dlp,代碼行數:8,代碼來源:ECTag.cpp

示例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");
	}
開發者ID:WiZFramework,項目名稱:BaseCross,代碼行數:9,代碼來源:Player.cpp


注:本文中的AddTag函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。