📄 zbcache.nc
字号:
/****** * FIFO cache interface */interface ZbCache<t> {/***** * get a empty element from free queue, return NULL if free queue is empty. * after call fetchFree(), the first element in free queue will be delete. * producer should fill the element and put it into full queue for consumer use. */ async command t* fetchFree();/**** * put the element into free queue, return SUCCESS if put success, FAIL otherwise. * after using the element, consumer should put it back into free queue for producer use. */ async command error_t putFree(t* pElement);/** * get the first full element from full queue, return NULL if full queue is empty. * after call getFree(), the first element in full queue will not be delete. */ async command t* getFull();/** * get the first full element from full queue, return NULL if full queue is empty. * after call fetchFree(), the first element in full queue will be delete. */ async command t* fetchFull();/** * put the element into end of full queue, return SUCCESS if put success, FAIL otherwise. * producer should put the element into full queue after fill element. */ async command error_t putFull(t* pElement); /** * return the number of free element in queue. * */ async command uint8_t getFreeNum();/** * return the number of full element in queue. * */ async command uint8_t getFullNum();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -