31#if defined(ConstAlias_RECURSES)
32#error Recursive header files inclusion detected in ConstAlias.h
35#define ConstAlias_RECURSES
37#if !defined ConstAlias_h
44#include "DGtal/base/Common.h"
45#include "DGtal/base/CountedPtr.h"
46#include "DGtal/base/CountedPtrOrPtr.h"
47#include "DGtal/base/CowPtr.h"
48#include "DGtal/base/CountedConstPtrOrConstPtr.h"
185 template <
typename T>
273 inline operator const T&()
const
278 return *(
static_cast< const T*
>(
myPtr ) );
279 default: ASSERT(
false &&
"[ConstAlias::operator const T&() const] Invalid cast for given type. Consider passing a const left-value reference or a const pointer as a parameter." );
280 return *(
static_cast< const T*
>(
myPtr ) );
295 return static_cast< const T*
>(
myPtr );
296 default: ASSERT(
false &&
"[const T* ConstAlias::operator&() const] Invalid address operator for given type. Consider passing a const left-value reference or a const pointer as a parameter." );
297 return static_cast< const T*
>(
myPtr );
323 default: ASSERT(
false &&
"[ConstAlias::operator CowPtr<T>() const] Invalid cast for given type. Consider passing a CountedPtr or a CowPtr as a parameter." );
333 return static_cast< const T*
>(
myPtr );
340 default: ASSERT(
false &&
"[ConstAlias::operator->() const] Invalid cast for given type. Consider passing a CountedPtr or a CowPtr as a parameter." );
377#undef ConstAlias_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
ConstAlias(const CountedPtr< T > &shT)
const T * operator&() const
const Parameter myParam
Characterizes the type of the input parameter at clone instanciation.
ConstAlias(const CountedConstPtrOrConstPtr< T > &shT)
Parameter
Internal class that allows to distinguish the different types of parameters.
@ COUNTED_CONST_PTR_OR_CONST_PTR
ConstAlias(const ConstAlias &other)=default
const T * operator->() const
const void *const myPtr
Stores the address of the input parameter for further use.
ConstAlias(const CowPtr< T > &)=delete
ConstAlias(const CountedPtrOrPtr< T > &shT)
ConstAlias(const T *ptrT)
ConstAlias & operator=(const ConstAlias &other)
Aim: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
Aim: Smart or simple pointer on T. It can be a smart pointer based on reference counts or a simple po...
Aim: Smart pointer based on reference counts.
Aim: Copy on write shared pointer.
DGtal is the top-level namespace which contains all DGtal functions and types.