IBR-DTNSuite
0.8
|
00001 /* 00002 * iostreamBIO.h 00003 * 00004 * Created on: Mar 25, 2011 00005 * Author: roettger 00006 */ 00007 00008 #ifndef IOSTREAMBIO_H_ 00009 #define IOSTREAMBIO_H_ 00010 00011 #include "ibrcommon/Exceptions.h" 00012 #include <openssl/bio.h> 00013 00014 namespace ibrcommon 00015 { 00016 00020 class iostreamBIO 00021 { 00022 public: 00026 class BIOException : public ibrcommon::Exception 00027 { 00028 public: 00029 BIOException(const std::string &what) throw() : Exception(what) 00030 { 00031 }; 00032 }; 00033 00039 explicit iostreamBIO(iostream *stream); 00040 00047 BIO *getBIO(); 00048 00050 static const char * const name; 00052 static const int type = BIO_TYPE_SOURCE_SINK; 00053 00054 private: 00055 BIO *_bio; 00056 iostream *_stream; 00057 }; 00058 00059 } 00060 00061 #endif /* IOSTREAMBIO_H_ */