Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "ibrdtn/data/Block.h"
00009 #include "ibrdtn/data/Bundle.h"
00010 #include <iostream>
00011
00012 using namespace std;
00013
00014 namespace dtn
00015 {
00016 namespace data
00017 {
00018 Block::Block(char blocktype)
00019 : _blocktype(blocktype), _procflags(0)
00020 {
00021 }
00022
00023 Block::~Block()
00024 {
00025 }
00026
00027 void Block::addEID(const EID &eid)
00028 {
00029 _eids.push_back(eid);
00030
00031
00032 _procflags |= Block::BLOCK_CONTAINS_EIDS;
00033 }
00034
00035 std::list<dtn::data::EID> Block::getEIDList() const
00036 {
00037 return _eids;
00038 }
00039
00040 void Block::set(ProcFlags flag, const bool &value)
00041 {
00042 if (value)
00043 {
00044 _procflags |= flag;
00045 }
00046 else
00047 {
00048 _procflags &= ~(flag);
00049 }
00050 }
00051
00052 bool Block::get(ProcFlags flag) const
00053 {
00054 return (_procflags & flag);
00055 }
00056 }
00057 }