AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
PreparedStatementBase Class Reference

#include "PreparedStatement.h"

Inheritance diagram for PreparedStatementBase:
PreparedStatement< T >

Public Member Functions

 PreparedStatementBase (uint32 index, uint8 capacity)
 
virtual ~PreparedStatementBase ()
 
template<typename T >
Acore::Types::is_default< T > SetData (const uint8 index, T value)
 
template<typename T >
Acore::Types::is_enum_v< T > SetData (const uint8 index, T value)
 
void SetData (const uint8 index, std::string_view value)
 
void SetData (const uint8 index, std::nullptr_t=nullptr)
 
template<std::size_t Size>
void SetData (const uint8 index, std::array< uint8, Size > const &value)
 
template<class _Rep , class _Period >
void SetData (const uint8 index, std::chrono::duration< _Rep, _Period > const &value, bool convertToUin32=true)
 
template<typename... Args>
void SetArguments (Args &&... args)
 
uint32 GetIndex () const
 
std::vector< PreparedStatementData > const & GetParameters () const
 

Protected Member Functions

template<typename T >
Acore::Types::is_non_string_view_v< T > SetValidData (const uint8 index, T const &value)
 
void SetValidData (const uint8 index)
 
void SetValidData (const uint8 index, std::string_view value)
 
template<typename... Ts>
void SetDataTuple (std::tuple< Ts... > const &argsList)
 
 PreparedStatementBase (PreparedStatementBase const &right)=delete
 
PreparedStatementBaseoperator= (PreparedStatementBase const &right)=delete
 

Protected Attributes

uint32 m_index
 
std::vector< PreparedStatementDatastatement_data
 

Friends

class PreparedStatementTask
 

Detailed Description

Constructor & Destructor Documentation

◆ PreparedStatementBase() [1/2]

PreparedStatementBase::PreparedStatementBase ( uint32  index,
uint8  capacity 
)
explicit
26 :
27 m_index(index),
28 statement_data(capacity) { }
uint32 m_index
Definition: PreparedStatement.h:147
std::vector< PreparedStatementData > statement_data
Definition: PreparedStatement.h:150

◆ ~PreparedStatementBase()

PreparedStatementBase::~PreparedStatementBase ( )
virtual
30{ }

◆ PreparedStatementBase() [2/2]

PreparedStatementBase::PreparedStatementBase ( PreparedStatementBase const &  right)
protecteddelete

Member Function Documentation

◆ GetIndex()

◆ GetParameters()

std::vector< PreparedStatementData > const & PreparedStatementBase::GetParameters ( ) const
inline

◆ operator=()

PreparedStatementBase & PreparedStatementBase::operator= ( PreparedStatementBase const &  right)
protecteddelete

◆ SetArguments()

template<typename... Args>
void PreparedStatementBase::SetArguments ( Args &&...  args)
inline
120 {
121 SetDataTuple(std::make_tuple(std::forward<Args>(args)...));
122 }
void SetDataTuple(std::tuple< Ts... > const &argsList)
Definition: PreparedStatement.h:135

Referenced by Player::_SaveSeasonalQuestStatus(), and wp_commandscript::HandleWpShowCommand().

◆ SetData() [1/6]

template<std::size_t Size>
void PreparedStatementBase::SetData ( const uint8  index,
std::array< uint8, Size > const &  value 
)
inline
105 {
106 std::vector<uint8> vec(value.begin(), value.end());
107 SetValidData(index, vec);
108 }
Acore::Types::is_non_string_view_v< T > SetValidData(const uint8 index, T const &value)
Definition: PreparedStatement.cpp:34

◆ SetData() [2/6]

template<class _Rep , class _Period >
void PreparedStatementBase::SetData ( const uint8  index,
std::chrono::duration< _Rep, _Period > const &  value,
bool  convertToUin32 = true 
)
inline
113 {
114 SetValidData(index, convertToUin32 ? static_cast<uint32>(value.count()) : value.count());
115 }
std::uint32_t uint32
Definition: Define.h:108

◆ SetData() [3/6]

