Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
pp::Var::OutException Class Reference

#include <var.h>

Public Member Functions

 OutException (Var *v)
 A constructor.
 
 ~OutException ()
 Destructor.
 
PP_Var * get ()
 

Detailed Description

This class is used when calling the raw C PPAPI when using the C++ Var as a possible NULL exception. This class will handle getting the address of the internal value out if it's non-NULL and fixing up the reference count.

Warning: this will only work for things with exception semantics, i.e. that the value will not be changed if it's a non-undefined exception. Otherwise, this class will mess up the refcounting.

This is a bit subtle:

  • If NULL is passed, we return NULL from get() and do nothing.
  • If a undefined value is passed, we return the address of a undefined var from get and have the output value take ownership of that var.
  • If a non-undefined value is passed, we return the address of that var from get, and nothing else should change.

Example: void FooBar(a, b, Var* exception = NULL) { foo_interface->Bar(a, b, Var::OutException(exception).get()); }


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