Function operator=

Summary

#include <Source/Falcor/Core/API/Shader.h>

(1) T * operator=(T *in)

(2) const ThisType & operator=(const ThisType &rhs)

(3) ComPtr & operator=(ThisType &&rhs)

Function overload

Synopsis

#include <Source/Falcor/Core/API/Shader.h>

T * operator=(T *in)

Description

Add a new reference to an existing object.

Source

Lines 59-65 in Source/Falcor/Core/API/Shader.h.

T* operator=(T* in)
{
    if(in) in->AddRef();
    if(mpObject) mpObject->Release();
    mpObject = in;
    return in;
}

Synopsis

#include <Source/Falcor/Core/API/Shader.h>

const ThisType & operator=(const ThisType &rhs)

Description

Add a new reference to an existing object.

Source

Lines 68-74 in Source/Falcor/Core/API/Shader.h.

const ThisType& operator=(const ThisType& rhs)
{
    if(rhs.mpObject) rhs.mpObject->AddRef();
    if(mpObject) mpObject->Release();
    mpObject = rhs.mpObject;
    return *this;
}

Synopsis

#include <Source/Falcor/Core/API/Shader.h>

ComPtr & operator=(ThisType &&rhs)

Description

Transfer ownership of a reference.

Source

Lines 80-80 in Source/Falcor/Core/API/Shader.h.

ComPtr& operator=(ThisType&& rhs) { T* swap = mpObject; mpObject = rhs.mpObject; rhs.mpObject = swap; return *this; }





Add Discussion as Guest

Log in to DocsForge