C++ implementation of WRTHog.