Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on the morning of Tuesday 11th August 2020, starting at approximately 9am PDT. It is expected to take around 20 minutes and there will be a short period of downtime (less than five minutes) towards the end of the maintenance window. Please direct any comments, questions, or concerns to computing-help@ligo.org.

Commit c7a4de56 authored by Karl Wette's avatar Karl Wette

SWIGCommon: rename macro OWNED_BY_1ST_ARG(...) to RETURN_OWNED_BY_1ST_ARG(...)

Original: a36b09ce6d97beb7c979ea4e731571a06b418d86
parent 2c4b1dcd
......@@ -2025,20 +2025,20 @@ require:
#define %swiglal_public_clear_VARIABLE_ARGUMENT_LIST(FUNCTION, TYPE, ENDVALUE)
///
/// The <b>SWIGLAL(OWNED_BY_1ST_ARG(...))</b> macro is used when a function returns an object whose
/// memory is owned by the object supplied as the first argument to the function. Typically this
/// occurs when the function is returning some property of its first argument. The macro applies a
/// typemap which calles \c swiglal_store_parent() to store a reference to the first argument as the
/// \c parent of the return argument, so that the parent will not be destroyed as long as the return
/// value is in scope.
/// The <b>SWIGLAL(RETURN_OWNED_BY_1ST_ARG(...))</b> macro is used when a function returns an object
/// whose memory is owned by the object supplied as the first argument to the function. Typically
/// this occurs when the function is returning some property of its first argument. The macro
/// applies a typemap which calles \c swiglal_store_parent() to store a reference to the first
/// argument as the \c parent of the return argument, so that the parent will not be destroyed as
/// long as the return value is in scope.
///
%define %swiglal_public_OWNED_BY_1ST_ARG(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_OWNED_BY_1ST_ARG, TYPE, __VA_ARGS__);
%define %swiglal_public_RETURN_OWNED_BY_1ST_ARG(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG, TYPE, __VA_ARGS__);
%enddef
%define %swiglal_public_clear_OWNED_BY_1ST_ARG(TYPE, ...)
%define %swiglal_public_clear_RETURN_OWNED_BY_1ST_ARG(TYPE, ...)
%swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__);
%enddef
%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_OWNED_BY_1ST_ARG {
%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG {
%#ifndef swiglal_no_1starg
%swiglal_store_parent($1, 0, swiglal_1starg());
%#endif
......@@ -2085,7 +2085,7 @@ typedef struct {} NAME;
/// adds a method <i>Base* cast2Base()</i> method to Derived. Obviously this should be a valid cast
/// for the given types! The SWIG-wrapped object returned by the <i>cast2...()</i> methods will
/// remain in scope as long as the struct that was cast from, by using a typemap similar to that of
/// the SWIGLAL(OWNED_BY_1ST_ARG(...)) macro.
/// the SWIGLAL(RETURN_OWNED_BY_1ST_ARG(...)) macro.
///
%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURNS_SELF {
%#ifndef swiglal_no_1starg
......
......@@ -48,7 +48,7 @@ size_t XLALGetGSequenceLength(LALGSequence* seq);
void XLALDestroyGSequenceIter(LALGSequenceIter* itr);
#ifdef SWIG // SWIG interface directives
SWIGLAL(OWNED_BY_1ST_ARG(LALGSequenceIter*, XLALGSequenceBegin));
SWIGLAL(RETURN_OWNED_BY_1ST_ARG(LALGSequenceIter*, XLALGSequenceBegin));
#endif
LALGSequenceIter* XLALGSequenceBegin(LALGSequence* seq);
bool XLALGSequenceNext(LALGSequenceIter* itr);
......@@ -57,7 +57,7 @@ GSequenceIter* XLALGSequenceBeginRaw(LALGSequence* seq, LALGType type);
#endif
#ifdef SWIG // SWIG interface directives
SWIGLAL(OWNED_BY_1ST_ARG(SnglBurst*, XLALGetGSeqSnglBurst));
SWIGLAL(RETURN_OWNED_BY_1ST_ARG(SnglBurst*, XLALGetGSeqSnglBurst));
#endif
SnglBurst* XLALGetGSeqSnglBurst(LALGSequenceIter* itr);
#ifdef SWIG // SWIG interface directives
......
......@@ -341,7 +341,7 @@ int XLALRandomLatticeTilingPoints(
/// Create a new lattice tiling iterator.
///
#ifdef SWIG // SWIG interface directives
SWIGLAL( OWNED_BY_1ST_ARG( int, XLALCreateLatticeTilingIterator ) );
SWIGLAL( RETURN_OWNED_BY_1ST_ARG( int, XLALCreateLatticeTilingIterator ) );
#endif
LatticeTilingIterator *XLALCreateLatticeTilingIterator(
const LatticeTiling *tiling, ///< [in] Lattice tiling
......@@ -441,7 +441,7 @@ int XLALRestoreLatticeTilingIterator(
/// Create a new lattice tiling locator. If there are tiled dimensions, an index trie is internally built.
///
#ifdef SWIG // SWIG interface directives
SWIGLAL( OWNED_BY_1ST_ARG( int, XLALCreateLatticeTilingLocator ) );
SWIGLAL( RETURN_OWNED_BY_1ST_ARG( int, XLALCreateLatticeTilingLocator ) );
#endif
LatticeTilingLocator *XLALCreateLatticeTilingLocator(
const LatticeTiling *tiling ///< [in] Lattice tiling
......
......@@ -71,7 +71,7 @@ void XLALDestroySphHarmTimeSeries(SphHarmTimeSeries* ts);
UINT4 XLALSphHarmTimeSeriesGetMaxL(SphHarmTimeSeries* ts);
#ifdef SWIG
SWIGLAL(OWNED_BY_1ST_ARG(COMPLEX16TimeSeries*, XLALSphHarmTimeSeriesGetMode));
SWIGLAL(RETURN_OWNED_BY_1ST_ARG(COMPLEX16TimeSeries*, XLALSphHarmTimeSeriesGetMode));
#endif
COMPLEX16TimeSeries* XLALSphHarmTimeSeriesGetMode(SphHarmTimeSeries *ts, UINT4 l, INT4 m);
......@@ -86,7 +86,7 @@ void XLALDestroySphHarmFrequencySeries(SphHarmFrequencySeries* ts);
UINT4 XLALSphHarmFrequencySeriesGetMaxL(SphHarmFrequencySeries* ts);
#ifdef SWIG
SWIGLAL(OWNED_BY_1ST_ARG(COMPLEX16FrequencySeries*, XLALSphHarmFrequencySeriesGetMode));
SWIGLAL(RETURN_OWNED_BY_1ST_ARG(COMPLEX16FrequencySeries*, XLALSphHarmFrequencySeriesGetMode));
#endif
COMPLEX16FrequencySeries* XLALSphHarmFrequencySeriesGetMode(SphHarmFrequencySeries *ts, UINT4 l, INT4 m);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment