C++ Template class for a Triple Buffer as a concurrency mechanism, using atomic operations