SDL  2.0
hid_device_ref< T > Class Template Reference
+ Inheritance diagram for hid_device_ref< T >:

Public Member Functions

 hid_device_ref (T *pObject=nullptr)
 
 hid_device_ref (const hid_device_ref &rhs)
 
 ~hid_device_ref ()
 
void SetObject (T *pObject)
 
hid_device_refoperator= (T *pObject)
 
hid_device_refoperator= (const hid_device_ref &rhs)
 
TGetObject () const
 
Toperator-> () const
 
 operator bool () const
 

Private Attributes

Tm_pObject
 

Detailed Description

template<class T>
class hid_device_ref< T >

Definition at line 50 of file hid.cpp.

Constructor & Destructor Documentation

◆ hid_device_ref() [1/2]

template<class T>
hid_device_ref< T >::hid_device_ref ( T pObject = nullptr)
inline

Definition at line 53 of file hid.cpp.

53  : m_pObject( nullptr )
54  {
55  SetObject( pObject );
56  }
T * m_pObject
Definition: hid.cpp:111
void SetObject(T *pObject)
Definition: hid.cpp:68

◆ hid_device_ref() [2/2]

template<class T>
hid_device_ref< T >::hid_device_ref ( const hid_device_ref< T > &  rhs)
inline

Definition at line 58 of file hid.cpp.

58  : m_pObject( nullptr )
59  {
60  SetObject( rhs.GetObject() );
61  }
T * m_pObject
Definition: hid.cpp:111
void SetObject(T *pObject)
Definition: hid.cpp:68
T * GetObject() const
Definition: hid.cpp:95

◆ ~hid_device_ref()

template<class T>
hid_device_ref< T >::~hid_device_ref ( )
inline

Definition at line 63 of file hid.cpp.

64  {
65  SetObject( nullptr );
66  }
void SetObject(T *pObject)
Definition: hid.cpp:68

Member Function Documentation

◆ GetObject()

template<class T>
T* hid_device_ref< T >::GetObject ( ) const
inline

Definition at line 95 of file hid.cpp.

Referenced by hid_device_ref< CHIDDevice >::hid_device_ref(), and hid_device_ref< CHIDDevice >::operator=().

96  {
97  return m_pObject;
98  }
T * m_pObject
Definition: hid.cpp:111

◆ operator bool()

template<class T>
hid_device_ref< T >::operator bool ( ) const
inline

Definition at line 105 of file hid.cpp.

106  {
107  return ( m_pObject != nullptr );
108  }
T * m_pObject
Definition: hid.cpp:111

◆ operator->()

template<class T>
T* hid_device_ref< T >::operator-> ( ) const
inline

Definition at line 100 of file hid.cpp.

101  {
102  return m_pObject;
103  }
T * m_pObject
Definition: hid.cpp:111

◆ operator=() [1/2]

template<class T>
hid_device_ref& hid_device_ref< T >::operator= ( T pObject)
inline

Definition at line 83 of file hid.cpp.

84  {
85  SetObject( pObject );
86  return *this;
87  }
void SetObject(T *pObject)
Definition: hid.cpp:68

◆ operator=() [2/2]

template<class T>
hid_device_ref& hid_device_ref< T >::operator= ( const hid_device_ref< T > &  rhs)
inline

Definition at line 89 of file hid.cpp.

90  {
91  SetObject( rhs.GetObject() );
92  return *this;
93  }
void SetObject(T *pObject)
Definition: hid.cpp:68
T * GetObject() const
Definition: hid.cpp:95

◆ SetObject()

template<class T>
void hid_device_ref< T >::SetObject ( T pObject)
inline

Definition at line 68 of file hid.cpp.

69  {
70  if ( m_pObject && m_pObject->DecrementRefCount() == 0 )
71  {
72  delete m_pObject;
73  }
74 
75  m_pObject = pObject;
76 
77  if ( m_pObject )
78  {
79  m_pObject->IncrementRefCount();
80  }
81  }
T * m_pObject
Definition: hid.cpp:111

Field Documentation

◆ m_pObject

template<class T>
T* hid_device_ref< T >::m_pObject
private

Definition at line 111 of file hid.cpp.


The documentation for this class was generated from the following file: