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 ()
 
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

◆ 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 23 of file TritonMemResource.h.

23 {}

◆ copyOutput()

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

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

Definition at line 25 of file TritonMemResource.h.

25 {}

◆ 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  }
24 }
#define TRITON_THROW_IF_ERROR(X, MSG)
Definition: triton_utils.h:75
TritonData< IO > * data_

◆ 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 34 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