void PreparedStatementBase::SetData ( const uint8  index,
std::nullptr_t  = nullptr 
)
inline
98 {
99 SetValidData(index);
100 }

◆ SetData() [4/6]

void PreparedStatementBase::SetData ( const uint8  index,
std::string_view  value 
)
inline
92 {
93 SetValidData(index, value);
94 }

◆ SetData() [5/6]

template<typename T >
Acore::Types::is_default< T > PreparedStatementBase::SetData ( const uint8  index,
value 
)
inline
79 {
80 SetValidData(index, value);
81 }

Referenced by Guild::_CreateDefaultGuildRanks(), Guild::_CreateNewBankTab(), Guild::_DeleteMemberFromDB(), Player::_LoadBrewOfTheMonth(), Player::_LoadHomeBind(), Player::_LoadItem(), Player::_LoadMailedItem(), Player::_LoadSkills(), Guild::_ModifyBankMoney(), InstanceSaveMgr::_ResetOrWarnAll(), InstanceSaveMgr::_ResetSave(), Player::_SaveActions(), Pet::_SaveAuras(), Player::_SaveAuras(), Player::_SaveCharacter(), Player::_SaveDailyQuestStatus(), Player::_SaveEntryPoint(), Player::_SaveEquipmentSets(), Player::_SaveGlyphs(), Player::_SaveInstanceTimeRestrictions(), Player::_SaveInventory(), Player::_SaveMail(), Player::_SaveMonthlyQuestStatus(), Player::_SavePlayerSettings(), Player::_SaveQuestStatus(), Player::_SaveSeasonalQuestStatus(), Player::_SaveSkills(), Pet::_SaveSpellCooldowns(), Player::_SaveSpellCooldowns(), Pet::_SaveSpells(), Player::_SaveSpells(), Player::_SaveStats(), Player::_SaveTalents(), lfg::LFGMgr::_SaveToDB(), Player::_SaveWeeklyQuestStatus(), Guild::_SetLeaderGUID(), World::_UpdateRealmCharCount(), AppenderDB::_write(), AccountActionIpLogger::AccountIPLogAction(), Player::ActivateSpec(), Channel::AddChannelBanToDB(), ObjectMgr::AddGameTele(), Graveyard::AddGraveyardLink(), Guild::AddMember(), ArenaTeam::AddMember(), Group::AddMember(), LootItemStorage::AddNewStoredLoot(), ObjectMgr::AddReservedPlayerName(), Pet::addSpell(), PlayerSocial::AddToSocialList(), ObjectMgr::AddVendorItem(), BanMgr::BanAccount(), BanMgr::BanAccountByPlayerName(), BanMgr::BanCharacter(), BanMgr::BanIP(), Group::ChangeLeader(), Guild::ChangeMemberRank(), Group::ChangeMembersGroup(), AccountMgr::ChangePassword(), Guild::Member::ChangeRank(), AccountMgr::ChangeUsername(), Channel::Channel(), CharacterActionIpLogger::CharacterIPLogAction(), AccountMgr::CheckPassword(), Channel::CleanOldChannelsInDB(), Item::ClearSoulboundTradeable(), Group::ConvertToLFG(), Group::ConvertToRaid(), ArenaTeam::Create(), Group::Create(), Guild::Create(), AccountMgr::CreateAccount(), Guild::RankInfo::CreateMissingTabsIfNeeded(), Player::Customize(), OPvPCapturePoint::DelCreature(), AccountMgr::DeleteAccount(), Map::DeleteCorpseData(), Creature::DeleteFromDB(), GameObject::DeleteFromDB(), GmTicket::DeleteFromDB(), AuctionEntry::DeleteFromDB(), Item::DeleteFromDB(), Corpse::DeleteFromDB(), Pet::DeleteFromDB(), AchievementMgr::DeleteFromDB(), Player::DeleteFromDB(), Item::DeleteFromInventoryDB(), ObjectMgr::DeleteGameTele(), MailDraft::deleteIncludedItems(), InstanceSaveMgr::DeleteInstanceSavedData(), InstanceSaveMgr::DeleteInstanceSaveIfNeeded(), CharacterDeleteActionIpLogger::DeleteIPLogAction(), Player::DeleteOldCharacters(), Item::DeleteRefundDataFromDB(), Map::DeleteRespawnTimesInDB(), DeleteSpellFromAllPlayers(), ArenaTeam::DelMember(), Player::DestroyItem(), Guild::Disband(), Group::Disband(), ArenaTeam::Disband(), ArenaTeamMgr::DistributeArenaPoints(), Battleground::EndBattleground(), Arena::EndBattleground(), BGQueueRemoveEvent::Execute(), Player::GetArenaTeamIdFromDB(), AccountMgr::GetCharactersCount(), character_commandscript::GetDeletedCharacterInfoList(), AccountMgr::GetId(), AccountMgr::GetName(), AccountMgr::GetSecurity(), Player::GetZoneIdFromDB(), account_commandscript::HandleAccountAddonCommand(), account_commandscript::HandleAccountLockIpCommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), disable_commandscript::HandleAddDisables(), WorldSession::HandleAuctionPlaceBid(), WorldSocket::HandleAuthSession(), WorldSocket::HandleAuthSessionCallback(), ban_commandscript::HandleBanInfoCharacterCommand(), ban_commandscript::HandleBanListAccountCommand(), ban_commandscript::HandleBanListCharacterCommand(), ban_commandscript::HandleBanListIPCommand(), WorldSession::HandleBattleFieldPortOpcode(), WorldSession::HandleBugOpcode(), WorldSession::HandleBuybackItem(), character_commandscript::HandleCharacterChangeFactionCommand(), character_commandscript::HandleCharacterChangeRaceCommand(), character_commandscript::HandleCharacterCustomizeCommand(), character_commandscript::HandleCharacterRenameCommand(), WorldSession::HandleCharCreateOpcode(), WorldSession::HandleCharCustomize(), WorldSession::HandleCharCustomizeCallback(), WorldSession::HandleCharEnumOpcode(), WorldSession::HandleCharFactionOrRaceChange(), WorldSession::HandleCharFactionOrRaceChangeCallback(), WorldSession::HandleCharRenameCallBack(), WorldSession::HandleCharRenameOpcode(), deserter_commandscript::HandleDeserterAdd(), gobject_commandscript::HandleGameObjectNearCommand(), gear_commandscript::HandleGearStatsCommand(), gm_commandscript::HandleGMListFullCommand(), WorldSession::HandleGMSurveySubmit(), item_commandscript::HandleItemRefundCommand(), item_commandscript::HandleItemRestoreCommand(), item_commandscript::HandleItemRestoreListCommand(), list_commandscript::HandleListItemCommand(), AuthSession::HandleLogonProof(), lookup_commandscript::HandleLookupPlayerAccountCommand(), lookup_commandscript::HandleLookupPlayerEmailCommand(), lookup_commandscript::HandleLookupPlayerIpCommand(), WorldSession::HandleMailReturnToSender(), misc_commandscript::HandleMuteCommand(), misc_commandscript::HandleMuteInfoHelper(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcAddMoveCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcNearCommand(), npc_commandscript::HandleNpcSetFactionIdCommand(), npc_commandscript::HandleNpcSetFlagCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), WorldSession::HandleOpenItemOpcode(), WorldSession::HandleOpenWrappedItemCallback(), WorldSession::HandlePetitionBuyOpcode(), WorldSession::HandlePetitionRenameOpcode(), WorldSession::HandlePetitionSignOpcode(), WorldSession::HandlePetRename(), misc_commandscript::HandlePInfoCommand(), WorldSession::HandlePlayerLoginFromDB(), quest_commandscript::HandleQuestAdd(), quest_commandscript::HandleQuestComplete(), GameEventMgr::HandleQuestComplete(), quest_commandscript::HandleQuestRemove(), quest_commandscript::HandleQuestReward(), AuthSession::HandleRealmList(), reload_commandscript::HandleReloadCreatureTemplateCommand(), disable_commandscript::HandleRemoveDisables(), Guild::HandleRemoveRank(), WorldSession::HandleReportLag(), reset_commandscript::HandleResetAllCommand(), reset_commandscript::HandleResetSpellsCommand(), reset_commandscript::HandleResetTalentsCommand(), Guild::HandleSetInfo(), Guild::HandleSetMOTD(), WorldSession::HandleSetPlayerDeclinedNames(), WorldSession::HandleSetSavedInstanceExtend(), WorldSession::HandleStablePet(), WorldSession::HandleStableSwapPet(), tele_commandscript::HandleTeleNameCommand(), WorldSession::HandleTurnInPetitionOpcode(), misc_commandscript::HandleUnFreezeCommand(), misc_commandscript::HandleUnmuteCommand(), WorldSession::HandleUnstablePet(), WorldSession::HandleWhoisOpcode(), wp_commandscript::HandleWpAddCommand(), wp_commandscript::HandleWpEventCommand(), wp_commandscript::HandleWpLoadCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), wp_commandscript::HandleWpUnLoadCommand(), WorldSession::HandleWrapItemOpcode(), LoginQueryHolder::Initialize(), AccountInfoQueryHolderPerRealm::Initialize(), InstanceSave::InsertToDB(), Player::LeaveAllArenaTeams(), Player::LeaveBattleground(), ChannelMgr::LoadChannels(), InstanceSaveMgr::LoadCharacterBinds(), AchievementGlobalMgr::LoadCompletedAchievements(), Map::LoadCorpseData(), ObjectMgr::LoadCreatures(), World::LoadDBAllowedSecurityLevel(), PlayerDumpReader::LoadDump(), Player::LoadFromDB(), Item::LoadFromDB(), AchievementMgr::LoadFromDB(), ObjectMgr::LoadGameobjects(), Group::LoadGroupFromDB(), Guild::BankTab::LoadItemFromDB(), Group::LoadMemberFromDB(), Player::LoadPositionFromDB(), ObjectMgr::LoadReferenceVendor(), Map::LoadRespawnTimes(), WorldSession::LogoutPlayer(), Player::ModifyArenaPoints(), Player::ModifyHonorPoints(), Player::OfflineResurrect(), ServerMailReward::OnLogin(), PetLoadQueryHolder::PetLoadQueryHolder(), InstanceSaveMgr::PlayerBindToInstance(), InstanceSaveMgr::PlayerUnbindInstance(), WorldSession::recoveryItem(), WaypointMgr::ReloadPath(), Player::RemoveAtLoginFlag(), BanMgr::RemoveBanAccount(), BanMgr::RemoveBanAccountByPlayerName(), BanMgr::RemoveBanCharacter(), BanMgr::RemoveBanIP(), Channel::RemoveChannelBanFromDB(), Map::RemoveCreatureRespawnTime(), LootItemStorage::RemoveEntryFromDB(), CalendarMgr::RemoveEvent(), PlayerSocial::RemoveFromSocialList(), Map::RemoveGORespawnTime(), Graveyard::RemoveGraveyardLink(), CalendarMgr::RemoveInvite(), Group::RemoveMember(), Player::RemovePet(), Player::RemovePetitionsAndSigns(), LootItemStorage::RemoveStoredLoot(), ObjectMgr::RemoveVendorItem(), World::ResetEventSeasonalQuests(), ObjectMgr::ReturnOrDeleteOldMails(), AddonMgr::SaveAddon(), Map::SaveCreatureRespawnTime(), Player::SaveGoldToDB(), Map::SaveGORespawnTime(), GameObject::SaveInstanceData(), Pet::SavePetToDB(), Player::SavePositionInDB(), PoolMgr::SaveQuestsToDB(), Item::SaveRefundDataToDB(), ArenaTeam::SaveToDB(), Corpse::SaveToDB(), InstanceScript::SaveToDB(), AchievementMgr::SaveToDB(), Item::SaveToDB(), ReputationMgr::SaveToDB(), AuctionEntry::SaveToDB(), Guild::Member::SaveToDB(), Guild::RankInfo::SaveToDB(), GmTicket::SaveToDB(), Guild::EventLogEntry::SaveToDB(), Guild::BankEventLogEntry::SaveToDB(), EmblemInfo::SaveToDB(), Creature::SaveToDB(), GameObject::SaveToDB(), WorldSession::SaveTutorialsData(), GameEventMgr::SaveWorldEventStateToDB(), AuctionHouseMgr::SendAuctionWonMail(), MailDraft::SendMailTo(), MailDraft::SendReturnToSender(), ObjectMgr::SendServerMail(), WorldSession::SetAccountData(), Guild::RankInfo::SetBankMoneyPerDay(), Guild::RankInfo::SetBankTabSlotsAndRights(), ArenaTeam::SetCaptain(), InstanceScript::SetCompletedEncountersMask(), ObjectMgr::SetCreatureLinkedRespawn(), Group::SetDungeonDifficulty(), PlayerSocial::SetFriendNote(), Group::SetGroupMemberFlag(), Player::SetHomebind(), Guild::BankTab::SetInfo(), Guild::BankTab::SetItem(), ArenaTeam::SetName(), Guild::SetName(), Guild::RankInfo::SetName(), Guild::Member::SetOfficerNote(), Guild::Member::SetPublicNote(), Group::SetRaidDifficulty(), Player::SetRandomWinner(), Guild::RankInfo::SetRights(), Guild::BankTab::SetText(), World::setWorldState(), Player::SpawnCorpseBones(), PoolGroup< T >::SpawnObject(), AuthSession::Start(), WorldSocket::Start(), GameEventMgr::StopEvent(), Player::StoreNewItem(), World::Update(), Player::Update(), Guild::Member::UpdateBankWithdrawValue(), Channel::UpdateChannelInDB(), Channel::UpdateChannelUseageInDB(), CalendarMgr::UpdateEvent(), GameObject::UpdateInstanceData(), CalendarMgr::UpdateInvite(), Player::UpdateNextMailTimeAndUnreads(), World::UpdateRealmCharCount(), and Player::UpdateSpecCount().

