forked from zhifac/xmlaconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabular_rowset.h
95 lines (78 loc) · 2.11 KB
/
tabular_rowset.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
ODBO provider for XMLA data stores
Copyright (C) 2014-2015 ARquery LTD
http://www.arquery.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@description
a tabular rowset generated by a MDX query (drillthrough)
*/
#pragma once
#include "resource.h"
#include "XMLAProvider_i.h"
#include "row_data.h"
#include "command.h"
using namespace ATL;
class tabular_row_data
{
private:
int size;
wchar_t* data;
void copy_other( const tabular_row_data& other )
{
size = other.size;
if ( 0 == size )
{
data = nullptr;
return;
}
data = new wchar_t[size];
CopyMemory( data, other.data, size );
}
public:
static ATLCOLUMNINFO* GetColumnInfo(void* pThis, DBORDINAL* pcCols);
tabular_row_data()
{
size = 0;
data = nullptr;
}
tabular_row_data( unsigned int size ) : size(size)
{
data = new wchar_t[size];
ZeroMemory( data, size*sizeof(wchar_t) );
}
tabular_row_data( const tabular_row_data& other )
{
copy_other( other );
}
tabular_row_data& operator=( const tabular_row_data& other )
{
if ( &other == this ) { return *this; }
if ( nullptr != data ) { delete[] data; }
copy_other( other );
return *this;
}
~tabular_row_data()
{
if ( nullptr != data ) { delete[] data; }
}
tabular_row_data* operator&()
{
return (tabular_row_data*)data;
}
};
class tabular_rowset: public CRowsetImpl< tabular_rowset, tabular_row_data, command>
{
friend class tabular_row_data;
connection_handler* mConnectionHandler;
public:
HRESULT Execute(DBPARAMS * /*pParams*/, DBROWCOUNT* pcRowsAffected);
};