class RED::IREDObject

Mother class of all REDsdk objects. More...

#include <REDIObject.h>

Inherited by: IAnimationClipController, IAssetManager, ICamera, IChunkSaver, ICloudsVolumeShape, IDataManager, IEntity, IFont, IGeometry, IGeometryDatabase, IGraphicDevice, IImage, IImage2D, IImage3D, IImageComposite, IImageCube, IImageReadback, ILicense, ILight, ILightShape, ILineShape, IMaterial, IMaterial, IMaterialController, IMaterialControllerProperty, IMeshShape, IMessage, IMoonLightShape, IObserver, IOptions, IOptions, IPeer, IPhysicalLightShape, IPlanet, IPointShape, IREDFile, IReferenceManager, IReferenceSolving, IReflectionProbe, IResourceManager, IShape, ISkeletalAnimationBlender, ISkeletalAnimationController, ISkyLightShape, ISoftBucket, ISoftLight, ISoftRayContext, ISoftRenderingContext, ISoftShaderContext, IStar, IStatistics, IStream, ISunLightShape, ITextShape, ITransformShape, IUserData, IViewpoint, IViewpointRenderList, IVolumeShape, IWindow, IWorld and Object.

Public functions:

virtual void *As ( const RED::CID & iCID ) = 0
template< class T > const T *As ( ) const
template< class T > T *As ( )
virtual const void *As ( const RED::CID & iCID ) const = 0

Detailed description:

Mother class of all REDsdk objects.

REDsdk makes an extensive use of the interface concept. Every object in REDsdk inherits the RED::IREDObject class providing an explicit casting mechanism made of a collection of As methods. Giving an interface descriptor (RED::CID), the user can retrieve a pointer on an interface if the object implements it.

Interface classes are prefixed with a 'I' in REDsdk.

There are two ways for retrieving interfaces on RED::IREDObject instances:

(we assume that resmgr is a valid pointer to a RED::Object instance)

  RED::IResourceManager* iresmgr = resmgr->As< RED::IResourceManager >();

or

  RED::IResourceManager* iresmgr = (RED::IResourceManager*)resmgr->As( RED::IResourceManager::GetClassID() );

Note that const and non-const definitions exist for both methods.

Functions documentation

public virtual void * RED::IREDObject::As(const RED::CID &iCID) = 0

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Implemented by: RED::AnimationClip::As, RED::AnimationData::As, RED::BoundingSphere::As, RED::Color::As, RED::FastRandom::As, RED::FileHeader::As, RED::FileInfo::As, RED::FrameStatistics::As, RED::LayerSet::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Matrix::As, RED::Object::As, RED::PassStatistics::As, RED::PostProcess::As, RED::Quaternion::As, RED::Random::As, RED::RayCutoffShader::As, RED::RayGIDiffuseShader::As, RED::RayGIReflectionColorShader::As, RED::RayGIRefractionColorShader::As, RED::RayReflectionShader::As, RED::RayRefractionShader::As, RED::ReflectionShader::As, RED::RenderCode::As, RED::RenderLayer::As, RED::RenderShader::As, RED::RenderShaderAAFilter::As, RED::RenderShaderAmbient::As, RED::RenderShaderAnisotropic::As, RED::RenderShaderData::As, RED::RenderShaderEdges::As, RED::RenderShaderEnvironmental::As, RED::RenderShaderLambert::As, RED::RenderShaderLogo::As, RED::RenderShaderParameter::As, RED::RenderShaderPhong::As, RED::RenderShaderRefractionEffect::As, RED::RenderShaderSectionCut::As, RED::RenderShaderSolid::As, RED::RenderShaderText::As, RED::RenderShaderVertexColor::As, RED::RenderShaderViewport::As, RED::RNG::As, RED::Shader::As, RED::ShaderString::As, RED::ShapePath::As, RED::State::As, RED::StateShader::As, RED::StateShaderPlatformData::As, RED::StreamingPolicy::As, RED::String::As, RED::Thread::As, RED::Timer::As, RED::UserData::As, RED::UserDataRaw::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector3::As, RED::Vector4::As, RED::ViewpointStatistics::As, RED::VolumetricEffect::As, RED::VolumetricEffectBoxVolume::As, RED::VolumetricEffectClouds::As, RED::VolumetricEffectLightVolume::As and RED::WindowRenderInfo::As.

template< class T > public const T * RED::IREDObject::As() const

Template version of the as const method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to a const instance of class T on success, NULL otherwise.

