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

Interface: TupleIntf

TupleIntf allows interactions with Tuples, which are base data fetched from the Attr interface and stored in a packed array of fixed width fields.

Note that Tuple's should not be confused with QueryResults (or QueryResultTuples) which represent more complicated, arbitrary sized data structures consisting of an arbitrary number of records. Tuples are used internally to collect data about sensors -- QueryResults are sent to neighboring motes and stored in result buffers for external processing.

Components providing this interface:
tos.lib.TinyDB.Tuple

Components requiring this interface:
tos.lib.TinyDB.AggOperator
tos.lib.TinyDB.DBBufferC
tos.lib.TinyDB.ParsedQuery
tos.lib.TinyDB.QueryResult
tos.lib.TinyDB.SelOperator
tos.lib.TinyDB.TupleRouterM

Commands

Commands - Details

setField

result_t setField(ParsedQueryPtr q, TuplePtr t, uint8_t fieldIdx, CharPtr data)

Set the speccified field in the specified tuple corresponding to the specified query to the specified data.

Parameters:

q - The query that t belongs to

t - The tuple whose field should be set

fieldIdx - The field to set in t

data - The data to write to t (fieldSize(...) bytes will be copied

Returns: FAIL if the field is out of range or NULL, or SUCCESS otherwise

getNextQueryField

AttrDescPtr getNextQueryField(ParsedQueryPtr q, TuplePtr t)

Returns: An attribute descriptor for the next unset field in the specified tuple, or NULL if all fields are set.