00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INCLUDED_GR_HEAD_H
00024 #define INCLUDED_GR_HEAD_H
00025
00026 #include <gr_sync_block.h>
00027 #include <stddef.h>
00028
00029 class gr_head;
00030 typedef boost::shared_ptr<gr_head> gr_head_sptr;
00031
00032
00033
00034
00035
00036
00037
00038
00039 class gr_head : public gr_sync_block
00040 {
00041 friend gr_head_sptr gr_make_head (size_t sizeof_stream_item, unsigned long long nitems);
00042 gr_head (size_t sizeof_stream_item, unsigned long long nitems);
00043
00044 unsigned long long d_nitems;
00045 unsigned long long d_ncopied_items;
00046
00047 public:
00048 int work (int noutput_items,
00049 gr_vector_const_void_star &input_items,
00050 gr_vector_void_star &output_items);
00051
00052 void reset() { d_ncopied_items = 0; }
00053 };
00054
00055 gr_head_sptr
00056 gr_make_head (size_t sizeof_stream_item, unsigned long long nitems);
00057
00058
00059 #endif