Reimplemented by: RED::AnimationClip::As, RED::AnimationData::As, RED::BoundingSphere::As, RED::Color::As, RED::FastRandom::As, RED::FileHeader::As, RED::FileInfo::As, RED::FrameStatistics::As, RED::LayerSet::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Matrix::As, RED::Object::As, RED::PassStatistics::As, RED::PostProcess::As, RED::Quaternion::As, RED::Random::As, RED::RayCutoffShader::As, RED::RayGIDiffuseShader::As, RED::RayGIReflectionColorShader::As, RED::RayGIRefractionColorShader::As, RED::RayReflectionShader::As, RED::RayRefractionShader::As, RED::ReflectionShader::As, RED::RenderCode::As, RED::RenderLayer::As, RED::RenderShader::As, RED::RenderShaderAAFilter::As, RED::RenderShaderAmbient::As, RED::RenderShaderAnisotropic::As, RED::RenderShaderData::As, RED::RenderShaderEdges::As, RED::RenderShaderEnvironmental::As, RED::RenderShaderLambert::As, RED::RenderShaderLogo::As, RED::RenderShaderParameter::As, RED::RenderShaderPhong::As, RED::RenderShaderRefractionEffect::As, RED::RenderShaderSectionCut::As, RED::RenderShaderSolid::As, RED::RenderShaderText::As, RED::RenderShaderVertexColor::As, RED::RenderShaderViewport::As, RED::RNG::As, RED::Shader::As, RED::ShaderString::As, RED::ShapePath::As, RED::State::As, RED::StateShader::As, RED::StateShaderPlatformData::As, RED::StreamingPolicy::As, RED::String::As, RED::Thread::As, RED::Timer::As, RED::UserData::As, RED::UserDataRaw::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector3::As, RED::Vector4::As, RED::ViewpointStatistics::As, RED::VolumetricEffect::As, RED::VolumetricEffectBoxVolume::As, RED::VolumetricEffectClouds::As, RED::VolumetricEffectLightVolume::As and RED::WindowRenderInfo::As.

template< class T > public T * RED::IREDObject::As()

Template version of the as method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to an instance of class T on success, NULL otherwise.

Reimplemented by: RED::AnimationClip::As, RED::AnimationData::As, RED::BoundingSphere::As, RED::Color::As, RED::FastRandom::As, RED::FileHeader::As, RED::FileInfo::As, RED::FrameStatistics::As, RED::LayerSet::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Matrix::As, RED::Object::As, RED::PassStatistics::As, RED::PostProcess::As, RED::Quaternion::As, RED::Random::As, RED::RayCutoffShader::As, RED::RayGIDiffuseShader::As, RED::RayGIReflectionColorShader::As, RED::RayGIRefractionColorShader::As, RED::RayReflectionShader::As, RED::RayRefractionShader::As, RED::ReflectionShader::As, RED::RenderCode::As, RED::RenderLayer::As, RED::RenderShader::As, RED::RenderShaderAAFilter::As, RED::RenderShaderAmbient::As, RED::RenderShaderAnisotropic::As, RED::RenderShaderData::As, RED::RenderShaderEdges::As, RED::RenderShaderEnvironmental::As, RED::RenderShaderLambert::As, RED::RenderShaderLogo::As, RED::RenderShaderParameter::As, RED::RenderShaderPhong::As, RED::RenderShaderRefractionEffect::As, RED::RenderShaderSectionCut::As, RED::RenderShaderSolid::As, RED::RenderShaderText::As, RED::RenderShaderVertexColor::As, RED::RenderShaderViewport::As, RED::RNG::As, RED::Shader::As, RED::ShaderString::As, RED::ShapePath::As, RED::State::As, RED::StateShader::As, RED::StateShaderPlatformData::As, RED::StreamingPolicy::As, RED::String::As, RED::Thread::As, RED::Timer::As, RED::UserData::As, RED::UserDataRaw::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector3::As, RED::Vector4::As, RED::ViewpointStatistics::As, RED::VolumetricEffect::As, RED::VolumetricEffectBoxVolume::As, RED::VolumetricEffectClouds::As, RED::VolumetricEffectLightVolume::As and RED::WindowRenderInfo::As.

public virtual const void * RED::IREDObject::As(const RED::CID &iCID) const = 0

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Implemented by: RED::AnimationClip::As, RED::AnimationData::As, RED::BoundingSphere::As, RED::Color::As, RED::FastRandom::As, RED::FileHeader::As, RED::FileInfo::As, RED::FrameStatistics::As, RED::LayerSet::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Map::As, RED::Matrix::As, RED::Object::As, RED::PassStatistics::As, RED::PostProcess::As, RED::Quaternion::As, RED::Random::As, RED::RayCutoffShader::As, RED::RayGIDiffuseShader::As, RED::RayGIReflectionColorShader::As, RED::RayGIRefractionColorShader::As, RED::RayReflectionShader::As, RED::RayRefractionShader::As, RED::ReflectionShader::As, RED::RenderCode::As, RED::RenderLayer::As, RED::RenderShader::As, RED::RenderShaderAAFilter::As, RED::RenderShaderAmbient::As, RED::RenderShaderAnisotropic::As, RED::RenderShaderData::As, RED::RenderShaderEdges::As, RED::RenderShaderEnvironmental::As, RED::RenderShaderLambert::As, RED::RenderShaderLogo::As, RED::RenderShaderParameter::As, RED::RenderShaderPhong::As, RED::RenderShaderRefractionEffect::As, RED::RenderShaderSectionCut::As, RED::RenderShaderSolid::As, RED::RenderShaderText::As, RED::RenderShaderVertexColor::As, RED::RenderShaderViewport::As, RED::RNG::As, RED::Shader::As, RED::ShaderString::As, RED::ShapePath::As, RED::State::As, RED::StateShader::As, RED::StateShaderPlatformData::As, RED::StreamingPolicy::As, RED::String::As, RED::Thread::As, RED::Timer::As, RED::UserData::As, RED::UserDataRaw::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector::As, RED::Vector3::As, RED::Vector4::As, RED::ViewpointStatistics::As, RED::VolumetricEffect::As, RED::VolumetricEffectBoxVolume::As, RED::VolumetricEffectClouds::As, RED::VolumetricEffectLightVolume::As and RED::WindowRenderInfo::As.