Skip to content

Commit

Permalink
DOC: itkGetObjectMacro member functions return a raw (not smart) pointer
Browse files Browse the repository at this point in the history
Fixed documentation about itkGetObjectMacro, itkGetConstObjectMacro, and
itkGetModifiableObjectMacro, following commit 7ae9b93
"ENH: Use of SmartPointers reduced. GetInput() GetOutput() methods return now
raw pointers. Only methods creating new objects will return SmartPointers.",
Luis Ibanez, 2002-05-11.
  • Loading branch information
N-Dekker committed Aug 2, 2023
1 parent 122daea commit eb97e95
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Modules/Core/Common/include/itkMacro.h
Expand Up @@ -1082,8 +1082,7 @@ compilers.
// clang-format off
/** Set pointer to object; uses Object reference counting methodology.
* Creates method Set"name"() (e.g., SetPoints()). Note that using
* smart pointers requires using real pointers when setting input,
* but returning smart pointers on output. */
* smart pointers requires using raw pointers when setting input. */
#define itkSetObjectMacro(name, type) \
virtual void Set##name(type * _arg) \
{ \
Expand All @@ -1097,7 +1096,7 @@ compilers.
ITK_MACROEND_NOOP_STATEMENT
// clang-format on
/** Get a smart pointer to an object. Creates the member
/** Get a raw pointer to an object. Creates the member
* Get"name"() (e.g., GetPoints()).
* NOTE: This function returns a non-const
* version of the internal member variable
Expand All @@ -1120,7 +1119,7 @@ compilers.
// defines both signatures itk::GetXXX() and
// itk::GetModifiableXXX()
/** Get a smart const pointer to an object. Creates the member
/** Get a raw const pointer to an object. Creates the member
* Get"name"() (e.g., GetPoints()). */
#define itkGetConstObjectMacro(name, type) \
virtual const type * Get##name() const { return this->m_##name.GetPointer(); } \
Expand All @@ -1144,7 +1143,7 @@ compilers.
itkGetConstObjectMacro(name, type)
#else // defined ( ITK_FUTURE_LEGACY_REMOVE )
/** Get a smart pointer to an object. Creates the member
/** Get a raw pointer to an object. Creates the member
* Get"name"() (e.g., GetPoints()). */
# define itkGetObjectMacro(name, type) \
virtual type * Get##name() { return this->m_##name.GetPointer(); } \
Expand All @@ -1167,8 +1166,7 @@ compilers.
/** Set const pointer to object; uses Object reference counting methodology.
* Creates method Set"name"() (e.g., SetPoints()). Note that using
* smart pointers requires using real pointers when setting input,
* but returning smart pointers on output. */
* smart pointers requires using raw pointers when setting input. */
#define itkSetConstObjectMacro(name, type) \
virtual void Set##name(const type * _arg) \
{ \
Expand Down

0 comments on commit eb97e95

Please sign in to comment.