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 2
99 template<
class T,
typename PT>
109 operator PT&() {
return val; }
110 operator const PT&()
const {
return 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; }
117 bool 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; }
122 T operator/(T o)
const {
return val / o.val; }
124 T operator--(
int) {
return val--; }
125 T operator++(
int) {
return val++; }
126 T& operator--() { --val;
return (T&)*
this; }
127 T& operator++() { ++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; }
131 T& operator/=(T o) { val /= o.val;
return (T&)*
this; }
134 template<
class T,
typename PT>
144 T operator-()
const {
return -this->val; }
145 T operator+()
const {
return +this->val; }
148 template<
class T,
typename PT>
158 T operator%(T o)
const {
return this->val % o.val; }
159 T& operator%=(T o) { this->val %= o.val;
return (T&)*
this; }
162 template<
class T,
typename PT>
172 T operator-()
const {
return -this->val; }
173 T operator+()
const {
return +this->val; }
178 typedef double DecimalType;
180 typedef long double DecimalType;
268 String(
const char* _str,
const char* _collation = 0);
273 operator bool()
const {
return str!=0; }
275 operator const char*()
const;
276 const char*
get()
const;
277 size_t length()
const;
278 const char* collation()
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;
285 bool operator!=(
const String& o)
const;
297 LangString(
const char* _str,
const char* _language = 0);
302 operator bool ()
const {
return str!=0; }
304 operator const char*()
const;
305 const char*
get()
const;
306 size_t length()
const;
307 const char* language()
const;
330 Point(
float _lat,
float _lng,
const char* _coordinateSystem =
"wgs84");
332 float latitude()
const;
333 float longitude()
const;
334 const char* coordinateSystem()
const;
336 bool operator<(
const Point& o)
const;
337 bool operator<=(
const Point& o)
const;
338 bool operator>(
const Point& o)
const;
339 bool operator>=(
const Point& o)
const;
340 bool operator==(
const Point& o)
const;
341 bool operator!=(
const Point& o)
const;
373 virtual void next() =0;
375 virtual bool done()
const =0;
379 virtual bool descending()
const =0;
381 virtual size_t width()
const =0;
387 virtual const char* collation(
size_t i)
const =0;
391 virtual const char* coordinateSystem(
size_t i)
const =0;
400 virtual uint64_t frequency()
const =0;
404 virtual bool null(
size_t i)
const =0;
418 virtual void value(
size_t i,
int&)
const =0;
419 virtual void value(
size_t i,
unsigned&)
const =0;
420 virtual void value(
size_t i, int64_t&)
const =0;
421 virtual void value(
size_t i, uint64_t&)
const =0;
422 virtual void value(
size_t i,
float&)
const =0;
423 virtual void value(
size_t i,
double&)
const =0;
424 virtual void value(
size_t i,
Decimal&)
const =0;
425 virtual void value(
size_t i,
DateTime&)
const =0;
426 virtual void value(
size_t i,
Date&)
const =0;
427 virtual void value(
size_t i,
Time&)
const =0;
428 virtual void value(
size_t i,
GYearMonth&)
const =0;
429 virtual void value(
size_t i,
GYear&)
const =0;
430 virtual void value(
size_t i,
GMonth&)
const =0;
431 virtual void value(
size_t i,
GDay&)
const =0;
434 virtual void value(
size_t i,
String&)
const =0;
435 virtual void value(
size_t i,
Point&)
const =0;
436 virtual void value(
size_t i,
LangString&)
const =0;
466 virtual void writeValue(
int) =0;
467 virtual void writeValue(
unsigned) =0;
468 virtual void writeValue(int64_t) =0;
469 virtual void writeValue(uint64_t) =0;
470 virtual void writeValue(
float) =0;
471 virtual void writeValue(
double) =0;
472 virtual void writeValue(
Decimal) =0;
473 virtual void writeValue(
DateTime) =0;
474 virtual void writeValue(
Date) =0;
475 virtual void writeValue(
Time) =0;
477 virtual void writeValue(
GYear) =0;
478 virtual void writeValue(
GMonth) =0;
479 virtual void writeValue(
GDay) =0;
482 virtual void writeValue(
const String&) =0;
483 virtual void writeValue(
Point) =0;
484 virtual void writeValue(
bool) =0;
485 virtual void writeValue(
const LangString&) =0;
513 virtual void startMap() =0;
517 virtual void writeMapKey(
const char*) =0;
519 virtual void endMap() =0;
539 virtual void encode(
const void*,
size_t) =0;
541 virtual void encode(
int) =0;
542 virtual void encode(
unsigned) =0;
543 virtual void encode(int64_t) =0;
544 virtual void encode(uint64_t) =0;
545 virtual void encode(
float) =0;
546 virtual void encode(
double) =0;
547 virtual void encode(
Decimal) =0;
549 virtual void encode(
Date) =0;
550 virtual void encode(
Time) =0;
552 virtual void encode(
GYear) =0;
553 virtual void encode(
GMonth) =0;
554 virtual void encode(
GDay) =0;
557 virtual void encode(
const String&) =0;
558 virtual void encode(
Point) =0;
559 virtual void encode(
bool) =0;
579 virtual void decode(
const void*&,
size_t&) =0;
580 virtual void decode(
void*,
size_t) =0;
582 virtual void decode(
int&) =0;
583 virtual void decode(
unsigned&) =0;
584 virtual void decode(int64_t&) =0;
585 virtual void decode(uint64_t&) =0;
586 virtual void decode(
float&) =0;
587 virtual void decode(
double&) =0;
588 virtual void decode(
Decimal&) =0;
590 virtual void decode(
Date&) =0;
591 virtual void decode(
Time&) =0;
593 virtual void decode(
GYear&) =0;
594 virtual void decode(
GMonth&) =0;
595 virtual void decode(
GDay&) =0;
598 virtual void decode(
String&) =0;
599 virtual void decode(
Point&) =0;
600 virtual void decode(
bool&) =0;
646 virtual LogLevel logLevel()
const =0;
648 virtual void log(LogLevel level,
const char* message) =0;
655 virtual void error(
const char* message) =0;
755 operator bool()
const {
return seq!=0; }
769 uint64_t frequency()
const;
774 void value(
int&)
const;
775 void value(
unsigned&)
const;
776 void value(int64_t&)
const;
777 void value(uint64_t&)
const;
778 void value(
float&)
const;
779 void value(
double&)
const;
782 void value(
Date&)
const;
783 void value(
Time&)
const;
785 void value(
GYear&)
const;
786 void value(
GMonth&)
const;
787 void value(
GDay&)
const;
790 void value(
String&)
const;
791 void value(
bool&)
const;
793 void value(
Point&)
const;
794 void value(
Map&)
const;
808 Map& operator=(
const Map&);
812 operator bool()
const {
return map!=0; }
815 Sequence get(
const char* key)
const;
874 virtual void close() =0;
1042 void version(
unsigned pluginVersion = makeVersion(__DATE__,__TIME__),
1043 unsigned marklogicVersion = MARKLOGIC_API_VERSION);
1061 template<
class T>
void registerAggregate(
const char* name);
1081 virtual void registerAggregate(
const char* name, AggregateFunction f) =0;
1089 static unsigned makeVersion(
const char*,
const char*);
1091 unsigned pluginVersion;
Encapsulation of XQuery sequence item value type.
Definition: MarkLogic.h:666
xs:gYearMonth
Definition: MarkLogic.h:688
C++ representation of the XQuery type xs:decimal.
Definition: MarkLogic.h:183
Encapsulation of a User Defined Function for performing aggregate analysis across co-occurrences in r...
Definition: MarkLogic.h:852
xs:gDay
Definition: MarkLogic.h:691
xs:gMonth
Definition: MarkLogic.h:690
xs:unsignedLong
Definition: MarkLogic.h:681
C++ representation of the XQuery type xs:gYear.
Definition: MarkLogic.h:223
xs:date
Definition: MarkLogic.h:687
Order
Whether the index values are in ascending or descending order.
Definition: MarkLogic.h:93
Serialize values.
Definition: MarkLogic.h:536
C++ representation of the MarkLogic XQuery cts:point.
Definition: MarkLogic.h:321
Type
The type of the values in a range index.
Definition: MarkLogic.h:70
Definition: MarkLogic.h:135
C++ representation of the RDF type rdf:langString, encapsulating a string value with its language...
Definition: MarkLogic.h:293
C++ representation of the XQuery type xs:time.
Definition: MarkLogic.h:207
A sequence of values produced by your AggregateUDF::finish implementation.
Definition: MarkLogic.h:460
xs:string
Definition: MarkLogic.h:87
xs:gYearMonth
Definition: MarkLogic.h:81
Type
The types of item values that can occur in a Sequence.
Definition: MarkLogic.h:676
xs:int
Definition: MarkLogic.h:678
C++ representation of the XQuery type xs:dateTime.
Definition: MarkLogic.h:191
cts:point (MarkLogic XQuery dialect)
Definition: MarkLogic.h:707
xs:time
Definition: MarkLogic.h:686
xs:long
Definition: MarkLogic.h:680
void registerAggregate(const char *name)
Register an AggregateUDF implementation with MarkLogic Server.
Definition: MarkLogic.h:1103
C++ representation of the XQuery type xs:gYearMonth.
Definition: MarkLogic.h:215
xs:time
Definition: MarkLogic.h:79
xs:float
Definition: MarkLogic.h:75
LogLevel
Available log levels.
Definition: MarkLogic.h:626
A key-value map, equivalent to the MarkLogic XQuery type map:map.
Definition: MarkLogic.h:803
xs:float
Definition: MarkLogic.h:682
xs:yearMonthDuration
Definition: MarkLogic.h:85
Log messages and report errors to MarkLogic Server. You do not need to subclass this class...
Definition: MarkLogic.h:622
xs:date
Definition: MarkLogic.h:80
xs:unsignedInt
Definition: MarkLogic.h:679
Encapsulation of the configuration of a range index.
Definition: MarkLogic.h:59
xs:boolean
Definition: MarkLogic.h:696
xs:yearMonthDuration
Definition: MarkLogic.h:692
xs:int
Definition: MarkLogic.h:71
rdf:langString (SPARQL)
Definition: MarkLogic.h:711
xs:gMonth
Definition: MarkLogic.h:83
C++ representation of the XQuery type xs:dayTimeDuration.
Definition: MarkLogic.h:255
Definition: MarkLogic.h:100
C++ representation of the XQuery type xs:string, encapsulating a string value with its collation...
Definition: MarkLogic.h:264
xs:anyURI
Definition: MarkLogic.h:695
xs:anyURI
Definition: MarkLogic.h:88
xs:double
Definition: MarkLogic.h:683
The MarkLogic Server native plugin registry.
Definition: MarkLogic.h:1023
xs:decimal
Definition: MarkLogic.h:77
A sequence of Item values.
Definition: MarkLogic.h:746
Iterator over a sequence of N-way co-occurrences of range index values from a single stand...
Definition: MarkLogic.h:369
xs:dayTimeDuration
Definition: MarkLogic.h:86
xs:gYear
Definition: MarkLogic.h:689
C++ representation of the XQuery type xs:gMonth.
Definition: MarkLogic.h:231
map:map (MarkLogic XQuery dialect)
Definition: MarkLogic.h:708
xs:decimal
Definition: MarkLogic.h:684
xs:double
Definition: MarkLogic.h:76
C++ representation of the XQuery type xs:date.
Definition: MarkLogic.h:199
C++ representation of the XQuery type xs:gDay.
Definition: MarkLogic.h:239
xs:gYear
Definition: MarkLogic.h:82
xs:dateTime
Definition: MarkLogic.h:78
xs:gDay
Definition: MarkLogic.h:84
xs:unsignedInt
Definition: MarkLogic.h:72
xs:string
Definition: MarkLogic.h:694
xs:long
Definition: MarkLogic.h:73
Definition: MarkLogic.h:149
xs:dateTime
Definition: MarkLogic.h:685
C++ representation of the XQuery type xs:yearMonthDuration.
Definition: MarkLogic.h:247
xs:unsignedLong
Definition: MarkLogic.h:74
De-serialize values.
Definition: MarkLogic.h:576
Definition: MarkLogic.h:163
xs:dayTimeDuration
Definition: MarkLogic.h:693