CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
TritonMemResource< IO > Class Template Reference

#include <TritonData.h>

Inheritance diagram for TritonMemResource< IO >:
TritonCpuShmResource< IO > TritonHeapResource< IO >

Public Member Functions

uint8_t * addr ()
 
virtual void close ()
 
void closeSafe ()
 
virtual void copyInput (const void *values, size_t offset, unsigned entry)
 
virtual void copyOutput ()
 
virtual void set ()
 
size_t size () const
 
 TritonMemResource (TritonData< IO > *data, const std::string &name, size_t size)
 
virtual ~TritonMemResource ()
 

Protected Attributes

uint8_t * addr_
 
bool closed_
 
TritonData< IO > * data_
 
std::string name_
 
size_t size_
 

Detailed Description

template<typename IO>
class TritonMemResource< IO >

Definition at line 23 of file TritonData.h.

Constructor & Destructor Documentation

◆ TritonMemResource()

template<typename IO >
TritonMemResource< IO >::TritonMemResource ( TritonData< IO > *  data,
const std::string &  name,
size_t  size 
)

Definition at line 15 of file TritonMemResource.cc.

16  : data_(data), name_(name), size_(size), addr_(nullptr), closed_(false) {}
TritonData< IO > * data_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
size_t size() const

◆ ~TritonMemResource()

template<typename IO>
virtual TritonMemResource< IO >::~TritonMemResource ( )
inlinevirtual

Definition at line 18 of file TritonMemResource.h.

18 {}

Member Function Documentation

◆ addr()

template<typename IO>
uint8_t* TritonMemResource< IO >::addr ( )
inline

Definition at line 19 of file TritonMemResource.h.

References TritonMemResource< IO >::addr_.

19 { return addr_; }

◆ close()

template<typename IO>
virtual void TritonMemResource< IO >::close ( void  )
inlinevirtual

◆ closeSafe()

template<typename IO >
void TritonMemResource< IO >::closeSafe ( )

Definition at line 28 of file TritonMemResource.cc.

References CMS_SA_ALLOW, triton_utils::convertToWarning(), MillePedeFileConverter_cfg::e, and cppFunctionSkipper::exception.

28  {
29  CMS_SA_ALLOW try { close(); } catch (TritonException& e) {
30  e.convertToWarning();
31  } catch (cms::Exception& e) {
33  } catch (std::exception& e) {
34  edm::LogWarning("UnknownFailure") << e.what();
35  } catch (...) {
36  edm::LogWarning("UnknownFailure") << "An unknown exception was thrown";
37  }
38 }
#define CMS_SA_ALLOW
virtual void close()
void convertToWarning(const cms::Exception &e)
Definition: triton_utils.cc:19
Log< level::Warning, false > LogWarning

◆ copyInput()

template<typename IO>
virtual void TritonMemResource< IO >::copyInput ( const void *  values,
size_t  offset,
unsigned  entry 
)
inlinevirtual

Reimplemented in TritonCpuShmResource< IO >, and TritonHeapResource< IO >.

Definition at line 24 of file TritonMemResource.h.

24 {}

◆ copyOutput()

template<typename IO>
virtual void TritonMemResource< IO >::copyOutput ( )
inlinevirtual

Reimplemented in TritonCpuShmResource< IO >, and TritonHeapResource< IO >.

Definition at line 26 of file TritonMemResource.h.

26 {}

◆ set()

template<typename IO >
void TritonMemResource< IO >::set ( )
virtual

Reimplemented in TritonHeapResource< IO >.

Definition at line 19 of file TritonMemResource.cc.

References mps_splice::entry, and TRITON_THROW_IF_ERROR.

19  {
20  for (auto& entry : data_->entries_) {
21  TRITON_THROW_IF_ERROR(entry.data_->SetSharedMemory(name_, entry.totalByteSize_, entry.offset_),
22  "unable to set shared memory (" + name_ + ")",
23  true);
24  }
25 }
TritonData< IO > * data_
#define TRITON_THROW_IF_ERROR(X, MSG, NOTIFY)
Definition: triton_utils.h:78

◆ size()

template<typename IO>
size_t TritonMemResource< IO >::size ( void  ) const
inline

Member Data Documentation

◆ addr_

template<typename IO>
uint8_t* TritonMemResource< IO >::addr_
protected

◆ closed_

template<typename IO>
bool TritonMemResource< IO >::closed_
protected

Definition at line 35 of file TritonMemResource.h.

◆ data_

template<typename IO>
TritonData<IO>* TritonMemResource< IO >::data_
protected

◆ name_

template<typename IO>
std::string TritonMemResource< IO >::name_
protected

◆ size_

template<typename IO>
size_t TritonMemResource< IO >::size_
protected