1 #ifndef _BPQ_BLOCK_PROCESSOR_H_ |
1 #ifndef _BPQ_BLOCK_PROCESSOR_H_ |
2 #define _BPQ_BLOCK_PROCESSOR_H_ |
2 #define _BPQ_BLOCK_PROCESSOR_H_ |
3 |
3 |
4 #include "BlockProcessor.h" |
4 #include "BlockProcessor.h" |
|
5 |
|
6 #include "BundleProtocol.h" |
|
7 #include "BlockInfo.h" |
|
8 #include "BPQBlock.h" |
|
9 #include "Bundle.h" |
|
10 |
5 #include <oasys/util/StringBuffer.h> |
11 #include <oasys/util/StringBuffer.h> |
|
12 #include <oasys/util/Singleton.h> |
6 |
13 |
7 namespace dtn { |
14 namespace dtn { |
|
15 |
8 |
16 |
9 /** |
17 /** |
10 * Block processor implementation for the BPQ Extension Block |
18 * Block processor implementation for the BPQ Extension Block |
11 */ |
19 */ |
12 class BPQBlockProcessor : public BlockProcessor { |
20 class BPQBlockProcessor : public BlockProcessor, |
|
21 public oasys::Singleton<BPQBlockProcessor> { |
13 public: |
22 public: |
14 /// Constructor |
23 /// Constructor |
15 BPQBlockProcessor(); |
24 BPQBlockProcessor(); |
16 |
25 |
17 /// @{ Virtual from BlockProcessor |
26 /// @{ Virtual from BlockProcessor |
18 |
|
19 int consume(Bundle* bundle, |
27 int consume(Bundle* bundle, |
20 BlockInfo* block, |
28 BlockInfo* block, |
21 u_char* buf, |
29 u_char* buf, |
22 size_t len); |
30 size_t len); |
|
31 |
|
32 int prepare(const Bundle* bundle, |
|
33 BlockInfoVec* xmit_blocks, |
|
34 const BlockInfo* source, |
|
35 const LinkRef& link, |
|
36 list_owner_t list); |
23 |
37 |
24 int generate(const Bundle* bundle, |
38 int generate(const Bundle* bundle, |
25 BlockInfoVec* xmit_blocks, |
39 BlockInfoVec* xmit_blocks, |
26 BlockInfo* block, |
40 BlockInfo* block, |
27 const LinkRef& link, |
41 const LinkRef& link, |
28 bool last); |
42 bool last); |
|
43 /* |
|
44 int finalize(const Bundle* bundle, |
|
45 BlockInfoVec* xmit_blocks, |
|
46 BlockInfo* block, |
|
47 const LinkRef& link); |
|
48 */ |
|
49 /// @} |
29 |
50 |
30 /// @} |
51 //private: |
|
52 // BPQBlock* create_block(const Bundle* const bundle) const; |
31 }; |
53 }; |
32 |
54 |
33 } // namespace dtn |
55 } // namespace dtn |
34 |
56 |
35 #endif /* _BPQ_BLOCK_PROCESSOR_H_ */ |
57 #endif /* _BPQ_BLOCK_PROCESSOR_H_ */ |