Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.TinyDB.DBBufferC.nc

Component: DBBufferC

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

DBBuffer.alloc

command TinyDBError DBBuffer.alloc (uint8_t bufferId, BufferType type, uint16_t size, BufferPolicy policy, ParsedQuery *schema, bool *pending, long data)

Allocate the buffer with the specified size sizes is an array of sizes of each field, with one entry per field

Note that this may keep a reference to schema until after pending is complete.

Signals allocComplete when allocation is complete if *pending is true on return

Parameters:

bufferId - The buffer to allocate

type - The type of the buffer (see DBBuffer.h -- only kRAM and kRADIO are supported)

size - The size (in rows) of the buffer

policy - The eviction policy to use with the buffer (see DBBuffer.h)

schema - The schema (layout) of rows in this buffer (expressed as a query)

pending - On return, set to true if the buffer is still being allocated (expect allocComplete if true).

data - is currently unused

Returns: err_UnsupportedPolicy if the specified policy can't be applied


getBuf

TinyDBError getBuf(uint8_t bufId, DBBufferC.Buffer **buf)

(PRIVATE) Return a pointer to buffer bufId in buf if bufId is a valid buf. Otherwise, return err_InvalidIndex