QMCPACK
MockPerParticleEstimator Class Reference
+ Collaboration diagram for MockPerParticleEstimator:

Public Member Functions

auto getParticularListener (Vector< Real > &local_vector)
 Return listener frunction that has captured an object data member. More...
 
ListenerVector< RealmakeListener ()
 

Public Attributes

Vector< Realreceiver_vector_
 

Detailed Description

Definition at line 49 of file test_Listener.cpp.

Member Function Documentation

◆ getParticularListener()

auto getParticularListener ( Vector< Real > &  local_vector)
inline

Return listener frunction that has captured an object data member.

returning a lambda allows access to the listening object controlled but allows a great deal of flexibility in dealing with the vector report. In this case the receiver just copies the vector it is called with to local storage which the lambda has captured.

Definition at line 57 of file test_Listener.cpp.

Referenced by MockPerParticleEstimator::makeListener().

58  {
59  return [&local_vector](const int walker_index, const std::string& name, const Vector<Real>& values) -> void {
60  local_vector = values;
61  };
62  }

◆ makeListener()

ListenerVector<Real> makeListener ( )
inline

Definition at line 63 of file test_Listener.cpp.

References MockPerParticleEstimator::getParticularListener(), and MockPerParticleEstimator::receiver_vector_.

Referenced by qmcplusplus::testing::TEST_CASE().

63 { return {"kinetic", getParticularListener(receiver_vector_)}; }
auto getParticularListener(Vector< Real > &local_vector)
Return listener frunction that has captured an object data member.

Member Data Documentation

◆ receiver_vector_

Vector<Real> receiver_vector_

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