Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::GnashNPVariant Class Reference

This class holds ownership of (a copy of) an NPVariant. More...

#include <GnashNPVariant.h>

Public Member Functions

 GnashNPVariant ()
 
 GnashNPVariant (const GnashNPVariant &var)
 
 GnashNPVariant (const NPVariant &var)
 
GnashNPVariantoperator= (const GnashNPVariant &var)
 
void copy (NPVariant &dest) const
 Copy the contained NPVariant into another NPVariant. More...
 
const NPVariant & get () const
 Obtain a reference to the contained NPVariant. More...
 
 ~GnashNPVariant ()
 

Detailed Description

This class holds ownership of (a copy of) an NPVariant.

The user of this class must keep in mind that it does not take ownership of already-allocated resources. The user must supply an NPVariant to construct a GnashNPVariant, and must subsequently release any resources associated with the original NPVariant.

When an object of type GnashNPVariant goes out of scope, the resources associated with the copied NPVariant will be released.

Constructor & Destructor Documentation

§ GnashNPVariant() [1/3]

gnash::GnashNPVariant::GnashNPVariant ( )
inline

§ GnashNPVariant() [2/3]

gnash::GnashNPVariant::GnashNPVariant ( const GnashNPVariant var)
inline

§ GnashNPVariant() [3/3]

gnash::GnashNPVariant::GnashNPVariant ( const NPVariant &  var)
inline

Construct a GnashNPVariant by copying an NPVariant.

Parameters
varThe NPVariant to copy from.

References gnash::CopyVariantValue().

§ ~GnashNPVariant()

gnash::GnashNPVariant::~GnashNPVariant ( )
inline

Member Function Documentation

§ copy()

void gnash::GnashNPVariant::copy ( NPVariant &  dest) const
inline

Copy the contained NPVariant into another NPVariant.

This is useful to return a GnashNPVariant to an external API.

Parameters
destThe NPVariant to copy the value into.

References gnash::CopyVariantValue().

Referenced by gnash::GnashPluginScriptObject::GetProperty(), gnash::GetVariableCallback(), gnash::remoteCallback(), and gnash::TotalFrames().

§ get()

const NPVariant& gnash::GnashNPVariant::get ( ) const
inline

Obtain a reference to the contained NPVariant.

This method returns a const reference to avoid the temptation to modify ownership, which could lead to memory errors. Use copy() if you want to alter the contained NPVariant.

Referenced by gnash::GnashPluginScriptObject::GetVariable(), gnash::IsPlaying(), main(), gnash::PercentLoaded(), and gnash::TotalFrames().

§ operator=()

GnashNPVariant& gnash::GnashNPVariant::operator= ( const GnashNPVariant var)
inline

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