一.流式数据:
流式数据就是数据以流的方式访问,只能不断向后读,读过的数据不能重新读取。
这里使用了hasMore和next方法,重复hasMore来确认数据时候依然可以满足此时的条件,如果满足则当get完成后调用next方法读取下一条数据。
比如可用于简单语义分析或结构拆解。
二.实现:
class stream{
public:
stream(char* msg);
~stream();
private:
NO_COPY_AND_ASSIGN(stream)
public:
char* getMsg();
bool hasMore();
void next();
private:
char* Msgs;
};