CARMA C++
PthreadRWLockAttr.h
1 #ifndef CARMA_UTIL_PTHREAD_RW_LOCK_ATTR_H
2 #define CARMA_UTIL_PTHREAD_RW_LOCK_ATTR_H
3 
4 #include <pthread.h>
5 
6 
7 namespace carma {
8 namespace util {
9 
10 
13 
15  public:
16 
20 
21  explicit PthreadRWLockAttr( );
22 
23 
29 
30  virtual ~PthreadRWLockAttr( );
31 
32 
42 
43  const ::pthread_rwlockattr_t & InternalPthreadRWLockAttr( ) const;
44 
45 
55 
56  ::pthread_rwlockattr_t & InternalPthreadRWLockAttr( );
57 
58 
59  private:
60  // no copying
61  PthreadRWLockAttr( const PthreadRWLockAttr & rhs );
62  PthreadRWLockAttr & operator=( const PthreadRWLockAttr & rhs );
63 
64  ::pthread_rwlockattr_t rwlockattr_;
65 };
66 
67 
68 } // namespace carma::util
69 } // namespace carma
70 
71 
72 inline const ::pthread_rwlockattr_t &
74 {
75  return rwlockattr_;
76 }
77 
78 
79 inline ::pthread_rwlockattr_t &
81 {
82  return rwlockattr_;
83 }
84 
85 
86 #endif
PthreadRWLockAttr()
Construct read/write lock attributes with the CARMA defaults.
const ::pthread_rwlockattr_t & InternalPthreadRWLockAttr() const
Obtain a reference to the internal ::pthread_rwlockattr_t.
A simple wrapper class that makes use of ::pthread_rwlockattr_t easier in a C++ world.
virtual ~PthreadRWLockAttr()
Destruct read/write lock attributes.