Asylo
Public Types | Public Member Functions | Public Attributes | List of all members
asylo::primitives::EntryHandler Class Reference

Callback structure for dispatching messages passed to the enclave. More...

#include <asylo/platform/primitives/trusted_primitives.h>

Collaboration diagram for asylo::primitives::EntryHandler:
Collaboration graph
[legend]

Public Types

using Callback = PrimitiveStatus(*)(void *context, MessageReader *in, MessageWriter *out)
 The type of all handler callbacks takes a type-erased context, a MessageReader from which to consume inputs, and a MessageWriter in which to write all return values. More...
 

Public Member Functions

 EntryHandler ()
 Constructs a null handler. More...
 
 EntryHandler (Callback callback)
 Constructs an entry handler with a callback and null context. More...
 
 EntryHandler (Callback callback, void *context)
 Initializes an entry handler with a callback and a context pointer. More...
 
bool IsNull () const
 A predicate for whether the callback is initialized. More...
 
 operator bool () const
 Implicit bool conversion for null checks. More...
 

Public Attributes

Callback callback
 Callback function to invoke for this entry. More...
 
void * context
 Uninterpreted data passed by the runtime to invocations of the handler. More...
 

Detailed Description

Callback structure for dispatching messages passed to the enclave.

Each EntryHandler represents a call to inside the enclave, and will be registered with TrustedPrimitives::RegisterEntryHandler.

Member Typedef Documentation

◆ Callback

using asylo::primitives::EntryHandler::Callback = PrimitiveStatus (*)(void *context, MessageReader *in, MessageWriter *out)

The type of all handler callbacks takes a type-erased context, a MessageReader from which to consume inputs, and a MessageWriter in which to write all return values.

Constructor & Destructor Documentation

◆ EntryHandler() [1/3]

asylo::primitives::EntryHandler::EntryHandler ( )
inline

Constructs a null handler.

◆ EntryHandler() [2/3]

asylo::primitives::EntryHandler::EntryHandler ( Callback  callback)
inlineexplicit

Constructs an entry handler with a callback and null context.

Parameters
callbackThe callback this handler uses.

◆ EntryHandler() [3/3]

asylo::primitives::EntryHandler::EntryHandler ( Callback  callback,
void *  context 
)
inline

Initializes an entry handler with a callback and a context pointer.

Parameters
callbackThe callback this handler uses.
contextA type-erased non-owned pointer that is passed to the callback when called. Since an EntryHandler is registered in an enclave-global context, the object should live as long as the enclave.

Member Function Documentation

◆ IsNull()

bool asylo::primitives::EntryHandler::IsNull ( ) const
inline

A predicate for whether the callback is initialized.

Returns
true if this handler is uninitialized.

◆ operator bool()

asylo::primitives::EntryHandler::operator bool ( ) const
inline

Implicit bool conversion for null checks.

Member Data Documentation

◆ callback

Callback asylo::primitives::EntryHandler::callback

Callback function to invoke for this entry.

◆ context

void* asylo::primitives::EntryHandler::context

Uninterpreted data passed by the runtime to invocations of the handler.


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