Public Member Functions | Friends
InferenceEngine::LockedMemory< const T > Class Template Reference

This class is for read-only segments. More...

#include <ie_locked_memory.hpp>

Inheritance diagram for InferenceEngine::LockedMemory< const T >:
Inheritance graph
[legend]
Collaboration diagram for InferenceEngine::LockedMemory< const T >:
Collaboration graph
[legend]

Public Member Functions

 LockedMemory (IAllocator *ptr, void *handle, size_t offset)
 A constructor. More...
 
 LockedMemory (LockedMemory< const T > &&)=default
 A default copy constructor that accepts rvalue.
 
 LockedMemory (LockedMemory< const T > &&that, size_t offset)
 A default copy constructor that accepts rvalue. More...
 
 LockedMemory (const LockedMemory< const T > &)=delete
 A disabled copy constructor for lvalue.
 
 operator const T * () const
 Gets the const pointer to the stored object. More...
 
bool operator== (const T *pointer) const
 Compares stored object with the given one. More...
 
template<class S , typename = std::enable_if<std::is_pointer<S>::value && std::is_const<S>::value>>
as () const
 Casts stored object to any given type. More...
 

Friends

bool operator== (const T *pointer, const LockedMemory< const T > &lm)
 Compares the object with the one stored in the memory. More...
 

Detailed Description

template<class T>
class InferenceEngine::LockedMemory< const T >

This class is for read-only segments.

Constructor & Destructor Documentation

◆ LockedMemory() [1/2]

template<class T >
InferenceEngine::LockedMemory< const T >::LockedMemory ( IAllocator ptr,
void *  handle,
size_t  offset 
)
inline

A constructor.

Parameters
ptrPointer to IAllocator object
handleHandle provided by allocator
offsetOffset in bytes in originally locked region

◆ LockedMemory() [2/2]

template<class T >
InferenceEngine::LockedMemory< const T >::LockedMemory ( LockedMemory< const T > &&  that,
size_t  offset 
)
inline

A default copy constructor that accepts rvalue.

Also sets the offset value for the new memory object

Parameters
thatRvalue reference for the other LockedMemoryBase instance
offsetOffset value

Member Function Documentation

◆ as()

template<class T >
template<class S , typename = std::enable_if<std::is_pointer<S>::value && std::is_const<S>::value>>
S InferenceEngine::LockedMemory< const T >::as ( ) const
inline

Casts stored object to any given type.

Uses reinterpret_cast.

Template Parameters
SType to be casted to
Returns
Casted to the given type object

◆ operator const T *()

template<class T >
InferenceEngine::LockedMemory< const T >::operator const T * ( ) const
inline

Gets the const pointer to the stored object.

Dereferences from the base class.

Returns
The pointer to the object.

◆ operator==()

template<class T >
bool InferenceEngine::LockedMemory< const T >::operator== ( const T *  pointer) const
inline

Compares stored object with the given one.

Parameters
pointerA pointer to compare with
Returns
true if objects are equal, false otherwise

Friends And Related Function Documentation

◆ operator==

template<class T >
bool operator== ( const T *  pointer,
const LockedMemory< const T > &  lm 
)
friend

Compares the object with the one stored in the memory.

Parameters
pointerA pointer to compare with
lmA compared LockedMemory object
Returns
true if objects are equal, false otherwise

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