namespace WrtDeviceApis {
namespace CommonsJavaScript {
-
template<class T>
struct NoAcquire
{
void acquire(T*)
- {
- }
+ {}
+
protected:
~NoAcquire()
- {
- }
+ {}
};
template<class T>
Assert(object && "Object passed to protect can't be NULL.");
JSValueProtect(object->getContext(), object->getObject());
}
+
protected:
~AcquireByProtect()
- {
- }
+ {}
};
template<class T>
{
(void)object;
}
+
protected:
~NoRelease()
- {
- }
+ {}
};
template<class T>
{
delete object->getObject();
}
+
protected:
~ReleaseByDelete()
- {
- }
+ {}
};
template<class T>
Assert(object && "Object passed to unprotect can't be NULL.");
JSValueUnprotect(object->getContext(), object->getObject());
}
+
protected:
~ReleaseByUnprotect()
- {
- }
+ {}
};
template<class T>
{
protected:
~NoOwnership()
- {
- }
+ {}
};
template<class T>
{
protected:
~OwnershipByAcquisition()
- {
- }
+ {}
};
template<class T>
{
protected:
~OwnershipByProtection()
- {
- }
+ {}
};
template<class PrivateClass,
* @throw NullPointerException When object is pointer and is set to NULL.
*/
PrivateObject(JSContextRef context,
- const PrivateClass& object) :
+ const PrivateClass& object) :
m_context(context),
m_object(object)
{
Assert(NULL != m_context && "Context is NULL.");
- Assert(!Commons::IsNull<PrivateClass>::value(object) && "Object is NULL.");
- acquire(this);
+ Assert(!Commons::IsNull<PrivateClass>::value(
+ object) && "Object is NULL.");
+ this->acquire(this);
}
/**
*/
virtual ~PrivateObject()
{
- release(this);
+ this->release(this);
}
/**
* Destroys instance of the object.
*/
virtual ~PrivateObject()
- {
- }
+ {}
/**
* Gets stored JS context.
{
typedef PrivateObject<void, NoOwnership> Type;
};
-
} // CommonsJavaScript
} // WrtDeviceApis