IC Imaging Control C++

static_smart_ptr_cast Method

static_smart_ptr_cast Method

Casts a smart_ptr to a TType to a smart_ptr to a TDestType by using static_cast.
Syntax:
template<typename TDestType,typename="" TType="">
inline smart_ptr<TDestType> static_smart_ptr_cast( smart_ptr<TType> op2 )

Parameter Description
op2

The smart_ptr to be casted to TDestType.

Return value:

The result of the static_cast operation.

Remarks:

The program has to make sure that op2 is actually of type TDestType, otherwise its behavior is undefined.

Information:

Namespace: DShowLib
Introduced in version 3.5

Sample:

The following sample shows how cast a GrabberSinkType that was returned from Grabber::getSinkTypePtr to its actual type:

grabber.setSinkType( FrameQueueSink::create( /* ... */ ) );

// ...

smart_ptr<FrameQueueSink> pSink = static_smart_ptr_cast<FrameQueueSink>( grabber.getSinkTypePtr() );

See also: smart_ptr

<< Functions

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us