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

This class is for <void*> data and allows casting to any pointers. More...

#include <ie_locked_memory.hpp>

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

Public Member Functions

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

Friends

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

Detailed Description

template<>
class InferenceEngine::LockedMemory< void >

This class is for <void*> data and allows casting to any pointers.

Constructor & Destructor Documentation

§ LockedMemory() [1/2]

InferenceEngine::LockedMemory< void >::LockedMemory ( IAllocator ptr,
void *  handle,
size_t  offsetInBytes 
)
inline

A constructor.

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

§ LockedMemory() [2/2]

InferenceEngine::LockedMemory< void >::LockedMemory ( LockedMemory< void > &&  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() [1/2]

template<class S , typename = std::enable_if<std::is_pointer<S>::value>>
S InferenceEngine::LockedMemory< void >::as ( )
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

§ as() [2/2]

template<class S , typename = std::enable_if<std::is_pointer<S>::value>>
const S InferenceEngine::LockedMemory< void >::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 const object

§ operator S*()

template<class S >
InferenceEngine::LockedMemory< void >::operator S* ( )
inline

Gets the pointer to the stored object of the given template type.

Dereferences from the base class.

Template Parameters
SType to be casted to
Returns
The pointer to the object of the given template type

§ operator==()

bool InferenceEngine::LockedMemory< void >::operator== ( const void *  pointer) const
inline

Compares stored object with the given one.

Returns
true if objects are equal, false otherwise

Friends And Related Function Documentation

§ operator==

bool operator== ( const void *  pointer,
const LockedMemory< void > &  lm 
)
friend

Compares the object with the one stored in the memory.

Returns
true if objects are equal, false otherwise

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