Converted swap module to C++.

Change-Id: I904c142bb9ee20cf13a01219fb4066d18a802a2c