IBR-DTNSuite  0.8
daemon/src/net/LOWPANConnection.h
Go to the documentation of this file.
00001 #ifndef LOWPANCONNECTION_H_
00002 #define LOWPANCONNECTION_H_
00003 
00004 #include "net/LOWPANConvergenceLayer.h"
00005 
00006 #include <ibrcommon/thread/Queue.h>
00007 #include <ibrcommon/net/lowpanstream.h>
00008 
00009 using namespace dtn::data;
00010 
00011 namespace dtn
00012 {
00013         namespace net
00014         {
00015                 class LOWPANConnectionSender : public ibrcommon::JoinableThread
00016                 {
00017                         public:
00018                                 LOWPANConnectionSender(ibrcommon::lowpanstream &_stream);
00019                                 virtual ~LOWPANConnectionSender();
00020 
00025                                 void queue(const ConvergenceLayer::Job &job);
00026                                 void run();
00027                                 void __cancellation();
00028 
00029                         private:
00030                                 ibrcommon::lowpanstream &_stream;
00031                                 ibrcommon::Queue<ConvergenceLayer::Job> _queue;
00032                 };
00033 
00034                 class LOWPANConvergenceLayer;
00035                 class LOWPANConnection : public ibrcommon::DetachedThread
00036                 {
00037                 public:
00043                         LOWPANConnection(unsigned short _address, LOWPANConvergenceLayer &cl);
00044 
00045                         virtual ~LOWPANConnection();
00046 
00050                         unsigned short _address;
00051 
00056                         ibrcommon::lowpanstream& getStream();
00057 
00058                         void run();
00059                         void setup();
00060                         void finally();
00061                         void __cancellation();
00062 
00066                         LOWPANConnectionSender _sender;
00067 
00068                 private:
00069                         bool _running;
00070                         ibrcommon::lowpanstream _stream;
00071                         LOWPANConvergenceLayer &_cl;
00072                 };
00073         }
00074 }
00075 #endif /*LOWPANCONNECTION_H_*/