IMP logo
IMP Reference Guide  2.10.1
The Integrative Modeling Platform
swap_macros.h File Reference

Various general useful macros for IMP. More...

#include <IMP/kernel_config.h>
+ Include dependency graph for swap_macros.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IMP_SWAP_MEMBER(var_name)   swap(var_name, o.var_name)
 Swap two member variables assuming the other object is called o. More...
 

Swap helpers

Use the swap_with member function to swap two objects. The two objects must be of the same type (Name) and define the method swap_with(). The number suffix is the number of template arguments, all of which must be of class type.

#define IMP_SWAP(Name)
 
#define IMP_SWAP_1(Name)
 
#define IMP_SWAP_2(Name)
 
#define IMP_SWAP_3(Name)
 

Detailed Description

Various general useful macros for IMP.

Copyright 2007-2018 IMP Inventors. All rights reserved.

Definition in file swap_macros.h.

Macro Definition Documentation

#define IMP_SWAP (   Name)
Value:
inline void swap(Name& a, Name& b) { a.swap_with(b); } \
IMP_REQUIRE_SEMICOLON_NAMESPACE

Definition at line 22 of file swap_macros.h.

#define IMP_SWAP_MEMBER (   var_name)    swap(var_name, o.var_name)

Swap two member variables assuming the other object is called o.

Swap the member var_name of the two objects (this and o).

Definition at line 61 of file swap_macros.h.