Panda3D
 All Classes Functions Variables Enumerations
bioStream.h
1 // Filename: bioStream.h
2 // Created by: drose (25Sep02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef BIOSTREAM_H
16 #define BIOSTREAM_H
17 
18 #include "pandabase.h"
19 
20 // This module is not compiled if OpenSSL is not available.
21 #ifdef HAVE_OPENSSL
22 
23 #include "socketStream.h"
24 #include "bioStreamBuf.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : IBioStream
28 // Description : An input stream object that reads data from an
29 // OpenSSL BIO object. This is used by the HTTPClient
30 // and HTTPChannel classes to provide a C++ interface
31 // to OpenSSL.
32 //
33 // Seeking is not supported.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDAEXPRESS IBioStream : public ISocketStream {
36 public:
37  INLINE IBioStream();
38  INLINE IBioStream(BioPtr *source);
39 
40  INLINE IBioStream &open(BioPtr *source);
41 
42  virtual bool is_closed();
43  virtual void close();
44  virtual ReadState get_read_state();
45 
46 private:
47  BioStreamBuf _buf;
48 };
49 
50 ////////////////////////////////////////////////////////////////////
51 // Class : OBioStream
52 // Description : An output stream object that writes data to an
53 // OpenSSL BIO object. This is used by the HTTPClient
54 // and HTTPChannel classes to provide a C++ interface
55 // to OpenSSL.
56 //
57 // Seeking is not supported.
58 ////////////////////////////////////////////////////////////////////
59 class EXPCL_PANDAEXPRESS OBioStream : public OSocketStream {
60 public:
61  INLINE OBioStream();
62  INLINE OBioStream(BioPtr *source);
63 
64  INLINE OBioStream &open(BioPtr *source);
65 
66  virtual bool is_closed();
67  virtual void close();
68 
69 private:
70  BioStreamBuf _buf;
71 };
72 
73 ////////////////////////////////////////////////////////////////////
74 // Class : BioStream
75 // Description : A bi-directional stream object that reads and writes
76 // data to an OpenSSL BIO object.
77 ////////////////////////////////////////////////////////////////////
78 class EXPCL_PANDAEXPRESS BioStream : public SocketStream {
79 public:
80  INLINE BioStream();
81  INLINE BioStream(BioPtr *source);
82 
83  INLINE BioStream &open(BioPtr *source);
84 
85  virtual bool is_closed();
86  virtual void close();
87 
88 private:
89  BioStreamBuf _buf;
90 };
91 
92 #include "bioStream.I"
93 
94 #endif // HAVE_OPENSSL
95 
96 
97 #endif
98 
99