Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

sslarchivestream.hpp

00001 /************************************************************************************
00002  *    This file is part of the MynahSA streaming and archiving toolkit              *
00003  *    Copyright (C) 2006 Mynah-Software Ltd. All Rights Reserved.                   *
00004  *                                                                                  *
00005  *    This program is free software; you can redistribute it and/or modify          *
00006  *    it under the terms of the GNU General Public License, version 2               *
00007  *    as published by the Free Software Foundation.                                 *
00008  *                                                                                  *
00009  *    This program is distributed in the hope that it will be useful,               *
00010  *    but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00011  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00012  *    GNU General Public License for more details.                                  *
00013  *                                                                                  *
00014  *    You should have received a copy of the GNU General Public License along       *
00015  *    with this program; if not, write to the Free Software Foundation, Inc.,       *
00016  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                   *
00017  *                                                                                  *
00018  ************************************************************************************/
00019 
00020 #ifndef __ssl_archive_stream_hpp
00021 #define __ssl_archive_stream_hpp
00022 
00023 #include <mynahsa/iarchive.hpp>
00024 #include <mynahsa/oarchive.hpp>
00025 #include <mynahsa/isslstream.hpp>
00026 #include <mynahsa/osslstream.hpp>
00027 
00028 #include <mynahsa/archivestreambase.hpp>
00029 
00030 
00031 #include <iostream>
00032 
00033 namespace MynahSA { 
00034 
00036   typedef IArchive<ISSLStream> ISSLArchiveStream;
00037   
00039   typedef OArchive<OSSLStream> OSSLArchiveStream;
00040   
00045   class SSLArchiveStream : public ArchiveStreamBase,
00046                            public ISSLArchiveStream, 
00047                            public OSSLArchiveStream {
00048   
00049   public:
00050   
00052     SSLArchiveStream(SSL* s);
00053   
00055     SSLArchiveStream(const SSLArchiveStream& s);
00056   
00058     ~SSLArchiveStream();
00059   
00061     bool is_open() const;
00062     
00064     void close();
00065     
00067     void registerConstructor(const std::string& name, 
00068                              const SHARED_PTR<Archive::ArchiveConstructor>& cons);
00069     
00070     
00074     void clearUPR();
00075   
00076   private:
00078     SSL* _ssl;
00080     ISSLStream is;
00082     OSSLStream os;
00083   
00084   };
00085 };  
00086 
00087 #endif