nlib
nn::nlib::handle_maker Namespace Reference

Namespace in which a function template to customize the HandleMaker class is defined. More...

Classes

struct  NumHandle
 A total number of handles that access the HBODY type can be obtained through the data member size of the size_t type static const. More...
 

Functions

template<class HBODY >
void DestroyHandleBody (HBODY *body) noexcept
 Called from the HandleMaker object to destroy a handle instance. More...
 
template<class HBODY >
void LockHandleBody (HBODY *body) noexcept
 Called when the HandleAccess<HBODY> object is given by HandleMaker<HBODY>::GetHandleAccess(). More...
 
template<class HBODY >
void UnlockHandleBody (HBODY *body) noexcept
 Executed when the HandleAccess<HBODY> object is destructed. More...
 
template<class HBODY >
bool IsHandleBodyEnabled (HBODY *body) noexcept
 Returns if the handle instance is valid or not. More...
 

Detailed Description

Namespace in which a function template to customize the HandleMaker class is defined.

Function Documentation

template<class HBODY >
nn::nlib::handle_maker::DestroyHandleBody ( HBODY *  body)
inlinenoexcept

Called from the HandleMaker object to destroy a handle instance.

Template Parameters
HBODYHandle instance type.
Parameters
[in]bodyHandle instance.
Description
You can customize the destruction of handle instances by specializing this function template. By default, deletes body.‎

Definition at line 12 of file HandleMaker.h.

template<class HBODY >
nn::nlib::handle_maker::IsHandleBodyEnabled ( HBODY *  body)
inlinenoexcept

Returns if the handle instance is valid or not.

Template Parameters
HBODYHandle instance type.
Parameters
[in]bodyHandle instance.
Returns
Returns true if the handle instance is valid (available for use).
Description
If the handle instance has been initialized and is available for use, true needs to be returned. If the handle instance has been finalized (before destruction) and is not available for use, false needs to be returned. Called when a handle instance is being locked by LockHandleBody().

Definition at line 30 of file HandleMaker.h.

template<class HBODY >
nn::nlib::handle_maker::LockHandleBody ( HBODY *  body)
inlinenoexcept

Called when the HandleAccess<HBODY> object is given by HandleMaker<HBODY>::GetHandleAccess().

Template Parameters
HBODYHandle instance type.
Parameters
[in]bodyHandle instance.
Description
You can customize the lock behavior for using handle instances by specializing this function template. By default, body->Lock() is executed.

Definition at line 18 of file HandleMaker.h.

template<class HBODY >
nn::nlib::handle_maker::UnlockHandleBody ( HBODY *  body)
inlinenoexcept

Executed when the HandleAccess<HBODY> object is destructed.

Template Parameters
HBODYHandle instance type.
Parameters
[in]bodyHandle instance.
Description
You can customize the unlock behavior after using handle instances by specializing this function template. By default, body->Unlock() is executed.

Definition at line 24 of file HandleMaker.h.