Apps
Components
Interfaces
All Files
Source Tree
source:
tos.lib.TinyDB.TableM.nc
Component: TableM
Required Interfaces
MemAlloc
Provided Interfaces
Table
StdControl
Variables
uint8_t mIdx
char *mName
uint8_t mType
ParsedQuery *mQuery
bool mAllocing
uint8_t nameSize(char *names, uint8_t i)
uint8_t *getTypes(ParsedQuery *pq)
char *getAliases(ParsedQuery *pq)
uint8_t nameOffset(char *names, uint8_t i)
char typestr[5]
Return the type of the specified field in the table, if the table has named fields.
Function Index
command result_t
StdControl.init
(void)
command result_t
StdControl.start
(void)
command result_t
StdControl.stop
(void)
command result_t
Table.addNamedField
(ParsedQuery *pq, uint8_t idx, char *name, uint8_t type)
Add the specified named field (with the specified type) to the auxiliary table info stored in the query.
uint8_t
getTypes
(ParsedQuery *pq)
char
getAliases
(ParsedQuery *pq)
command bool
Table.hasNamedFields
(ParsedQuery *pq)
command result_t
Table.getType
(ParsedQuery *pq, uint8_t fieldIdx, uint8_t *type)
command result_t
Table.getNamedField
(ParsedQuery *pq, char *field, uint8_t *fieldId)
Return the field index which corresponds to ths specified named field.
command result_t
Table.getFieldName
(ParsedQuery *pq, uint8_t idx, char **name)
Given an index into the fields array, return the name which corresponds to the specified field.
task void
addField
(void)
Completion task which is called after a field gets added
event result_t
MemAlloc.allocComplete
(HandlePtr handle, result_t success)
uint8_t
nameOffset
(char *names, uint8_t i)
uint8_t
nameSize
(char *names, uint8_t i)
uint8_t
totalNameSize
(ParsedQuery *pq)
event result_t
MemAlloc.reallocComplete
(Handle handle, result_t success)
event result_t
MemAlloc.compactComplete
(void)
Function Descriptions
Table.addNamedField
command result_t
Table.addNamedField
(ParsedQuery *pq, uint8_t idx, char *name, uint8_t type)
Add the specified named field (with the specified type) to the auxiliary table info stored in the query. Idx is the index of the field in the table. If a field with this index already exists it will be overwritten. If index is greater than pq->numField, will return FAIL. If an allocation is already pending, will return FAIL. Split phase operation, with completion signalled via addNamedFieldDone() event Name and pq must not be allocated on caller's stack
Table.getNamedField
command result_t
Table.getNamedField
(ParsedQuery *pq, char *field, uint8_t *fieldId)
Return the field index which corresponds to ths specified named field. If no such field exists, return FAIL.
Table.getFieldName
command result_t
Table.getFieldName
(ParsedQuery *pq, uint8_t idx, char **name)
Given an index into the fields array, return the name which corresponds to the specified field. If no such field exists, return FAIL.