Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
SQLOperation.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef _SQLOPERATION_H
7
#define _SQLOPERATION_H
8
9
#include "
QueryResult.h
"
10
11
//- Forward declare (don't include header to prevent circular includes)
12
class
PreparedStatement
;
13
14
//- Union that holds element data
15
union
SQLElementUnion
16
{
17
PreparedStatement
*
stmt
;
18
const
char
*
query
;
19
};
20
21
//- Type specifier of our element data
22
enum
SQLElementDataType
23
{
24
SQL_ELEMENT_RAW
,
25
SQL_ELEMENT_PREPARED
26
};
27
28
//- The element
29
struct
SQLElementData
30
{
31
SQLElementUnion
element
;
32
SQLElementDataType
type
;
33
};
34
35
//- For ambigious resultsets
36
union
SQLResultSetUnion
37
{
38
PreparedResultSet
*
presult
;
39
ResultSet
*
qresult
;
40
};
41
42
class
MySQLConnection;
43
44
class
SQLOperation
45
{
46
public
:
47
SQLOperation
() :
m_conn
(NULL) { }
48
virtual
int
call
()
49
{
50
Execute
();
51
return
0;
52
}
53
virtual
bool
Execute
() = 0;
54
virtual
void
SetConnection
(MySQLConnection* con) {
m_conn
= con; }
55
virtual
~SQLOperation
() { }
56
57
MySQLConnection*
m_conn
;
58
private
:
59
SQLOperation
(
SQLOperation
const
& right) =
delete
;
60
SQLOperation
&
operator=
(
SQLOperation
const
& right) =
delete
;
61
};
62
63
#endif
QueryResult.h
SQLElementDataType
SQLElementDataType
Definition
SQLOperation.h:23
SQL_ELEMENT_RAW
@ SQL_ELEMENT_RAW
Definition
SQLOperation.h:24
SQL_ELEMENT_PREPARED
@ SQL_ELEMENT_PREPARED
Definition
SQLOperation.h:25
PreparedResultSet
Definition
QueryResult.h:51
PreparedStatement
Definition
PreparedStatement.h:63
ResultSet
Definition
QueryResult.h:19
SQLOperation::SQLOperation
SQLOperation()
Definition
SQLOperation.h:47
SQLOperation::SetConnection
virtual void SetConnection(MySQLConnection *con)
Definition
SQLOperation.h:54
SQLOperation::SQLOperation
SQLOperation(SQLOperation const &right)=delete
SQLOperation::~SQLOperation
virtual ~SQLOperation()
Definition
SQLOperation.h:55
SQLOperation::operator=
SQLOperation & operator=(SQLOperation const &right)=delete
SQLOperation::m_conn
MySQLConnection * m_conn
Definition
SQLOperation.h:57
SQLOperation::call
virtual int call()
Definition
SQLOperation.h:48
SQLOperation::Execute
virtual bool Execute()=0
SQLElementData
Definition
SQLOperation.h:30
SQLElementData::element
SQLElementUnion element
Definition
SQLOperation.h:31
SQLElementData::type
SQLElementDataType type
Definition
SQLOperation.h:32
SQLElementUnion
Definition
SQLOperation.h:16
SQLElementUnion::query
const char * query
Definition
SQLOperation.h:18
SQLElementUnion::stmt
PreparedStatement * stmt
Definition
SQLOperation.h:17
SQLResultSetUnion
Definition
SQLOperation.h:37
SQLResultSetUnion::presult
PreparedResultSet * presult
Definition
SQLOperation.h:38
SQLResultSetUnion::qresult
ResultSet * qresult
Definition
SQLOperation.h:39
src
server
shared
Database
SQLOperation.h
Generated on
for Project SkyFire Core by
1.17.0