32 #ifndef EXASOCKETS_EXARESULTSET_H
33 #define EXASOCKETS_EXARESULTSET_H
35 #define COL_DEFAULT_ROWS 1000
37 #define EXA_BOOLEAN 301
40 #define EXA_DECIMAL 304
41 #define EXA_DOUBLE 305
42 #define EXA_GEOMETRY 306
43 #define EXA_INTERVAL_DS 307
44 #define EXA_INTERVAL_YM 308
45 #define EXA_TIMESTAMP 309
46 #define EXA_TIMESTAMP_TZ 310
47 #define EXA_VARCHAR 311
61 static exaTblColumn
*create(std::string name,
int datatype,
size_t num_rows = COL_DEFAULT_ROWS,
62 int precision = 0,
int scale = 0,
int size = 0, std::string charset =
"",
63 bool w_local_tz =
false,
64 int fraction = 0,
int srid = 0);
66 exaTblColumn(std::string
name,
int datatype,
size_t num_rows =
COL_DEFAULT_ROWS,
int precision = 0,
int
scale = 0,
67 int size = 0, std::string charset =
"",
68 bool w_local_tz =
false,
int fraction = 0,
int srid = 0) {};
78 virtual std::shared_ptr<void>
operator[](
size_t row) = 0;
102 virtual void appendData(
const void *value,
bool
null =
false) = 0;
105 virtual bool is_null(
size_t rowno);
108 virtual size_t count()
const = 0;
114 std::string getName()
const {
118 void setName(std::string name) {
119 exaTblColumn::name = name;
122 int getPrecision()
const;
124 void setPrecision(
int precision);
126 int getScale()
const;
128 void setScale(
int scale);
132 void setSize(
int size);
134 std::string getCharacterSet()
const;
136 void setCharacterSet(std::string characterSet);
138 bool isWithLocalTimeTone()
const;
140 void setWithLocalTimeTone(
bool
withLocalTimeTone);
142 int getFraction()
const;
144 void setFraction(
int fraction);
148 void setSrid(
int srid);
150 std::vector<bool> nulls;
157 std::string characterSet =
"";
158 bool withLocalTimeTone = 0;
166 exaColumn(std::string
name,
int datatype,
size_t num_rows =
COL_DEFAULT_ROWS,
int precision = 0,
int
scale = 0,
167 int size = 0, std::string charset =
"",
168 bool w_local_tz =
false,
169 int fraction = 0,
int srid = 0) :
exaTblColumn(name, datatype, num_rows, precision,
170 scale, size, charset, w_local_tz,
fraction, srid) {
172 this->datatype = datatype;
173 this->precision = precision;
176 this->characterSet = charset;
177 this->withLocalTimeTone =
w_local_tz;
178 this->fraction = fraction;
181 this->data.reserve(num_rows);
191 void appendData(
const void *value,
const bool null =
false);
193 size_t count()
const;
214 void addColumn(std::shared_ptr<exaTblColumn> c);
229 std::vector<std::shared_ptr<exaTblColumn>>
&getColumns() {
230 return this->columns;
233 int getHandle()
const;
235 void setHandle(
int handle);
239 std::vector<std::shared_ptr<exaTblColumn>>
columns;
245 #endif //EXASOCKETS_EXARESULTSET_H
virtual void appendData(const void *value, bool null=false)=0
Returns the value as a 32 Bit integer.
virtual size_t count() const =0
Returns the number of rows contained in the column.
virtual void * as_std_vector()=0
Returns a void pointer to the embedded std::vector.
Definition: exaResultSet.h:59
Definition: exaResultSet.h:205
virtual std::shared_ptr< void > operator[](size_t row)=0
Returns a void pointer to the value, or a nullptr if the value is NULL.
virtual bool is_null(size_t rowno)
Returns a boolean on whether the row specified contains a NULL value.
Definition: exaResultSet.cpp:79
void * as_std_vector()
Returns a void pointer to the embedded std::vector.
Definition: exaResultSet.h:195
Definition: exaResultSet.h:164