All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros
target/Darwin-i386/include/aerospike/as_batch.h File Reference
#include <aerospike/as_bin.h>
#include <aerospike/as_key.h>
#include <aerospike/as_record.h>
#include <aerospike/as_status.h>
#include <stdint.h>
#include <stdbool.h>
+ Include dependency graph for target/Darwin-i386/include/aerospike/as_batch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_batch
 
struct  as_batch_read
 

Macros

#define as_batch_inita(__batch, __size)
 

Macro Definition Documentation

#define as_batch_inita (   __batch,
  __size 
)
related
Value:
if ( (__batch) != NULL ) {\
(__batch)->_free = false;\
(__batch)->keys.entries = (as_key *) alloca(sizeof(as_key) * __size);\
if ( (__batch)->keys.entries ) { \
(__batch)->keys._free = false;\
(__batch)->keys.size = __size;\
}\
}

Initializes as_batch with specified capacity using alloca().

For heap allocation, use as_batch_new().

as_batch batch;
as_batch_inita(&batch, 2);
as_key_init(as_batch_get(&batch, 0), "ns", "set", "key1");
as_key_init(as_batch_get(&batch, 1), "ns", "set", "key2");

When the batch is no longer needed, then use as_batch_destroy() to release the batch and associated resources.

Parameters
__batchThe query to initialize.
__capacityThe number of keys to allocate.

Definition at line 128 of file target/Darwin-i386/include/aerospike/as_batch.h.