◆ SetData() [6/6]

template<typename T >
Acore::Types::is_enum_v< T > PreparedStatementBase::SetData ( const uint8  index,
value 
)
inline
86 {
87 SetValidData(index, std::underlying_type_t<T>(value));
88 }

◆ SetDataTuple()

template<typename... Ts>
void PreparedStatementBase::SetDataTuple ( std::tuple< Ts... > const &  argsList)
inlineprotected
136 {
137 std::apply
138 (
139 [this](Ts const&... arguments)
140 {
141 uint8 index{ 0 };
142 ((SetData(index, arguments), index++), ...);
143 }, argsList
144 );
145 }
std::uint8_t uint8
Definition: Define.h:110
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78

◆ SetValidData() [1/3]

void PreparedStatementBase::SetValidData ( const uint8  index)
protected
42{
43 ASSERT(index < statement_data.size());
44 statement_data[index].data.emplace<std::nullptr_t>(nullptr);
45}
#define ASSERT
Definition: Errors.h:68

References ASSERT, and statement_data.

◆ SetValidData() [2/3]

void PreparedStatementBase::SetValidData ( const uint8  index,
std::string_view  value 
)
protected
48{
49 ASSERT(index < statement_data.size());
50 statement_data[index].data.emplace<std::string>(value);
51}

References ASSERT, and statement_data.

◆ SetValidData() [3/3]

template<typename T >
Acore::Types::is_non_string_view_v< T > PreparedStatementBase::SetValidData ( const uint8  index,
T const &  value 
)
protected
35{
36 ASSERT(index < statement_data.size());
37 statement_data[index].data.emplace<T>(value);
38}

References ASSERT, and statement_data.

Friends And Related Function Documentation

◆ PreparedStatementTask

friend class PreparedStatementTask
friend

Member Data Documentation

◆ m_index

uint32 PreparedStatementBase::m_index
protected

◆ statement_data

std::vector<PreparedStatementData> PreparedStatementBase::statement_data
protected

Referenced by SetValidData().