All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Enumerations
target/Linux-x86_64/include/aerospike/as_query.h File Reference
#include <aerospike/as_bin.h>
#include <aerospike/as_key.h>
#include <aerospike/as_list.h>
#include <aerospike/as_udf.h>
#include <stdarg.h>
+ Include dependency graph for target/Linux-x86_64/include/aerospike/as_query.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_ordering
 
struct  as_predicate
 
union  as_predicate_value
 
struct  as_query
 
struct  as_query_bins
 
struct  as_query_ordering
 
struct  as_query_predicates
 

Macros

#define as_query_orderby_inita(__query, __n)
 
#define as_query_select_inita(__query, __n)
 
#define as_query_where_inita(__query, __n)
 
#define integer_equals(__val)   AS_PREDICATE_INTEGER_EQUAL, __val
 
#define integer_range(__min, __max)   AS_PREDICATE_INTEGER_RANGE, __min, __max
 
#define string_equals(__val)   AS_PREDICATE_STRING_EQUAL, __val
 

Enumerations

enum  as_order { AS_ORDER_ASCENDING = 0, AS_ORDER_DESCENDING = 1, AS_ORDER_ASCENDING = 0, AS_ORDER_DESCENDING = 1 }
 
enum  as_predicate_type {
  AS_PREDICATE_STRING_EQUAL, AS_PREDICATE_INTEGER_EQUAL, AS_PREDICATE_INTEGER_RANGE, AS_PREDICATE_STRING_EQUAL,
  AS_PREDICATE_INTEGER_EQUAL, AS_PREDICATE_INTEGER_RANGE
}
 

Macro Definition Documentation

#define as_query_orderby_inita (   __query,
  __n 
)
related
Value:
if ( (__query) != NULL && (__query)->orderby.entries == NULL ) {\
(__query)->orderby.entries = (as_ordering *) alloca(__n * sizeof(as_ordering));\
if ( (__query)->orderby.entries ) { \
(__query)->orderby._free = false;\
(__query)->orderby.capacity = __n;\
(__query)->orderby.size = 0;\
}\
}

Initializes as_query.where with a capacity of n using alloca().

For heap allocation, use as_query_where_init().

Parameters
__queryThe query to initialize.
__nThe number of as_orders to allocate.
Returns
On success, true. Otherwise an error occurred.

Definition at line 724 of file target/Linux-x86_64/include/aerospike/as_query.h.

#define as_query_select_inita (   __query,
  __n 
)
related
Value:
if ( (__query) != NULL && (__query)->select.entries == NULL ) {\
(__query)->select.entries = (as_bin_name *) alloca(__n * sizeof(as_bin_name));\
if ( (__query)->select.entries ) { \
(__query)->select._free = false;\
(__query)->select.capacity = __n;\
(__query)->select.size = 0;\
}\
}

Initializes as_query.select with a capacity of n using alloca

For heap allocation, use as_query_select_init().

as_query_select(&query, "bin1");
as_query_select(&query, "bin2");
Parameters
__queryThe query to initialize.
__nThe number of bins to allocate.

Definition at line 572 of file target/Linux-x86_64/include/aerospike/as_query.h.

#define as_query_where_inita (   __query,
  __n 
)
related
Value:
if ( (__query) != NULL && (__query)->where.entries == NULL ) {\
(__query)->where.entries = (as_predicate *) alloca(__n * sizeof(as_predicate));\
if ( (__query)->where.entries ) { \
(__query)->where._free = false;\
(__query)->where.capacity = __n;\
(__query)->where.size = 0;\
}\
}

Initializes as_query.where with a capacity of n using alloca().

For heap allocation, use as_query_where_init().

as_query_where(&query, "bin1", string_equals("abc"));
as_query_where(&query, "bin2", integer_equals(123));
as_query_where(&query, "bin3", integer_range(0,123));
Parameters
__queryThe query to initialize.
__nThe number of as_predicate to allocate.
Returns
On success, true. Otherwise an error occurred.

Definition at line 648 of file target/Linux-x86_64/include/aerospike/as_query.h.

#define integer_equals (   __val)    AS_PREDICATE_INTEGER_EQUAL, __val
related

Macro for setting setting the INTEGER_EQUAL predicate.

as_query_where(query, "bin1", integer_equals(123));

Definition at line 57 of file target/Linux-x86_64/include/aerospike/as_query.h.

#define integer_range (   __min,
  __max 
)    AS_PREDICATE_INTEGER_RANGE, __min, __max
related

Macro for setting setting the INTEGER_RANGE predicate.

as_query_where(query, "bin1", integer_range(1,100));

Definition at line 69 of file target/Linux-x86_64/include/aerospike/as_query.h.

#define string_equals (   __val)    AS_PREDICATE_STRING_EQUAL, __val
related

Macro for setting setting the STRING_EQUAL predicate.

as_query_where(query, "bin1", string_equals("abc"));

Definition at line 46 of file target/Linux-x86_64/include/aerospike/as_query.h.

Enumeration Type Documentation

enum as_order

Enumerations defining the direction of an ordering.

Enumerator
AS_ORDER_ASCENDING 

Ascending order

AS_ORDER_DESCENDING 

bin should be in ascending order

AS_ORDER_ASCENDING 

Ascending order

AS_ORDER_DESCENDING 

bin should be in ascending order

Definition at line 160 of file target/Linux-x86_64/include/aerospike/as_query.h.

The types of predicates supported.

Enumerator
AS_PREDICATE_STRING_EQUAL 

String Equality Predicate. Requires as_predicate_value.string to be set.

AS_PREDICATE_INTEGER_EQUAL 

Integer Equality Predicate. Requires as_predicate_value.integer to be set.

AS_PREDICATE_INTEGER_RANGE 

Integer Range Predicate. Requires as_predicate_value.integer_range to be set.

AS_PREDICATE_STRING_EQUAL 

String Equality Predicate. Requires as_predicate_value.string to be set.

AS_PREDICATE_INTEGER_EQUAL 

Integer Equality Predicate. Requires as_predicate_value.integer to be set.

AS_PREDICATE_INTEGER_RANGE 

Integer Range Predicate. Requires as_predicate_value.integer_range to be set.

Definition at line 112 of file target/Linux-x86_64/include/aerospike/as_query.h.