llvm::Value* LazyFunction::call(llvm::IRBuilder<>& _builder, std::initializer_list<llvm::Value*> const& _args, llvm::Twine const& _name) { if (!m_func) m_func = m_creator(); return _builder.CreateCall(m_func, {_args.begin(), _args.size()}, _name); }
CPlayerDetail* CPlayerContainer::Add(scgl::PlayerIDType playerID, Guid playerGuid) { const PlayerMap::index<PLAYERID>::type& playerIDMap = m_players.get<PLAYERID>(); PlayerMap::index<PLAYERID>::type::iterator it = playerIDMap.find(playerID); if (it != playerIDMap.end()) { const PlayerDetailWrapper& playerDetail = *it; return playerDetail.player; } CPlayerDetail* player = m_creator(playerID, playerGuid); assert(player != NULL); player->SetContainer(this); if (!m_players.insert(PlayerDetailWrapper(playerID, playerGuid, player)).second) { LOG_WARN("Net", "CPlayerContainer::Add error!!!" << " playerID:" << playerID << " playerGuid:" << playerGuid ); return NULL; } return player; }
Object* ClassInfo::create() { return m_creator ? m_creator() : 0; }