TrinityCore
Loading...
Searching...
No Matches
SQLOperation.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef _SQLOPERATION_H
19
#define _SQLOPERATION_H
20
21
#include "
Define.h
"
22
#include "
DatabaseEnvFwd.h
"
23
24
//- Union that holds element data
25
union
SQLElementUnion
26
{
27
PreparedStatementBase
*
stmt
;
28
char
const
*
query
;
29
};
30
31
//- Type specifier of our element data
32
enum
SQLElementDataType
33
{
34
SQL_ELEMENT_RAW
,
35
SQL_ELEMENT_PREPARED
36
};
37
38
//- The element
39
struct
SQLElementData
40
{
41
SQLElementUnion
element
;
42
SQLElementDataType
type
;
43
};
44
45
class
MySQLConnection
;
46
47
class
TC_DATABASE_API
SQLOperation
48
{
49
public
:
50
SQLOperation
(): m_conn(nullptr) { }
51
virtual
~SQLOperation
() { }
52
53
virtual
int
call
()
54
{
55
Execute();
56
return
0;
57
}
58
virtual
bool
Execute
() = 0;
59
virtual
void
SetConnection
(
MySQLConnection
* con) { m_conn = con; }
60
61
MySQLConnection
*
m_conn
;
62
63
private
:
64
SQLOperation
(
SQLOperation
const
& right) =
delete
;
65
SQLOperation
&
operator=
(
SQLOperation
const
& right) =
delete
;
66
};
67
68
#endif
DatabaseEnvFwd.h
Define.h
TC_DATABASE_API
#define TC_DATABASE_API
Definition
Define.h:102
SQLElementDataType
SQLElementDataType
Definition
SQLOperation.h:33
SQL_ELEMENT_RAW
@ SQL_ELEMENT_RAW
Definition
SQLOperation.h:34
SQL_ELEMENT_PREPARED
@ SQL_ELEMENT_PREPARED
Definition
SQLOperation.h:35
MySQLConnection
Definition
MySQLConnection.h:56
PreparedStatementBase
Definition
PreparedStatement.h:62
SQLOperation
Definition
SQLOperation.h:48
SQLOperation::SQLOperation
SQLOperation()
Definition
SQLOperation.h:50
SQLOperation::SetConnection
virtual void SetConnection(MySQLConnection *con)
Definition
SQLOperation.h:59
SQLOperation::SQLOperation
SQLOperation(SQLOperation const &right)=delete
SQLOperation::~SQLOperation
virtual ~SQLOperation()
Definition
SQLOperation.h:51
SQLOperation::operator=
SQLOperation & operator=(SQLOperation const &right)=delete
SQLOperation::m_conn
MySQLConnection * m_conn
Definition
SQLOperation.h:61
SQLOperation::call
virtual int call()
Definition
SQLOperation.h:53
SQLOperation::Execute
virtual bool Execute()=0
SQLElementData
Definition
SQLOperation.h:40
SQLElementData::element
SQLElementUnion element
Definition
SQLOperation.h:41
SQLElementData::type
SQLElementDataType type
Definition
SQLOperation.h:42
SQLElementUnion
Definition
SQLOperation.h:26
SQLElementUnion::stmt
PreparedStatementBase * stmt
Definition
SQLOperation.h:27
SQLElementUnion::query
char const * query
Definition
SQLOperation.h:28
server
database
Database
SQLOperation.h
Generated on Sun May 10 2026 02:30:13 for TrinityCore by
1.9.8