Sauce-0.10.1
A C++ Dependency Injection Framework
Public Member Functions | List of all members
sauce::internal::PendingThrower Class Reference

A mixin to defer and throw pending exceptions. More...

#include <sauce/internal/pending_thrower.h>

Inheritance diagram for sauce::internal::PendingThrower:
Inheritance graph
[legend]

Public Member Functions

template<typename Exception >
void throwLater ()
 Save an exception of the given type to throw when it is safe. More...
 
void throwAnyPending ()
 Throw and clear any saved exception. More...
 
PendingThrow clear ()
 Clear and return any saved exception. More...
 

Detailed Description

A mixin to defer and throw pending exceptions.

Constructor & Destructor Documentation

◆ PendingThrower()

sauce::internal::PendingThrower::PendingThrower ( )
inline
28 :
29 pending(NULL) {}

Member Function Documentation

◆ clear()

PendingThrow sauce::internal::PendingThrower::clear ( )
inline

Clear and return any saved exception.

returns NULL if no exception is pending.

58 {
59 PendingThrow toThrow = pending;
60 pending = NULL;
61 return toThrow;
62 }

◆ throwAnyPending()

void sauce::internal::PendingThrower::throwAnyPending ( )
inline

Throw and clear any saved exception.

46 {
47 PendingThrow toThrow = clear();
48 if (toThrow) {
49 toThrow();
50 }
51 }
PendingThrow clear()
Clear and return any saved exception.
Definition: pending_thrower.h:58
Here is the call graph for this function:

◆ throwLater()

template<typename Exception >
void sauce::internal::PendingThrower::throwLater ( )
inline

Save an exception of the given type to throw when it is safe.

The exception must have an accessible nullary constructor.

Any previously saved exception is dropped.

39 {
40 pending = &pendingThrowFactory<Exception>;
41 }

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