CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::DeviceProduct< T > Class Template Reference

#include <DeviceProduct.h>

Inheritance diagram for edm::DeviceProduct< T >:
edm::DeviceProductBase

Public Member Functions

 DeviceProduct ()=default
 
template<typename M , typename... Args>
 DeviceProduct (std::shared_ptr< M > metadata, Args &&... args)
 
 DeviceProduct (const DeviceProduct &)=delete
 
 DeviceProduct (DeviceProduct &&)=default
 
template<typename M , typename... Args>
T const & getSynchronized (Args &&... args) const
 
DeviceProductoperator= (const DeviceProduct &)=delete
 
DeviceProductoperator= (DeviceProduct &&)=default
 
- Public Member Functions inherited from edm::DeviceProductBase
 DeviceProductBase ()=default
 
template<typename M >
M const & metadata () const
 
 ~DeviceProductBase ()=default
 

Private Attributes

T data_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::DeviceProductBase
template<typename M >
 DeviceProductBase (std::shared_ptr< M > metadata)
 

Detailed Description

template<typename T>
class edm::DeviceProduct< T >

A wrapper for Event Data product in device memory accompanied with some device-specific metadata. Not intended to be used directly by developers (except in ROOT dictionary declarations in classes_def.xml similar to edm::Wrapper).

Definition at line 46 of file DeviceProduct.h.

Constructor & Destructor Documentation

◆ DeviceProduct() [1/4]

template<typename T >
edm::DeviceProduct< T >::DeviceProduct ( )
default

◆ DeviceProduct() [2/4]

template<typename T >
template<typename M , typename... Args>
edm::DeviceProduct< T >::DeviceProduct ( std::shared_ptr< M >  metadata,
Args &&...  args 
)
inlineexplicit

Definition at line 51 of file DeviceProduct.h.

52  : DeviceProductBase(std::move(metadata)), data_(std::forward<Args>(args)...) {}
M const & metadata() const
Definition: DeviceProduct.h:15
def move(src, dest)
Definition: eostools.py:511

◆ DeviceProduct() [3/4]

template<typename T >
edm::DeviceProduct< T >::DeviceProduct ( const DeviceProduct< T > &  )
delete

◆ DeviceProduct() [4/4]

template<typename T >
edm::DeviceProduct< T >::DeviceProduct ( DeviceProduct< T > &&  )
default

Member Function Documentation

◆ getSynchronized()

template<typename T >
template<typename M , typename... Args>
T const& edm::DeviceProduct< T >::getSynchronized ( Args &&...  args) const
inline

Get the actual data product after the metadata object has synchronized the access. The synchronization details depend on the metadata type, which the caller must know. All the arguments are passed to M::synchronize() function.

Definition at line 66 of file DeviceProduct.h.

References writedatasetfile::args, and edm::DeviceProduct< T >::data_.

66  {
67  auto const& md = metadata<M>();
68  md.synchronize(std::forward<Args>(args)...);
69  return data_;
70  }

◆ operator=() [1/2]

template<typename T >
DeviceProduct& edm::DeviceProduct< T >::operator= ( const DeviceProduct< T > &  )
delete

◆ operator=() [2/2]

template<typename T >
DeviceProduct& edm::DeviceProduct< T >::operator= ( DeviceProduct< T > &&  )
default

Member Data Documentation

◆ data_

template<typename T >
T edm::DeviceProduct< T >::data_
private

Definition at line 73 of file DeviceProduct.h.

Referenced by edm::DeviceProduct< T >::getSynchronized().