common: Introduce class type identifier apis.
authorHermet Park <chuneon.park@samsung.com>
Fri, 22 Oct 2021 05:39:38 +0000 (14:39 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 26 Oct 2021 03:56:35 +0000 (12:56 +0900)
commit301aeaf72be2904c94e88119cfa8f69bda3ea5ab
tree00b16357293051897325050e16c5b04c636521b4
parentda96169ffb8045de08b22a67a93218f25df60632
common: Introduce class type identifier apis.

This identifier is useful when user identify the instance type in runtime.

ThorVG basically don't prefer to dynamic_cast() nor typeid(),
it compiles with -fno-rtti option for the optimial size.

Here is an example for the simple usage.

if (paint->identifier() == Shape::identifier())
  auto shape = static_cast<Shape*>(paint);

@Issue: https://github.com/Samsung/thorvg/issues/693
inc/thorvg.h
src/lib/tvgLinearGradient.cpp
src/lib/tvgPicture.cpp
src/lib/tvgRadialGradient.cpp
src/lib/tvgScene.cpp
src/lib/tvgShape.cpp