fix keyword problem with C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5f9009bb2a
commit
90c12d3ec0
2 changed files with 16 additions and 16 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef __test_suite_refcount_h__
|
#ifndef TEST_SUITE_REFCOUNT_H__
|
||||||
#define __test_suite_refcount_h__
|
#define TEST_SUITE_REFCOUNT_H__
|
||||||
|
|
||||||
struct RCObjBase {
|
struct RCObjBase {
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -17,7 +17,7 @@ struct RCObjBase {
|
||||||
|
|
||||||
\return The reference counter value.
|
\return The reference counter value.
|
||||||
*/
|
*/
|
||||||
int ref() const
|
int addref() const
|
||||||
{
|
{
|
||||||
return add_ref();
|
return add_ref();
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@ struct RCObjBase {
|
||||||
\return The reference counter value, which can be zero after
|
\return The reference counter value, which can be zero after
|
||||||
deletion.
|
deletion.
|
||||||
*/
|
*/
|
||||||
int unref() const
|
int delref() const
|
||||||
{
|
{
|
||||||
if (ref_count() == 0 || del_ref() == 0 )
|
if (ref_count() == 0 || del_ref() == 0 )
|
||||||
{
|
{
|
||||||
|
|
@ -75,9 +75,9 @@ protected:
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
inline
|
inline
|
||||||
T* ref(T* r)
|
T* addref(T* r)
|
||||||
{
|
{
|
||||||
return (r && r->ref() ) ? r : 0;
|
return (r && r->addref() ) ? r : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Unreference an RCObj object.
|
/*! Unreference an RCObj object.
|
||||||
|
|
@ -85,9 +85,9 @@ T* ref(T* r)
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
inline
|
inline
|
||||||
T* unref(T* r)
|
T* delref(T* r)
|
||||||
{
|
{
|
||||||
return ( r && r->unref() ) ? r : 0;
|
return ( r && r->delref() ) ? r : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -163,7 +163,7 @@ inline
|
||||||
RCPtr<T>::RCPtr(T* realPtr)
|
RCPtr<T>::RCPtr(T* realPtr)
|
||||||
: pointee(realPtr)
|
: pointee(realPtr)
|
||||||
{
|
{
|
||||||
ref(pointee);
|
addref(pointee);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
@ -171,14 +171,14 @@ inline
|
||||||
RCPtr<T>::RCPtr(const RCPtr& rhs)
|
RCPtr<T>::RCPtr(const RCPtr& rhs)
|
||||||
: pointee(rhs.pointee)
|
: pointee(rhs.pointee)
|
||||||
{
|
{
|
||||||
ref(pointee);
|
addref(pointee);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline
|
inline
|
||||||
RCPtr<T>::~RCPtr()
|
RCPtr<T>::~RCPtr()
|
||||||
{
|
{
|
||||||
unref(pointee);
|
delref(pointee);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
@ -186,13 +186,13 @@ inline
|
||||||
RCPtr<T>& RCPtr<T>::operator=(const RCPtr& rhs)
|
RCPtr<T>& RCPtr<T>::operator=(const RCPtr& rhs)
|
||||||
{
|
{
|
||||||
if (pointee != rhs.pointee) {
|
if (pointee != rhs.pointee) {
|
||||||
unref(pointee);
|
delref(pointee);
|
||||||
pointee = rhs.pointee;
|
pointee = rhs.pointee;
|
||||||
ref(pointee);
|
addref(pointee);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //__test_suite_refcount_h__
|
#endif //TEST_SUITE_REFCOUNT_H__
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
// ref. counting for RCObj and all its descendents at once
|
// ref. counting for RCObj and all its descendents at once
|
||||||
//
|
//
|
||||||
|
|
||||||
%refobject RCObj "$this->ref();"
|
%refobject RCObj "$this->addref();"
|
||||||
%unrefobject RCObj "$this->unref();"
|
%unrefobject RCObj "$this->delref();"
|
||||||
|
|
||||||
%include "refcount.h"
|
%include "refcount.h"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue