Panda3D
bioStreamPtr.h
1 // Filename: bioStreamPtr.h
2 // Created by: drose (15Oct02)
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 BIOSTREAMPTR_H
16 #define BIOSTREAMPTR_H
17 
18 #include "pandabase.h"
19 
20 // This module is not compiled if OpenSSL is not available.
21 #ifdef HAVE_OPENSSL
22 #define OPENSSL_NO_KRB5
23 
24 #include "bioStream.h"
25 #include "referenceCount.h"
26 #include "openSSLWrapper.h" // must be included before any other openssl.
27 #include "openssl/ssl.h"
28 
29 ////////////////////////////////////////////////////////////////////
30 // Class : BioStreamPtr
31 // Description : A wrapper around an BioStream object to make a
32 // reference-counting pointer to it.
33 ////////////////////////////////////////////////////////////////////
34 class EXPCL_PANDAEXPRESS BioStreamPtr : public ReferenceCount {
35 public:
36  INLINE BioStreamPtr(BioStream *stream);
37  virtual ~BioStreamPtr();
38 
39  INLINE BioStream &operator *() const;
40  INLINE BioStream *operator -> () const;
41  INLINE operator BioStream * () const;
42 
43  INLINE void set_stream(BioStream *stream);
44  INLINE BioStream *get_stream() const;
45 
46 private:
47  BioStream *_stream;
48 };
49 
50 #include "bioStreamPtr.I"
51 
52 #endif // HAVE_OPENSSL
53 
54 
55 #endif
56 
57 
A base class for all things that want to be reference-counted.