Native Client

pp::Var::OutException Class Reference

This class is used when calling the raw C PPAPI when using the C++ Var as a possible NULL exception. More...

List of all members.

Public Functions

 OutException (Var *v)
 ~OutException ()
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()); }


Constructor and Destructor Details

pp::Var::OutException::OutException ( Var v) [inline]

A constructor.

pp::Var::OutException::~OutException ( ) [inline]

Destructor.


Function Details

PP_Var* pp::Var::OutException::get ( ) [inline]

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

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.