Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JReference< JClass_t *const > Class Template Reference

Template specialisation of JReference class for pointer type. More...

#include <JReference.hh>

Public Member Functions

 JReference (JClass_t *const &pointer)
 Constructor.
 
 JReference (const JPointer< JClass_t > &pointer)
 Constructor.
 
const JClass_t & getReference () const
 Get reference to object.
 
bool is_valid () const
 Check validity of reference.
 
const JClass_t * operator-> () const
 Smart pointer.
 
const JClass_t & operator* () const
 Dereference operator.
 

Protected Attributes

JClass_t *const & __pointer
 

Detailed Description

template<class JClass_t>
class JLANG::JReference< JClass_t *const >

Template specialisation of JReference class for pointer type.

Definition at line 193 of file JReference.hh.

Constructor & Destructor Documentation

◆ JReference() [1/2]

template<class JClass_t >
JLANG::JReference< JClass_t *const >::JReference ( JClass_t *const & pointer)
inline

Constructor.

Parameters
pointerpointer

Definition at line 201 of file JReference.hh.

201 :
202 __pointer(pointer)
203 {}

◆ JReference() [2/2]

template<class JClass_t >
JLANG::JReference< JClass_t *const >::JReference ( const JPointer< JClass_t > & pointer)
inline

Constructor.

Parameters
pointerpointer object

Definition at line 211 of file JReference.hh.

211 :
212 __pointer(pointer.getReference())
213 {}

Member Function Documentation

◆ getReference()

template<class JClass_t >
const JClass_t & JLANG::JReference< JClass_t *const >::getReference ( ) const
inline

Get reference to object.

Returns
reference to object

Definition at line 221 of file JReference.hh.

222 {
223 return *__pointer;
224 }

◆ is_valid()

template<class JClass_t >
bool JLANG::JReference< JClass_t *const >::is_valid ( ) const
inline

Check validity of reference.

Returns
true if pointer not null; else false

Definition at line 232 of file JReference.hh.

233 {
234 return (__pointer != NULL);
235 }

◆ operator->()

template<class JClass_t >
const JClass_t * JLANG::JReference< JClass_t *const >::operator-> ( ) const
inline

Smart pointer.

Returns
pointer to object

Definition at line 243 of file JReference.hh.

244 {
245 if (__pointer == NULL)
246 THROW(JNullPointerException, "JReference::operator->()");
247 else
248 return __pointer;
249 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ operator*()

template<class JClass_t >
const JClass_t & JLANG::JReference< JClass_t *const >::operator* ( ) const
inline

Dereference operator.

Returns
reference to object

Definition at line 257 of file JReference.hh.

258 {
259 if (__pointer == NULL)
260 THROW(JNullPointerException, "JReference::operator*()");
261 else
262 return *__pointer;
263 }

Member Data Documentation

◆ __pointer

template<class JClass_t >
JClass_t* const& JLANG::JReference< JClass_t *const >::__pointer
protected

Definition at line 266 of file JReference.hh.


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