Maestro 0.2.5
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Simulators::SimulatorObserverProxy< Impl > Class Template Reference

A proxy class for a quantum computing simulator observer. More...

#include <SimulatorObserver.h>

+ Inheritance diagram for Simulators::SimulatorObserverProxy< Impl >:
+ Collaboration diagram for Simulators::SimulatorObserverProxy< Impl >:

Public Member Functions

 SimulatorObserverProxy (const std::shared_ptr< Impl > &impl)
 Constructor.
 
std::shared_ptr< ISimulatorObservergetptr ()
 Get a shared pointer to this object.
 
void Update (const Types::qubits_vector &qubits) override
 Update function that is called each time an update is done.
 

Detailed Description

template<class Impl>
class Simulators::SimulatorObserverProxy< Impl >

A proxy class for a quantum computing simulator observer.

If you don't want to derive from ISimulatorObserver, use this proxy class. The implementation of the observer needs to implement the Update function.

See also
ISimulatorObserver
IState
ISimulator
Template Parameters
ImplThe implementation of the observer.

Definition at line 78 of file SimulatorObserver.h.

Constructor & Destructor Documentation

◆ SimulatorObserverProxy()

template<class Impl >
Simulators::SimulatorObserverProxy< Impl >::SimulatorObserverProxy ( const std::shared_ptr< Impl > &  impl)
inline

Constructor.

Constructs a proxy for the observer.

Parameters
implThe implementation of the observer, wrapped in a shared pointer.

Definition at line 87 of file SimulatorObserver.h.

Member Function Documentation

◆ getptr()

std::shared_ptr< ISimulatorObserver > Simulators::ISimulatorObserver::getptr ( )
inlineinherited

Get a shared pointer to this object.

Returns a shared pointer to this object. The object needs to be already wrapped in a shared pointer.

Returns
A shared pointer to this object.

Definition at line 62 of file SimulatorObserver.h.

◆ Update()

template<class Impl >
void Simulators::SimulatorObserverProxy< Impl >::Update ( const Types::qubits_vector qubits)
inlineoverridevirtual

Update function that is called each time an update is done.

This function is called each time the state is changed, with the qubits that have been changed.

Parameters
qubitsThe qubits that have been changed.

Implements Simulators::ISimulatorObserver.

Definition at line 96 of file SimulatorObserver.h.


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