Apps
Components
Interfaces
All Files
Source Tree
source:
tos.lib.TinyDB.AggOperator.nc
Component: AggOperator
Required Interfaces
MemAlloc
QueryProcessor
TupleIntf
ParsedQueryIntf
ExprEval
Leds
QueryResultIntf
void
signalError
(TinyDBError err)
Provided Interfaces
Operator
TinyDBError
addResults
(QueryResult *qr, ParsedQuery *q, Expr *e)
Install all of the results for the last epoch of expression e from pq into qr.
TinyDBError
finalizeAggExpr
(QueryResult *qr, ParsedQueryPtr q, Expr *e, char *result_buf)
short
getGroupNoFromQr
(QueryResult *qr)
Returns:
The group number from this query result
Variables
typedef struct AggOperator.__nesc_unnamed4318 { int numGroups; int groupSize; char groupData[1]; } GroupData
typedef struct AggOperator.__nesc_unnamed4318 { int numGroups; int groupSize; char groupData[1]; } *GroupDataPtr
typedef struct AggOperator.__nesc_unnamed4318 { int numGroups; int groupSize; char groupData[1]; } **GroupDataHandle
typedef struct AggOperator.__nesc_unnamed4319 { short value; short id; } AlgebraicData
typedef struct AggOperator.__nesc_unnamed4320 { short sum; short count; } AverageData
typedef struct AggOperator.__nesc_unnamed4321 { short ids[3]; short mins[3]; } Min3Data
typedef struct AggOperator.__nesc_unnamed4322 { short groupNo; union AggOperator.__nesc_unnamed4323 { bool empty; char exprIdx; } u; union AggOperator.__nesc_unnamed4324 { AggOperator.AlgebraicData algd; AggOperator.AverageData avgd; AggOperator.Min3Data min3d; } d; } GroupRecord
typedef void (*GroupDataCallback)(AggOperator.GroupRecord *d)
AggOperator.GroupDataCallback mCallback
ParsedQuery *mCurQuery
Expr *mCurExpr
QueryResult *mCurResult
Tuple *mCurTuple
short mCurGroup
Handle mAlloced
AggOperator.GroupRecord *mGroupRecord
void getGroupData(ParsedQuery *pq, short groupNo, Expr *e, AggOperator.GroupDataCallback callback)
void updateGroupForTuple(AggOperator.GroupRecord *d)
short groupSize(Expr *e)
void mergeAggregateValues(AggOperator.GroupRecord *dest, AggOperator.GroupRecord *merge, Expr *e)
void updateAggregateValue(AggOperator.GroupRecord *d, Expr *e, short fieldValue)
void initAggregateValue(AggOperator.GroupRecord *d, Expr *)
void updateGroupForPartialResult(AggOperator.GroupRecord *d)
AggOperator.GroupRecord *findGroup(AggOperator.GroupDataHandle dh, short groupNum)
AggOperator.GroupRecord *addGroup(AggOperator.GroupDataHandle dh, short groupNum)
bool removeEmptyGroup(AggOperator.GroupDataHandle dh)
short getGroupNo(Tuple *t, ParsedQuery *q, Expr *e)
bool aggEqual(AggOperator.GroupRecord *r1, AggOperator.GroupRecord *r2, Expr *e)
bool aggHasData(QueryResult *qr, ParsedQueryPtr q, Expr *e)
task void fireCallback(void)
Function Index
AggOperator.GroupRecord
GET_GROUP_DATA
(AggOperator.GroupDataHandle dHan, uint8_t n)
void
SET_GROUP_DATA
(AggOperator.GroupDataHandle dHan, uint8_t n, char *dataptr)
void
COPY_GROUP_DATA
(AggOperator.GroupDataHandle dHan, uint8_t n, char *dest)
command TinyDBError
Operator.processPartialResult
(QueryResultPtr qr, ParsedQueryPtr qs, ExprPtr e)
command bool
Operator.resultIsForExpr
(QueryResultPtr qr, ExprPtr e)
void
updateGroupForPartialResult
(AggOperator.GroupRecord *d)
command TinyDBError
Operator.nextResult
(QueryResultPtr qr, ParsedQueryPtr qs, ExprPtr e)
command TinyDBError
addResults
(QueryResult *qr, ParsedQuery *pq, ExprPtr e)
Install all of the results for the last epoch of expression e from pq into qr.
command TinyDBError
Operator.processTuple
(ParsedQueryPtr qs, TuplePtr t, ExprPtr e)
command result_t
Operator.endOfEpoch
(ParsedQueryPtr q, ExprPtr e)
event result_t
QueryProcessor.queryComplete
(ParsedQuery *q)
void
updateGroupForTuple
(AggOperator.GroupRecord *d)
event result_t
MemAlloc.allocComplete
(HandlePtr h, uint8_t success)
event result_t
MemAlloc.reallocComplete
(Handle h, uint8_t success)
event result_t
MemAlloc.compactComplete
(void)
AggOperator.GroupRecord
findGroup
(AggOperator.GroupDataHandle dh, short groupNum)
bool
removeEmptyGroup
(AggOperator.GroupDataHandle dh)
AggOperator.GroupRecord
addGroup
(AggOperator.GroupDataHandle dh, short groupNum)
void
getGroupData
(ParsedQuery *pq, short groupNo, Expr *e, AggOperator.GroupDataCallback callback)
task void
fireCallback
(void)
short
getGroupNo
(Tuple *t, ParsedQuery *q, Expr *e)
bool
aggEqual
(AggOperator.GroupRecord *r1, AggOperator.GroupRecord *r2, Expr *e)
short
groupSize
(Expr *e)
void
mergeAggregateValues
(AggOperator.GroupRecord *dest, AggOperator.GroupRecord *merge, Expr *e)
void
updateAggregateValue
(AggOperator.GroupRecord *d, Expr *e, short fieldValue)
void
initAggregateValue
(AggOperator.GroupRecord *d, Expr *e)
bool
aggHasData
(QueryResult *qr, ParsedQueryPtr q, Expr *e)
command short
getGroupNoFromQr
(QueryResult *qr)
Returns:
The group number from this query result
command TinyDBError
finalizeAggExpr
(QueryResult *qr, ParsedQueryPtr q, Expr *e, char *result_buf)