31 #if defined(Alias_RECURSES) 32 #error Recursive header files inclusion detected in Alias.h 33 #else // defined(Alias_RECURSES) 35 #define Alias_RECURSES 44 #include "DGtal/base/Common.h" 45 #include "DGtal/base/CountedPtr.h" 46 #include "DGtal/base/CowPtr.h" 181 template <
typename T>
206 Alias(
const T& ) =
delete;
213 Alias(
const T* ) =
delete;
262 Alias( T&& ) =
delete;
270 inline operator T&()
const 275 return *(
const_cast< T*
>(
static_cast< const T*
>(
myPtr ) ) );
276 default: ASSERT(
false &&
"[Alias::operator T&() const] Invalid cast for given type. Consider passing a left-value reference or a pointer as a parameter." );
277 return *(
const_cast< T*
>(
static_cast< const T*
>(
myPtr ) ) );
292 return const_cast< T*
>(
static_cast< const T*
>(
myPtr ) );
293 default: ASSERT(
false &&
"[T* Alias::operator&() const] Invalid address operator for given type. Consider passing a left-value reference or a pointer as a parameter." );
294 return const_cast< T*
>(
static_cast< const T*
>(
myPtr ) );
317 default: ASSERT(
false &&
"[Alias::operator CountedPtrOrPtr<T>() const] Invalid cast for given type. Consider passing a reference, a pointer or a CountedPtr as a parameter." );
352 #endif // !defined Alias_h 354 #undef Alias_RECURSES 355 #endif // else defined(Alias_RECURSES) Aim: Smart pointer based on reference counts.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
const void *const myPtr
Stores the address of the input parameter for further use.
Aim: Smart or simple pointer on T. It can be a smart pointer based on reference counts or a simple po...
Parameter
Internal class that allows to distinguish the different types of parameters.
Alias(const CountedPtr< T > &t)
DGtal is the top-level namespace which contains all DGtal functions and types.
Alias & operator=(const Alias &other)
const Parameter myParam
Characterizes the type of the input parameter at clone instanciation.
Alias(const CountedPtrOrPtr< T > &t)
Aim: Copy on write shared pointer.