HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ort::detail::Base< T > Struct Template Reference

Used internally by the C++ API. C++ wrapper types inherit from this. This is a zero cost abstraction to wrap the C API objects and delete them on destruction. More...

#include <onnxruntime_cxx_api.h>

+ Inheritance diagram for Ort::detail::Base< T >:

Public Types

using contained_type = T
 

Public Member Functions

constexpr Base ()=default
 
constexpr Base (contained_type *p) noexcept
 
 ~Base ()
 
 Base (const Base &)=delete
 
Baseoperator= (const Base &)=delete
 
 Base (Base &&v) noexcept
 
Baseoperator= (Base &&v) noexcept
 
constexpr operator contained_type * () const noexcept
 
contained_typerelease ()
 Relinquishes ownership of the contained C object pointer The underlying object is not destroyed. More...
 

Protected Attributes

contained_typep_ {}
 

Detailed Description

template<typename T>
struct Ort::detail::Base< T >

Used internally by the C++ API. C++ wrapper types inherit from this. This is a zero cost abstraction to wrap the C API objects and delete them on destruction.

All of the C++ classes a) serve as containers for pointers to objects that are created by the underlying C API. Their size is just a pointer size, no need to dynamically allocate them. Use them by value. b) Each of struct XXXX, XXX instances function as smart pointers to the underlying C API objects. they would release objects owned automatically when going out of scope, they are move-only. c) ConstXXXX and UnownedXXX structs function as non-owning, copyable containers for the above pointers. ConstXXXX allow calling const interfaces only. They give access to objects that are owned by somebody else such as Onnxruntime or instances of XXXX classes. d) serve convenient interfaces that return C++ objects and further enhance exception and type safety so they can be used in C++ code.

This is a non-const pointer holder that is move-only. Disposes of the pointer on destruction.

Definition at line 556 of file onnxruntime_cxx_api.h.

Member Typedef Documentation

template<typename T>
using Ort::detail::Base< T >::contained_type = T

Definition at line 557 of file onnxruntime_cxx_api.h.

Constructor & Destructor Documentation

template<typename T>
constexpr Ort::detail::Base< T >::Base ( )
default
template<typename T>
constexpr Ort::detail::Base< T >::Base ( contained_type p)
inlineexplicitnoexcept

Definition at line 560 of file onnxruntime_cxx_api.h.

template<typename T>
Ort::detail::Base< T >::~Base ( )
inline

Definition at line 561 of file onnxruntime_cxx_api.h.

template<typename T>
Ort::detail::Base< T >::Base ( const Base< T > &  )
delete
template<typename T>
Ort::detail::Base< T >::Base ( Base< T > &&  v)
inlinenoexcept

Definition at line 566 of file onnxruntime_cxx_api.h.

Member Function Documentation

template<typename T>
constexpr Ort::detail::Base< T >::operator contained_type * ( ) const
inlinenoexcept

Definition at line 573 of file onnxruntime_cxx_api.h.

template<typename T>
Base& Ort::detail::Base< T >::operator= ( const Base< T > &  )
delete
template<typename T>
Base& Ort::detail::Base< T >::operator= ( Base< T > &&  v)
inlinenoexcept

Definition at line 567 of file onnxruntime_cxx_api.h.

template<typename T>
contained_type* Ort::detail::Base< T >::release ( )
inline

Relinquishes ownership of the contained C object pointer The underlying object is not destroyed.

Definition at line 577 of file onnxruntime_cxx_api.h.

Member Data Documentation

template<typename T>
contained_type* Ort::detail::Base< T >::p_ {}
protected

Definition at line 584 of file onnxruntime_cxx_api.h.


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