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

A reference counted module resource. More...

#include <resource.h>

Inheritance diagram for pp::Resource:
pp::Audio pp::AudioConfig pp::AudioInput_Dev pp::Buffer_Dev pp::Compositor pp::CompositorLayer pp::DeviceRef_Dev pp::ElementaryStream_Samsung pp::FileIO pp::FileRef pp::FileSystem pp::Graphics2D pp::Graphics3D pp::HostResolver pp::HostResolverPrivate pp::ImageData pp::InputEvent pp::MediaDataSource_Samsung pp::MediaPlayer_Samsung pp::MessageLoop pp::NetAddress pp::NetworkList pp::NetworkMonitor pp::RemovableStorage_Dev pp::ResourceArray_Dev pp::TCPServerSocketPrivate pp::TCPSocket pp::TCPSocketPrivate pp::TEECContext_Samsung pp::TEECSession_Samsung pp::TEECSharedMemory_Samsung pp::UDPSocket pp::UDPSocketPrivate pp::URLLoader pp::URLRequestInfo pp::URLResponseInfo pp::VideoCapture_Dev pp::VideoDecoder pp::View pp::WebSocket pp::X509CertificatePrivate

Public Member Functions

 Resource ()
 The default constructor.
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor.
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Protected Member Functions

 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 
void Clear ()
 Sets this resource to null. This releases ownership of the resource.
 

Friends

class Var
 

Detailed Description

A reference counted module resource.

Constructor & Destructor Documentation

pp::Resource::Resource ( const Resource other)

A constructor for copying a resource.

Parameters
[in]otherA Resource.
pp::Resource::Resource ( PP_Resource  resource)
explicitprotected

A constructor used when a PP_Resource is provided as a return value whose reference count we need to increment.

Parameters
[in]resourceA PP_Resource corresponding to a resource.
pp::Resource::Resource ( PassRef  ,
PP_Resource  resource 
)
protected

Constructor used when a PP_Resource already has a ref count assigned. Add additional refcount is not taken.

Member Function Documentation

PP_Resource pp::Resource::detach ( )

This function releases ownership of this resource and returns it to the caller.

Note that the reference count on the resource is unchanged and the caller needs to release the resource.

Returns
The detached PP_Resource.
bool pp::Resource::is_null ( ) const
inline

This functions determines if this resource is invalid or uninitialized.

Returns
true if this resource is invalid or uninitialized.
Resource& pp::Resource::operator= ( const Resource other)

This function assigns one Resource to another Resource.

Parameters
[in]otherA Resource.
Returns
A Resource containing the assigned Resource.
void pp::Resource::PassRefFromConstructor ( PP_Resource  resource)
protected

PassRefFromConstructor is called by derived class' constructors to initialize this Resource with a PP_Resource that has already had its reference count incremented by Core::AddRefResource. It also assumes this object has no current resource.

The intended usage of this function that the derived class constructor will call the default Resource constructor, then make a call to create a resource. It then wants to assign the new resource (which, since it was returned by the browser, already had its reference count increased).

Parameters
[in]resourceA PP_Resource corresponding to a resource.

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