diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2017-10-12 20:00:52 +0200 |
|---|---|---|
| committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-10-12 20:00:52 +0200 |
| commit | f06f32849f1e2c72dc73287c73361174c07ed29e (patch) | |
| tree | 70ace68e849cd5ca446fb36279f8125127bb8693 /src/core/Database/SQLOperation.h | |
| parent | 4df28fd29c6978e669f9950bd38e853fabf9fc8d (diff) | |
Directory Structure [step 1]: moving files
working on #672
NOTE: This commit can't be compiled!!
Diffstat (limited to 'src/core/Database/SQLOperation.h')
| -rw-r--r-- | src/core/Database/SQLOperation.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/core/Database/SQLOperation.h b/src/core/Database/SQLOperation.h new file mode 100644 index 0000000000..72ce6fd6a0 --- /dev/null +++ b/src/core/Database/SQLOperation.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) + * + * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + */ + +#ifndef _SQLOPERATION_H +#define _SQLOPERATION_H + +#include <ace/Method_Request.h> +#include <ace/Activation_Queue.h> + +#include "QueryResult.h" + +//- Forward declare (don't include header to prevent circular includes) +class PreparedStatement; + +//- Union that holds element data +union SQLElementUnion +{ + PreparedStatement* stmt; + const char* query; +}; + +//- Type specifier of our element data +enum SQLElementDataType +{ + SQL_ELEMENT_RAW, + SQL_ELEMENT_PREPARED +}; + +//- The element +struct SQLElementData +{ + SQLElementUnion element; + SQLElementDataType type; +}; + +//- For ambigious resultsets +union SQLResultSetUnion +{ + PreparedResultSet* presult; + ResultSet* qresult; +}; + +class MySQLConnection; + +class SQLOperation : public ACE_Method_Request +{ + public: + SQLOperation(): m_conn(NULL) { } + virtual int call() + { + Execute(); + return 0; + } + virtual bool Execute() = 0; + virtual void SetConnection(MySQLConnection* con) { m_conn = con; } + + MySQLConnection* m_conn; +}; + +#endif |
