OnnxRuntime
Ort::ModelMetadata Struct Reference

Wrapper around OrtModelMetadata. More...

#include <onnxruntime_cxx_api.h>

Inherits Ort::Base< OrtModelMetadata >.

Public Member Functions

 ModelMetadata (std::nullptr_t)
 Create an empty ModelMetadata object, must be assigned a valid one to be used. More...
 
 ModelMetadata (OrtModelMetadata *p)
 Used for interop with the C API. More...
 
char * GetProducerName (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetProducerName. More...
 
AllocatedStringPtr GetProducerNameAllocated (OrtAllocator *allocator) const
 Returns a copy of the producer name. More...
 
char * GetGraphName (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetGraphName. More...
 
AllocatedStringPtr GetGraphNameAllocated (OrtAllocator *allocator) const
 Returns a copy of the graph name. More...
 
char * GetDomain (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetDomain. More...
 
AllocatedStringPtr GetDomainAllocated (OrtAllocator *allocator) const
 Returns a copy of the domain name. More...
 
char * GetDescription (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetDescription. More...
 
AllocatedStringPtr GetDescriptionAllocated (OrtAllocator *allocator) const
 Returns a copy of the description. More...
 
char * GetGraphDescription (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetGraphDescription. More...
 
AllocatedStringPtr GetGraphDescriptionAllocated (OrtAllocator *allocator) const
 Returns a copy of the graph description. More...
 
char ** GetCustomMetadataMapKeys (OrtAllocator *allocator, int64_t &num_keys) const
 Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys. More...
 
std::vector< AllocatedStringPtrGetCustomMetadataMapKeysAllocated (OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys. More...
 
char * LookupCustomMetadataMap (const char *key, OrtAllocator *allocator) const
 Wraps OrtApi::ModelMetadataLookupCustomMetadataMap. More...
 
AllocatedStringPtr LookupCustomMetadataMapAllocated (const char *key, OrtAllocator *allocator) const
 Looks up a value by a key in the Custom Metadata map. More...
 
int64_t GetVersion () const
 Wraps OrtApi::ModelMetadataGetVersion. More...
 
- Public Member Functions inherited from Ort::Base< OrtModelMetadata >
 Base ()=default
 
 Base (OrtModelMetadata *p)
 
 ~Base ()
 
 operator OrtModelMetadata * ()
 
 operator const OrtModelMetadata * () const
 
OrtModelMetadatarelease ()
 Releases ownership of the contained pointer. More...
 

Additional Inherited Members

- Public Types inherited from Ort::Base< OrtModelMetadata >
using contained_type = OrtModelMetadata
 
- Protected Member Functions inherited from Ort::Base< OrtModelMetadata >
 Base (const Base &)=delete
 
 Base (Base &&v) noexcept
 
Baseoperator= (const Base &)=delete
 
void operator= (Base &&v) noexcept
 
- Protected Attributes inherited from Ort::Base< OrtModelMetadata >
OrtModelMetadatap_
 

Detailed Description

Wrapper around OrtModelMetadata.

Constructor & Destructor Documentation

◆ ModelMetadata() [1/2]

Ort::ModelMetadata::ModelMetadata ( std::nullptr_t  )
inlineexplicit

Create an empty ModelMetadata object, must be assigned a valid one to be used.

◆ ModelMetadata() [2/2]

Ort::ModelMetadata::ModelMetadata ( OrtModelMetadata p)
inlineexplicit

Used for interop with the C API.

Member Function Documentation

◆ GetCustomMetadataMapKeys()

char ** Ort::ModelMetadata::GetCustomMetadataMapKeys ( OrtAllocator allocator,
int64_t &  num_keys 
) const

Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys.

Deprecated:
use GetCustomMetadataMapKeysAllocated() [[deprecated]] This interface produces multiple pointers that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetCustomMetadataMapKeysAllocated()

std::vector< AllocatedStringPtr > Ort::ModelMetadata::GetCustomMetadataMapKeysAllocated ( OrtAllocator allocator) const

◆ GetDescription()

char * Ort::ModelMetadata::GetDescription ( OrtAllocator allocator) const

Wraps OrtApi::ModelMetadataGetDescription.

Deprecated:
use GetDescriptionAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetDescriptionAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetDescriptionAllocated ( OrtAllocator allocator) const

Returns a copy of the description.

Parameters
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetDescription

◆ GetDomain()

char * Ort::ModelMetadata::GetDomain ( OrtAllocator allocator) const

Wraps OrtApi::ModelMetadataGetDomain.

Deprecated:
use GetDomainAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetDomainAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetDomainAllocated ( OrtAllocator allocator) const

Returns a copy of the domain name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetDomain

◆ GetGraphDescription()

char * Ort::ModelMetadata::GetGraphDescription ( OrtAllocator allocator) const

Wraps OrtApi::ModelMetadataGetGraphDescription.

Deprecated:
use GetGraphDescriptionAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetGraphDescriptionAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetGraphDescriptionAllocated ( OrtAllocator allocator) const

Returns a copy of the graph description.

Parameters
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetGraphDescription

◆ GetGraphName()

char * Ort::ModelMetadata::GetGraphName ( OrtAllocator allocator) const

Wraps OrtApi::ModelMetadataGetGraphName.

Deprecated:
use GetGraphNameAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetGraphNameAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetGraphNameAllocated ( OrtAllocator allocator) const

Returns a copy of the graph name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetGraphName

◆ GetProducerName()

char * Ort::ModelMetadata::GetProducerName ( OrtAllocator allocator) const

Wraps OrtApi::ModelMetadataGetProducerName.

Deprecated:
use GetProducerNameAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ GetProducerNameAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetProducerNameAllocated ( OrtAllocator allocator) const

Returns a copy of the producer name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetProducerName

◆ GetVersion()

int64_t Ort::ModelMetadata::GetVersion ( ) const

◆ LookupCustomMetadataMap()

char * Ort::ModelMetadata::LookupCustomMetadataMap ( const char *  key,
OrtAllocator allocator 
) const

Wraps OrtApi::ModelMetadataLookupCustomMetadataMap.

Deprecated:
use LookupCustomMetadataMapAllocated() [[deprecated]] This interface produces a pointer that must be released by the specified allocator and is often leaked. Not exception safe.

◆ LookupCustomMetadataMapAllocated()

AllocatedStringPtr Ort::ModelMetadata::LookupCustomMetadataMapAllocated ( const char *  key,
OrtAllocator allocator 
) const

Looks up a value by a key in the Custom Metadata map.

Parameters
keyzero terminated string key to lookup
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. maybe nullptr if key is not found.

The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataLookupCustomMetadataMap