Gnash  0.8.10
Public Member Functions
gnash::GnashNPVariant Class Reference

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

#include <GnashNPVariant.h>

List of all members.

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.
const NPVariant & get () const
 Obtain a reference to the contained NPVariant.
 ~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

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

Construct a GnashNPVariant by copying an NPVariant.

Parameters:
varThe NPVariant to copy from.

References gnash::CopyVariantValue().

gnash::GnashNPVariant::~GnashNPVariant ( ) [inline]

Member Function Documentation

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::GetVariableCallback(), gnash::TotalFrames(), gnash::remoteCallback(), and gnash::GnashPluginScriptObject::GetProperty().

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::IsPlaying(), gnash::PercentLoaded(), gnash::TotalFrames(), gnash::remoteCallback(), gnash::GnashPluginScriptObject::GetVariable(), and main().

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

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