RAII wrapper function to enter and exit a context object similar to python's with syntax.
More...
#include <with.h>
|
template<typename... Args> |
| With (Args &&... args) |
| constructor. Enter the scope of the context. More...
|
|
| ~With () DMLC_THROW_EXCEPTION |
| destructor, leaves the scope of the context. More...
|
|
ContextType * | get () |
|
const ContextType * | get () const |
|
ContextType * | operator-> () |
|
const ContextType * | operator-> () const |
|
ContextType & | operator* () |
|
const ContextType * | operator* () const |
|
ContextType | operator() () |
|
template<typename ContextType>
class tvm::With< ContextType >
RAII wrapper function to enter and exit a context object similar to python's with syntax.
class MyContext {
private:
friend class With<MyContext>;
MyContext(arguments);
void EnterWithScope();
void ExitWithScope();
};
{
With<MyContext> scope(arguments);
}
- Template Parameters
-
ContextType | Type of the context object. |
◆ With()
template<typename ContextType >
template<typename... Args>
constructor. Enter the scope of the context.
◆ ~With()
template<typename ContextType >
destructor, leaves the scope of the context.
◆ get() [1/2]
template<typename ContextType >
ContextType* tvm::With< ContextType >::get |
( |
| ) |
|
|
inline |
◆ get() [2/2]
template<typename ContextType >
const ContextType* tvm::With< ContextType >::get |
( |
| ) |
const |
|
inline |
◆ operator()()
template<typename ContextType >
ContextType tvm::With< ContextType >::operator() |
( |
| ) |
|
|
inline |
◆ operator*() [1/2]
template<typename ContextType >
ContextType& tvm::With< ContextType >::operator* |
( |
| ) |
|
|
inline |
◆ operator*() [2/2]
template<typename ContextType >
const ContextType* tvm::With< ContextType >::operator* |
( |
| ) |
const |
|
inline |
◆ operator->() [1/2]
template<typename ContextType >
ContextType* tvm::With< ContextType >::operator-> |
( |
| ) |
|
|
inline |
◆ operator->() [2/2]
template<typename ContextType >
const ContextType* tvm::With< ContextType >::operator-> |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: