ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flatbuffers::grpc::Message< T > Class Template Reference

#include <grpc.h>

Public Member Functions

 Message ()
 
 Message (grpc_slice slice, bool add_ref)
 
Messageoperator= (const Message &other)=delete
 
 Message (Message &&other)
 
 Message (const Message &other)=delete
 
Messageoperator= (Message &&other)
 
 ~Message ()
 
const uint8_t * mutable_data () const
 
const uint8_t * data () const
 
size_t size () const
 
bool Verify () const
 
T * GetMutableRoot ()
 
const T * GetRoot () const
 
const grpc_slice & BorrowSlice () const
 

Detailed Description

template<class T>
class flatbuffers::grpc::Message< T >

Definition at line 36 of file grpc.h.

Constructor & Destructor Documentation

◆ Message() [1/4]

template<class T >
flatbuffers::grpc::Message< T >::Message ( )
inline

Definition at line 39 of file grpc.h.

39: slice_(grpc_empty_slice()) {}

◆ Message() [2/4]

template<class T >
flatbuffers::grpc::Message< T >::Message ( grpc_slice  slice,
bool  add_ref 
)
inline

Definition at line 41 of file grpc.h.

41: slice_(add_ref ? grpc_slice_ref(slice) : slice) {}

◆ Message() [3/4]

template<class T >
flatbuffers::grpc::Message< T >::Message ( Message< T > &&  other)
inline

Definition at line 45 of file grpc.h.

45: slice_(other.slice_) { other.slice_ = grpc_empty_slice(); }

◆ Message() [4/4]

template<class T >
flatbuffers::grpc::Message< T >::Message ( const Message< T > &  other)
delete

◆ ~Message()

template<class T >
flatbuffers::grpc::Message< T >::~Message ( )
inline

Definition at line 57 of file grpc.h.

57{ grpc_slice_unref(slice_); }

Member Function Documentation

◆ BorrowSlice()

template<class T >
const grpc_slice & flatbuffers::grpc::Message< T >::BorrowSlice ( ) const
inline

Definition at line 76 of file grpc.h.

76{ return slice_; }

◆ data()

template<class T >
const uint8_t * flatbuffers::grpc::Message< T >::data ( ) const
inline

Definition at line 61 of file grpc.h.

61{ return GRPC_SLICE_START_PTR(slice_); }

Referenced by flatbuffers::grpc::Message< T >::GetRoot(), and flatbuffers::grpc::Message< T >::Verify().

◆ GetMutableRoot()

template<class T >
T * flatbuffers::grpc::Message< T >::GetMutableRoot ( )
inline

Definition at line 71 of file grpc.h.

71{ return flatbuffers::GetMutableRoot<T>(mutable_data()); }
const uint8_t * mutable_data() const
Definition grpc.h:59

References flatbuffers::grpc::Message< T >::mutable_data().

◆ GetRoot()

template<class T >
const T * flatbuffers::grpc::Message< T >::GetRoot ( ) const
inline

Definition at line 73 of file grpc.h.

73{ return flatbuffers::GetRoot<T>(data()); }
const uint8_t * data() const
Definition grpc.h:61

References flatbuffers::grpc::Message< T >::data().

◆ mutable_data()

template<class T >
const uint8_t * flatbuffers::grpc::Message< T >::mutable_data ( ) const
inline

Definition at line 59 of file grpc.h.

59{ return GRPC_SLICE_START_PTR(slice_); }

Referenced by flatbuffers::grpc::Message< T >::GetMutableRoot().

◆ operator=() [1/2]

template<class T >
Message & flatbuffers::grpc::Message< T >::operator= ( const Message< T > &  other)
delete

◆ operator=() [2/2]

template<class T >
Message & flatbuffers::grpc::Message< T >::operator= ( Message< T > &&  other)
inline

Definition at line 49 of file grpc.h.

50 {
51 grpc_slice_unref(slice_);
52 slice_ = other.slice_;
53 other.slice_ = grpc_empty_slice();
54 return *this;
55 }

◆ size()

template<class T >
size_t flatbuffers::grpc::Message< T >::size ( ) const
inline

Definition at line 63 of file grpc.h.

63{ return GRPC_SLICE_LENGTH(slice_); }

Referenced by flatbuffers::grpc::Message< T >::Verify().

◆ Verify()

template<class T >
bool flatbuffers::grpc::Message< T >::Verify ( ) const
inline

Definition at line 65 of file grpc.h.

66 {
67 Verifier verifier(data(), size());
68 return verifier.VerifyBuffer<T>(nullptr);
69 }
size_t size() const
Definition grpc.h:63

References flatbuffers::grpc::Message< T >::data(), and flatbuffers::grpc::Message< T >::size().


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