more refact
This commit is contained in:
parent
010f1d2e2f
commit
d6f02761a0
|
@ -42,11 +42,13 @@ int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema *
|
||||||
void tTSchemaDestroy(STSchema *pTSchema);
|
void tTSchemaDestroy(STSchema *pTSchema);
|
||||||
|
|
||||||
// SColVal
|
// SColVal
|
||||||
#define ColValNONE ((SColVal){.type = COL_VAL_NONE, .nData = 0, .pData = NULL})
|
// #define ColValNONE ((SColVal){.type = COL_VAL_NONE, .nData = 0, .pData = NULL})
|
||||||
#define ColValNULL ((SColVal){.type = COL_VAL_NULL, .nData = 0, .pData = NULL})
|
// #define ColValNULL ((SColVal){.type = COL_VAL_NULL, .nData = 0, .pData = NULL})
|
||||||
#define ColValDATA(nData, pData) ((SColVal){.type = COL_VAL_DATA, .nData = (nData), .pData = (pData)})
|
// #define ColValDATA(nData, pData) ((SColVal){.type = COL_VAL_DATA, .nData = (nData), .pData = (pData)})
|
||||||
|
|
||||||
// STSRow2
|
// STSRow2
|
||||||
|
int32_t tTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow2 **ppRow);
|
||||||
|
|
||||||
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow);
|
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow);
|
||||||
int32_t tGetTSRow(uint8_t *p, STSRow2 *pRow);
|
int32_t tGetTSRow(uint8_t *p, STSRow2 *pRow);
|
||||||
int32_t tTSRowDup(const STSRow2 *pRow, STSRow2 **ppRow);
|
int32_t tTSRowDup(const STSRow2 *pRow, STSRow2 **ppRow);
|
||||||
|
@ -54,11 +56,13 @@ void tTSRowFree(STSRow2 *pRow);
|
||||||
int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal);
|
int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal);
|
||||||
|
|
||||||
// STSRowBuilder
|
// STSRowBuilder
|
||||||
|
#if 0
|
||||||
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema);
|
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema);
|
||||||
void tTSRowBuilderClear(STSRowBuilder *pBuilder);
|
void tTSRowBuilderClear(STSRowBuilder *pBuilder);
|
||||||
void tTSRowBuilderReset(STSRowBuilder *pBuilder);
|
void tTSRowBuilderReset(STSRowBuilder *pBuilder);
|
||||||
int32_t tTSRowBuilderPut(STSRowBuilder *pBuilder, int32_t cid, uint8_t *pData, uint32_t nData);
|
int32_t tTSRowBuilderPut(STSRowBuilder *pBuilder, int32_t cid, uint8_t *pData, uint32_t nData);
|
||||||
int32_t tTSRowBuilderGetRow(STSRowBuilder *pBuilder, const STSRow2 **ppRow);
|
int32_t tTSRowBuilderGetRow(STSRowBuilder *pBuilder, const STSRow2 **ppRow);
|
||||||
|
#endif
|
||||||
|
|
||||||
// STagVal
|
// STagVal
|
||||||
static FORCE_INLINE void tTagValPush(SArray *pTagArray, void *key, int8_t type, uint8_t *pData, uint32_t nData,
|
static FORCE_INLINE void tTagValPush(SArray *pTagArray, void *key, int8_t type, uint8_t *pData, uint32_t nData,
|
||||||
|
@ -137,11 +141,12 @@ struct SValue {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum { COL_VAL_NONE = 0, COL_VAL_NULL = 1, COL_VAL_DATA = 2 } EColValT;
|
|
||||||
struct SColVal {
|
struct SColVal {
|
||||||
EColValT type;
|
int8_t isNone;
|
||||||
uint32_t nData;
|
int8_t isNull;
|
||||||
uint8_t *pData;
|
int8_t type;
|
||||||
|
int16_t cid;
|
||||||
|
SValue value;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct STagVal {
|
struct STagVal {
|
||||||
|
|
|
@ -146,7 +146,13 @@ static int32_t tGetSValue(uint8_t *p, SValue *pValue, int8_t type) {
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STSRow2
|
// STSRow2 ========================================================================
|
||||||
|
int32_t tTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow2 **ppRow) {
|
||||||
|
int32_t code = 0;
|
||||||
|
// TODO
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow) {
|
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow) {
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
|
|
||||||
|
@ -215,6 +221,7 @@ void tTSRowFree(STSRow2 *pRow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
|
int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
|
||||||
|
#if 0
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
|
@ -310,6 +317,7 @@ int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,6 +362,7 @@ void tTSchemaDestroy(STSchema *pTSchema) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// STSRowBuilder
|
// STSRowBuilder
|
||||||
|
#if 0
|
||||||
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema) {
|
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema) {
|
||||||
if (tTSchemaCreate(sver, pSchema, nCols, &pBuilder->pTSchema) < 0) return -1;
|
if (tTSchemaCreate(sver, pSchema, nCols, &pBuilder->pTSchema) < 0) return -1;
|
||||||
|
|
||||||
|
@ -612,6 +621,7 @@ int32_t tTSRowBuilderGetRow(STSRowBuilder *pBuilder, const STSRow2 **ppRow) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int tTagValCmprFn(const void *p1, const void *p2) {
|
static int tTagValCmprFn(const void *p1, const void *p2) {
|
||||||
if (((STagVal *)p1)->cid < ((STagVal *)p2)->cid) {
|
if (((STagVal *)p1)->cid < ((STagVal *)p2)->cid) {
|
||||||
|
|
Loading…
Reference in New Issue