http://help.adobe.com/ko_KR/as3/iphone/WS789ea67d3e73a8b2-240138de1243a7725e7-7ffd.html

 

http://help.adobe.com/ko_KR/as3/iphone/index.html

 

 

인증서 패스워드 지정이 안될때

http://stackoverflow.com/questions/2452301/windows-asks-for-p12-password-when-installing-p12-key-generated-by-openssl

 

 

'Programing > flash' 카테고리의 다른 글

starling main frame  (0) 2015.11.20
starling moviebutton  (0) 2015.11.20
coineff  (0) 2015.11.20
baseEff  (0) 2015.11.20
objectMgr  (0) 2015.11.20
flash 용 app 인증 파일 만들기  (0) 2012.12.11
Posted by 패스맨

댓글을 달아 주세요

boost multi index

Programing/boost 2012.07.10 15:04 |

 

흥배님 블로그 참고 하여 작성

 http://jacking.tistory.com/

 

 

 

// testboost.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/tuple/tuple.hpp>


class Character
{
public:
 Character( const int nCharID, const std::wstring strName, const int nlevel ) : m_nCharID(nCharID), m_strName(strName),
  m_nLevel( nLevel )
 {
  m_nExp = 0;
  m_nMoney = 0;
  m_nLevel = 0;
 }
 
private:

 int m_nCharID;
 std::wstring m_strName;
 int m_nExp;
 int m_nMoney;

 int m_nLevel;

public:
 const int CharID() const { return m_nCharID; }
 const int Level () const { return m_nLevel; }
};

typedef boost::multi_index::const_mem_fun <Character, const int , &Character::Level > IDX_LEVEL;
//typedef boost::multi_index::member <Character, int , &Character::m_nCharID > IDX_CHARID;


typedef boost::multi_index::const_mem_fun <Character, const int , &Character::CharID > IDX_CHARID2;


typedef struct indices : public boost::multi_index::indexed_by
 <
  boost::multi_index::hashed_unique <IDX_CHARID2>
  , boost::multi_index::hashed_non_unique <IDX_LEVEL>
 >
{
 enum INDEX
 {
  IDX_UNIQUE_CHARID,
  IDX_NON_UNIQUE_LEVEL,
  IDX_END
 };

}INDICES;


typedef boost::multi_index_container <Character, indices > Container;


int main()
{
 Container CharacterSet;

 CharacterSet.insert( Character(1, "test1", 21));
 CharacterSet.insert( Character(2, "test2", 31));
 CharacterSet.insert( Character(3, "test3", 39));
 CharacterSet.insert( Character(4, "test4", 35));
 CharacterSet.insert( Character(5, "test5", 21));
 CharacterSet.insert( Character(6, "test6", 12));
 CharacterSet.insert( Character(7, "test7", 10));
 CharacterSet.insert( Character(8, "test8", 41));
 

 std::cout << "모든 캐릭터 출력" << std::endl;
 std::for_each( CharacterSet.begin(), CharacterSet.end(), [](const Character& Char) {
  std::cout << "CharID : " << Char.m_nID << ", Level : " << Char.m_nLevel << ", Exp : " << Char.m_nExp << std::endl;
     } );
 std::cout << std::endl;


 /// modify
 std::cout << "캐릭터 ID 3번을 33번으로 그리고 레벨도 333으로 변경" << std::endl;

 Container::nth_index<indices::IDX_CHARID2>::type &Index1 = CharacterSet.get<indices::IDX_CHARID2>();
 Container::nth_index_iterator<indices::IDX_CHARID2>::type iter = Index1.find(3);

 if (Index1.end() != iter)
 {
  std::cout << "CharID : " << (*iter).m_nID << std::endl;
  Index1.modify( iter, [](Character& Char) { Char.m_nID = 33; Char.m_nLevel = 333; } );
 }
 std::cout << std::endl;


 std::for_each( CharacterSet.begin(), CharacterSet.end(), [](const Character& Char) {
  std::cout << "CharID : " << Char.m_nID << ", Level : " << Char.m_nLevel << ", Exp : " << Char.m_nExp << std::endl;
     } );
 std::cout << std::endl << std::endl;

 


 /// modify rollback
 std::cout << "캐릭터 ID 4번을 6번으로 그리고 레벨도 666으로 변경" << std::endl;

 iter = Index1.find(4);

 if (Index1.end() != iter)
 {
  std::cout << "CharID : " << (*iter).m_nID << "번을 6번, 레벨은 666으로 변경" << std::endl;
  int nCharID = (*iter).m_nID;
  int nLevel = (*iter).m_nLevel;
  Index1.modify( iter, [](Character& Char) { Char.m_nID = 6; Char.m_nLevel = 666; }, [nCharID, nLevel](Character& Char) { Char.m_nID = nCharID; Char.m_nLevel = nLevel; } );
 }
 std::cout << std::endl;


 std::for_each( CharacterSet.begin(), CharacterSet.end(), [](const Character& Char) {
  std::cout << "CharID : " << Char.m_nID << ", Level : " << Char.m_nLevel << ", Exp : " << Char.m_nExp << std::endl;
     } );
 std::cout << std::endl << std::endl;

 

 /// modify key
 std::cout << "캐릭터 ID 33번을 333333번으로 변경" << std::endl;

 iter = Index1.find(33);

 if (Index1.end() != iter)
 {
  std::cout << "CharID : " << (*iter).m_nID << std::endl;
  Index1.modify_key( iter, [](int& nCharID) { nCharID = 333333; } );
 }
 std::cout << std::endl;


 std::for_each( CharacterSet.begin(), CharacterSet.end(), [](const Character& Char) {
  std::cout << "CharID : " << Char.m_nID << ", Level : " << Char.m_nLevel << ", Exp : " << Char.m_nExp << std::endl;
     } );
 std::cout << std::endl;

 return 0;
}

 

 

'Programing > boost' 카테고리의 다른 글

boost multi index  (0) 2012.07.10
Posted by 패스맨

댓글을 달아 주세요

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17879

 

'Programing > c/c++' 카테고리의 다른 글

비쥬얼 스튜디오 글씨체  (0) 2012.04.18
offset 알아내기...  (0) 2011.12.26
C언어에서의 데이터가 저장되는 영역  (0) 2011.12.13
dllimport, dllexport  (0) 2011.12.13
람다 샘플 코드2  (0) 2011.10.28
람다 샘플 코드  (0) 2011.10.28
Posted by 패스맨

댓글을 달아 주세요