ComPPare 1.0.0
Loading...
Searching...
No Matches
comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup > Class Template Referencefinal

Google Benchmark plugin for the ComPPare framework. More...

#include <google_benchmark.hpp>

Inheritance diagram for comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >:
[legend]
Collaboration diagram for comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >:
[legend]

Public Member Functions

 GoogleBenchmarkPlugin (const GoogleBenchmarkPlugin &)=delete
 
GoogleBenchmarkPluginoperator= (const GoogleBenchmarkPlugin &)=delete
 
template<class Func >
benchmark::internal::Benchmark * register_impl (const std::string &name, Func &&user_fn, const InTup &inputs, OutTup &outs)
 Register an implementation with the Google Benchmark plugin.
 
void initialize (int &argc, char **argv) override
 Initialize the Google Benchmark plugin.
 
void run () override
 Run the registered benchmarks.
 
- Public Member Functions inherited from comppare::plugin::Plugin< InTup, OutTup >
virtual ~Plugin ()=default
 

Static Public Member Functions

static std::shared_ptr< Selfinstance ()
 Get the singleton instance of the GoogleBenchmarkPlugin.
 

Private Types

using Self = GoogleBenchmarkPlugin< InTup, OutTup >
 

Private Member Functions

 GoogleBenchmarkPlugin ()=default
 

Private Attributes

comppare::plugin::google_benchmark::google_benchmark_manager gb_
 

Detailed Description

template<class InTup, class OutTup>
class comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >

Google Benchmark plugin for the ComPPare framework.

This plugin integrates the Google Benchmark library into the ComPPare framework. It provides methods to register implementations, initialize the benchmark library, and run the benchmarks. The plugin is designed to work with input and output tuples for flexible benchmarking of various functions.

Template Parameters
InTupThe type of the input tuple.
OutTupThe type of the output tuple.

Member Typedef Documentation

◆ Self

template<class InTup , class OutTup >
using comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::Self = GoogleBenchmarkPlugin<InTup, OutTup>
private

Constructor & Destructor Documentation

◆ GoogleBenchmarkPlugin() [1/2]

template<class InTup , class OutTup >
comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::GoogleBenchmarkPlugin ( const GoogleBenchmarkPlugin< InTup, OutTup > &  )
delete

◆ GoogleBenchmarkPlugin() [2/2]

template<class InTup , class OutTup >
comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::GoogleBenchmarkPlugin ( )
privatedefault

Member Function Documentation

◆ initialize()

template<class InTup , class OutTup >
void comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::initialize ( int &  argc,
char **  argv 
)
inlineoverridevirtual

Initialize the Google Benchmark plugin.

This method initializes the Google Benchmark plugin by calling the initialize method of the internal google_benchmark_manager.

Parameters
argcThe number of command-line arguments.
argvThe command-line arguments.

Reimplemented from comppare::plugin::Plugin< InTup, OutTup >.

◆ instance()

template<class InTup , class OutTup >
static std::shared_ptr< Self > comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::instance ( )
inlinestatic

Get the singleton instance of the GoogleBenchmarkPlugin.

Returns
A shared pointer to the singleton instance.

This method ensures that only one instance of the GoogleBenchmarkPlugin exists throughout the program. It returns a shared pointer to the instance.

◆ operator=()

template<class InTup , class OutTup >
GoogleBenchmarkPlugin & comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::operator= ( const GoogleBenchmarkPlugin< InTup, OutTup > &  )
delete

◆ register_impl()

template<class InTup , class OutTup >
template<class Func >
benchmark::internal::Benchmark * comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::register_impl ( const std::string &  name,
Func &&  user_fn,
const InTup &  inputs,
OutTup &  outs 
)
inline

Register an implementation with the Google Benchmark plugin.

Template Parameters
FuncThe type of the user-provided function.
Parameters
nameThe name of the implementation.
user_fnThe function/implementation to register.
inputsA const reference to the input tuple.
outsA reference to the output tuple.
Returns
A pointer to the registered benchmark.

This method passes the user-provided function and its arguments to the internal google_benchmark_manager for registration. It uses std::apply to unpack the input and output tuples and forward them to the manager's add_gbench method.

◆ run()

template<class InTup , class OutTup >
void comppare::plugin::google_benchmark::GoogleBenchmarkPlugin< InTup, OutTup >::run ( )
inlineoverridevirtual

Run the registered benchmarks.

This method runs the benchmarks by calling the run method of the internal google_benchmark_manager.

Reimplemented from comppare::plugin::Plugin< InTup, OutTup >.

Member Data Documentation

◆ gb_


The documentation for this class was generated from the following file: