IMP  2.0.1
The Integrative Modeling Platform
swap_macros.h File Reference

Various general useful macros for IMP. More...

#include <IMP/base/base_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 mustbe 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

Copyright 2007-2013 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_1 (   Name)
Value:
template <class A> \
inline void swap(Name<A> &a, Name<A> &b) {a.swap_with(b);} \
IMP_REQUIRE_SEMICOLON_NAMESPACE

Definition at line 27 of file swap_macros.h.

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

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

Definition at line 64 of file swap_macros.h.