Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Public Member Functions | Static Public Member Functions | Friends
caffe2::TypeMeta Class Reference

TypeMeta is a thin class that allows us to store the type of a container such as a blob, or the data type of a tensor, with a unique run-time id. More...

#include <typeid.h>

Public Types

using New = detail::TypeMetaData::New
 
using PlacementNew = detail::TypeMetaData::PlacementNew
 
using Copy = detail::TypeMetaData::Copy
 
using PlacementDelete = detail::TypeMetaData::PlacementDelete
 
using Delete = detail::TypeMetaData::Delete
 

Public Member Functions

 TypeMeta () noexcept
 Create a dummy TypeMeta object. More...
 
constexpr TypeMeta (const TypeMeta &src) noexcept=default
 Copy constructor.
 
AT_CPP14_CONSTEXPR TypeMetaoperator= (const TypeMeta &src) noexcept=default
 Assignment operator.
 
constexpr TypeMeta (TypeMeta &&rhs) noexcept=default
 
constexpr TypeIdentifier id () const noexcept
 Returns the type id.
 
constexpr size_t itemsize () const noexcept
 Returns the size of the item.
 
constexpr New * newFn () const noexcept
 
constexpr PlacementNew * placementNew () const noexcept
 Returns the placement new function pointer for individual items.
 
constexpr Copy * copy () const noexcept
 Returns the typed copy function pointer for individual iterms.
 
constexpr PlacementDelete * placementDelete () const noexcept
 Returns the destructor function pointer for individual items.
 
constexpr Delete * deleteFn () const noexcept
 
constexpr const char * name () const noexcept
 Returns a printable name for the type.
 
template<typename T >
constexpr bool Match () const noexcept
 

Static Public Member Functions

template<class T >
static TypeIdentifier Id () noexcept
 
template<class T >
static const char * TypeName () noexcept
 
template<class T >
static constexpr size_t ItemSize () noexcept
 
template<typename T >
static TypeMeta Make ()
 Returns a TypeMeta object that corresponds to the typename T.
 

Friends

bool operator== (const TypeMeta &lhs, const TypeMeta &rhs) noexcept
 

Detailed Description

TypeMeta is a thin class that allows us to store the type of a container such as a blob, or the data type of a tensor, with a unique run-time id.

It also stores some additional data such as the item size and the name of the type for run-time inspection.

Definition at line 324 of file typeid.h.

Constructor & Destructor Documentation

caffe2::TypeMeta::TypeMeta ( )
inlinenoexcept

Create a dummy TypeMeta object.

To create a TypeMeta object for a specific type, use TypeMeta::Make<T>().

Definition at line 455 of file typeid.h.


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