RAII wrapper function to enter and exit a context object similar to python's with syntax.
More...
#include <with.h>
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);
}
With(Args &&... args)
constructor. Enter the scope of the context.
Definition: with.h:65
- Template Parameters
-
ContextType | Type of the context object. |
◆ With() [1/3]
template<typename ContextType >
template<typename... Args>
constructor. Enter the scope of the context.
◆ ~With()
template<typename ContextType >
destructor, leaves the scope of the context.
◆ With() [2/3]
template<typename ContextType >
◆ With() [3/3]
template<typename ContextType >
◆ 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 |
◆ operator=() [1/2]
template<typename ContextType >
◆ operator=() [2/2]
template<typename ContextType >
The documentation for this class was generated from the following file: