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