29 #ifndef _MARKLOGIC_MARKLOGIC_H_
30 #define _MARKLOGIC_MARKLOGIC_H_
35 typedef __int32 int32_t;
36 typedef unsigned __int32 uint32_t;
37 typedef __int64 int64_t;
38 typedef unsigned __int64 uint64_t;
40 #define MLDLL __declspec(dllimport)
47 #define MARKLOGIC_API_VERSION 1
98 template<
class T,
typename PT>
108 operator PT&() {
return val; }
109 operator const PT&()
const {
return val; }
111 bool operator<(T o)
const {
return val < o.val; }
112 bool operator<=(T o)
const {
return val <= o.val; }
113 bool operator>(T o)
const {
return val > o.val; }
114 bool operator>=(T o)
const {
return val >= o.val; }
115 bool operator==(T o)
const {
return val == o.val; }
116 bool operator!=(T o)
const {
return val != o.val; }
118 T operator-(T o)
const {
return val - o.val; }
119 T operator+(T o)
const {
return val + o.val; }
120 T operator*(T o)
const {
return val * o.val; }
121 T operator/(T o)
const {
return val / o.val; }
123 T operator--(
int) {
return val--; }
124 T operator++(
int) {
return val++; }
125 T& operator--() { --val;
return (T&)*
this; }
126 T& operator++() { ++val;
return (T&)*
this; }
127 T& operator-=(T o) { val -= o.val;
return (T&)*
this; }
128 T& operator+=(T o) { val += o.val;
return (T&)*
this; }
129 T& operator*=(T o) { val *= o.val;
return (T&)*
this; }
130 T& operator/=(T o) { val /= o.val;
return (T&)*
this; }
133 template<
class T,
typename PT>
143 T operator-()
const {
return -this->val; }
144 T operator+()
const {
return +this->val; }
147 template<
class T,
typename PT>
157 T operator%(T o)
const {
return this->val % o.val; }
158 T& operator%=(T o) { this->val %= o.val;
return (T&)*
this; }
161 template<
class T,
typename PT>
171 T operator-()
const {
return -this->val; }
172 T operator+()
const {
return +this->val; }
177 typedef double DecimalType;
179 typedef long double DecimalType;
267 String(
const char* _str,
const char* _collation = 0);
272 operator bool()
const {
return str!=0; }
274 operator const char*()
const;
275 const char*
get()
const;
276 size_t length()
const;
277 const char* collation()
const;
279 bool operator<(
const String& o)
const;
280 bool operator<=(
const String& o)
const;
281 bool operator>(
const String& o)
const;
282 bool operator>=(
const String& o)
const;
283 bool operator==(
const String& o)
const;
284 bool operator!=(
const String& o)
const;
300 Point(
float _lat,
float _lng,
const char* _coordinateSystem =
"wgs84");
302 float latitude()
const;
303 float longitude()
const;
304 const char* coordinateSystem()
const;
306 bool operator<(
const Point& o)
const;
307 bool operator<=(
const Point& o)
const;
308 bool operator>(
const Point& o)
const;
309 bool operator>=(
const Point& o)
const;
310 bool operator==(
const Point& o)
const;
311 bool operator!=(
const Point& o)
const;
343 virtual void next() =0;
345 virtual bool done()
const =0;
349 virtual bool descending()
const =0;
351 virtual size_t width()
const =0;
357 virtual const char* collation(
size_t i)
const =0;
361 virtual const char* coordinateSystem(
size_t i)
const =0;
370 virtual uint64_t frequency()
const =0;
374 virtual bool null(
size_t i)
const =0;
388 virtual void value(
size_t i,
int&)
const =0;
389 virtual void value(
size_t i,
unsigned&)
const =0;
390 virtual void value(
size_t i, int64_t&)
const =0;
391 virtual void value(
size_t i, uint64_t&)
const =0;
392 virtual void value(
size_t i,
float&)
const =0;
393 virtual void value(
size_t i,
double&)
const =0;
394 virtual void value(
size_t i,
Decimal&)
const =0;
395 virtual void value(
size_t i,
DateTime&)
const =0;
396 virtual void value(
size_t i,
Date&)
const =0;
397 virtual void value(
size_t i,
Time&)
const =0;
398 virtual void value(
size_t i,
GYearMonth&)
const =0;
399 virtual void value(
size_t i,
GYear&)
const =0;
400 virtual void value(
size_t i,
GMonth&)
const =0;
401 virtual void value(
size_t i,
GDay&)
const =0;
404 virtual void value(
size_t i,
String&)
const =0;
405 virtual void value(
size_t i,
Point&)
const =0;
435 virtual void writeValue(
int) =0;
436 virtual void writeValue(
unsigned) =0;
437 virtual void writeValue(int64_t) =0;
438 virtual void writeValue(uint64_t) =0;
439 virtual void writeValue(
float) =0;
440 virtual void writeValue(
double) =0;
441 virtual void writeValue(
Decimal) =0;
442 virtual void writeValue(
DateTime) =0;
443 virtual void writeValue(
Date) =0;
444 virtual void writeValue(
Time) =0;
446 virtual void writeValue(
GYear) =0;
447 virtual void writeValue(
GMonth) =0;
448 virtual void writeValue(
GDay) =0;
451 virtual void writeValue(
const String&) =0;
452 virtual void writeValue(
Point) =0;
453 virtual void writeValue(
bool) =0;
481 virtual void startMap() =0;
485 virtual void writeMapKey(
const char*) =0;
487 virtual void endMap() =0;
507 virtual void encode(
const void*,
size_t) =0;
509 virtual void encode(
int) =0;
510 virtual void encode(
unsigned) =0;
511 virtual void encode(int64_t) =0;
512 virtual void encode(uint64_t) =0;
513 virtual void encode(
float) =0;
514 virtual void encode(
double) =0;
515 virtual void encode(
Decimal) =0;
517 virtual void encode(
Date) =0;
518 virtual void encode(
Time) =0;
520 virtual void encode(
GYear) =0;
521 virtual void encode(
GMonth) =0;
522 virtual void encode(
GDay) =0;
525 virtual void encode(
const String&) =0;
526 virtual void encode(
Point) =0;
527 virtual void encode(
bool) =0;
546 virtual void decode(
const void*&,
size_t&) =0;
547 virtual void decode(
void*,
size_t) =0;
549 virtual void decode(
int&) =0;
550 virtual void decode(
unsigned&) =0;
551 virtual void decode(int64_t&) =0;
552 virtual void decode(uint64_t&) =0;
553 virtual void decode(
float&) =0;
554 virtual void decode(
double&) =0;
555 virtual void decode(
Decimal&) =0;
557 virtual void decode(
Date&) =0;
558 virtual void decode(
Time&) =0;
560 virtual void decode(
GYear&) =0;
561 virtual void decode(
GMonth&) =0;
562 virtual void decode(
GDay&) =0;
565 virtual void decode(
String&) =0;
566 virtual void decode(
Point&) =0;
567 virtual void decode(
bool&) =0;
612 virtual LogLevel logLevel()
const =0;
614 virtual void log(LogLevel level,
const char* message) =0;
621 virtual void error(
const char* message) =0;
718 operator bool()
const {
return seq!=0; }
732 uint64_t frequency()
const;
737 void value(
int&)
const;
738 void value(
unsigned&)
const;
739 void value(int64_t&)
const;
740 void value(uint64_t&)
const;
741 void value(
float&)
const;
742 void value(
double&)
const;
745 void value(
Date&)
const;
746 void value(
Time&)
const;
748 void value(
GYear&)
const;
749 void value(
GMonth&)
const;
750 void value(
GDay&)
const;
753 void value(
String&)
const;
754 void value(
bool&)
const;
756 void value(
Point&)
const;
757 void value(
Map&)
const;
770 Map& operator=(
const Map&);
774 operator bool()
const {
return map!=0; }
777 Sequence get(
const char* key)
const;
836 virtual void close() =0;
1004 void version(
unsigned pluginVersion = makeVersion(__DATE__,__TIME__),
1005 unsigned marklogicVersion = MARKLOGIC_API_VERSION);
1023 template<
class T>
void registerAggregate(
const char* name);
1043 virtual void registerAggregate(
const char* name, AggregateFunction f) =0;
1051 static unsigned makeVersion(
const char*,
const char*);
1053 unsigned pluginVersion;
Encapsulation of XQuery sequence item value type.
Definition: MarkLogic.h:632
xs:gYearMonth
Definition: MarkLogic.h:654
C++ representation of the XQuery type xs:decimal.
Definition: MarkLogic.h:182
Encapsulation of a User Defined Function for performing aggregate analysis across co-occurrences in r...
Definition: MarkLogic.h:814
xs:gDay
Definition: MarkLogic.h:657
xs:gMonth
Definition: MarkLogic.h:656
xs:unsignedLong
Definition: MarkLogic.h:647
C++ representation of the XQuery type xs:gYear.
Definition: MarkLogic.h:222
xs:date
Definition: MarkLogic.h:653
Order
Whether the index values are in ascending or descending order.
Definition: MarkLogic.h:92
Serialize values.
Definition: MarkLogic.h:504
C++ representation of the MarkLogic XQuery cts:point.
Definition: MarkLogic.h:291
Type
The type of the values in a range index.
Definition: MarkLogic.h:69
Definition: MarkLogic.h:134
C++ representation of the XQuery type xs:time.
Definition: MarkLogic.h:206
A sequence of values produced by your AggregateUDF::finish implementation.
Definition: MarkLogic.h:429
xs:string
Definition: MarkLogic.h:86
xs:gYearMonth
Definition: MarkLogic.h:80
Type
The types of item values that can occur in a Sequence.
Definition: MarkLogic.h:642
xs:int
Definition: MarkLogic.h:644
C++ representation of the XQuery type xs:dateTime.
Definition: MarkLogic.h:190
cts:point (MarkLogic XQuery dialect)
Definition: MarkLogic.h:673
xs:time
Definition: MarkLogic.h:652
xs:long
Definition: MarkLogic.h:646
void registerAggregate(const char *name)
Register an AggregateUDF implementation with MarkLogic Server.
Definition: MarkLogic.h:1065
C++ representation of the XQuery type xs:gYearMonth.
Definition: MarkLogic.h:214
xs:time
Definition: MarkLogic.h:78
xs:float
Definition: MarkLogic.h:74
LogLevel
Available log levels.
Definition: MarkLogic.h:592
A key-value map, equivalent to the MarkLogic XQuery type map:map.
Definition: MarkLogic.h:765
xs:float
Definition: MarkLogic.h:648
xs:yearMonthDuration
Definition: MarkLogic.h:84
Log messages and report errors to MarkLogic Server. You do not need to subclass this class...
Definition: MarkLogic.h:588
xs:date
Definition: MarkLogic.h:79
xs:unsignedInt
Definition: MarkLogic.h:645
Encapsulation of the configuration of a range index.
Definition: MarkLogic.h:58
xs:boolean
Definition: MarkLogic.h:662
xs:yearMonthDuration
Definition: MarkLogic.h:658
xs:int
Definition: MarkLogic.h:70
xs:gMonth
Definition: MarkLogic.h:82
C++ representation of the XQuery type xs:dayTimeDuration.
Definition: MarkLogic.h:254
Definition: MarkLogic.h:99
C++ representation of the XQuery type xs:string, encapsulating a string value with its collation...
Definition: MarkLogic.h:263
xs:anyURI
Definition: MarkLogic.h:661
xs:anyURI
Definition: MarkLogic.h:87
xs:double
Definition: MarkLogic.h:649
The MarkLogic Server native plugin registry.
Definition: MarkLogic.h:985
xs:decimal
Definition: MarkLogic.h:76
A sequence of Item values.
Definition: MarkLogic.h:709
Iterator over a sequence of N-way co-occurrences of range index values from a single stand...
Definition: MarkLogic.h:339
xs:dayTimeDuration
Definition: MarkLogic.h:85
xs:gYear
Definition: MarkLogic.h:655
C++ representation of the XQuery type xs:gMonth.
Definition: MarkLogic.h:230
map:map (MarkLogic XQuery dialect)
Definition: MarkLogic.h:674
xs:decimal
Definition: MarkLogic.h:650
xs:double
Definition: MarkLogic.h:75
C++ representation of the XQuery type xs:date.
Definition: MarkLogic.h:198
C++ representation of the XQuery type xs:gDay.
Definition: MarkLogic.h:238
xs:gYear
Definition: MarkLogic.h:81
xs:dateTime
Definition: MarkLogic.h:77
xs:gDay
Definition: MarkLogic.h:83
xs:unsignedInt
Definition: MarkLogic.h:71
xs:string
Definition: MarkLogic.h:660
xs:long
Definition: MarkLogic.h:72
Definition: MarkLogic.h:148
xs:dateTime
Definition: MarkLogic.h:651
C++ representation of the XQuery type xs:yearMonthDuration.
Definition: MarkLogic.h:246
xs:unsignedLong
Definition: MarkLogic.h:73
De-serialize values.
Definition: MarkLogic.h:543
Definition: MarkLogic.h:162
xs:dayTimeDuration
Definition: MarkLogic.h:659