IMP Reference Guide
2.20.2
The Integrative Modeling Platform
|
Macros to help with reference counting. More...
Go to the source code of this file.
Macros | |
#define | IMP_REF_COUNTED_DESTRUCTOR(Name) |
Set up destructor for a ref counted object. More... | |
#define | IMP_REF_COUNTED_INLINE_DESTRUCTOR(Name, destructor) |
#define | IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name) |
Macros to help with reference counting.
Copyright 2007-2022 IMP Inventors. All rights reserved.
Definition in file ref_counted_macros.h.
#define IMP_REF_COUNTED_DESTRUCTOR | ( | Name | ) |
Set up destructor for a ref counted object.
This macro defines a virtual destructor for a ref counted object. Ideally, the destructor would be defined private, so that the object cannot be declared on the stack and so must be ref counted, but in practice this breaks usage of the object with SWIG, some older compilers, C++11 smart pointers (e.g. std::unique_ptr, std::shared_ptr), and serialization, so a public destructor is used.
Definition at line 25 of file ref_counted_macros.h.
#define IMP_REF_COUNTED_INLINE_DESTRUCTOR | ( | Name, | |
destructor | |||
) |
Like IMP_REF_COUNTED_DESTRUCTOR(), but the destructor is declared inline.
Definition at line 35 of file ref_counted_macros.h.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR | ( | Name | ) |
Like IMP_REF_COUNTED_DESTRUCTOR(), but the destructor is only declared, not defined.
Definition at line 30 of file ref_counted_macros.h.