Click here to Skip to main content
15,893,588 members
Articles / Programming Languages / C++

Celero - A C++ Benchmark Authoring Library

Rate me:
Please Sign up or sign in to vote.
4.84/5 (19 votes)
31 Oct 2013Apache7 min read 47.6K   764   49  
This article discusses how to implement and use a template-based C++ benchmarking library.
#ifndef _CELERO_GENERICFACTORY_H_
#define _CELERO_GENERICFACTORY_H_

#include <celero/Factory.h>
#include <celero/Export.h>

namespace celero
{
	///
	/// \class GenericFactory
	///
	/// \author	John farrier
	///
    template<class T> class GenericFactory : public Factory
    {
		public:
			///
			/// \brief	Default Constructor
			///
			GenericFactory() : Factory()
			{
			}

			///
			/// \brief	Virtual Destructor
			///
			virtual ~GenericFactory()
			{
			}

			///
			/// \brief	Overload the pure virtual base class function.
			///
			virtual std::shared_ptr<TestFixture> Create()
			{
				return std::make_shared<T>();
			}
    };
}

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Team Leader
United States United States
John Farrier is a professional C++ software engineer that specializes in modeling, simulation, and architecture development.

Specialties:

LVC Modeling & Simulation
Software Engineering, C++11, C++98, C, C#, FORTRAN, Python
Software Performance Optimization
Software Requirements Development
Technical Project and Team Leadership

Comments and Discussions