0

I use MonkSVG lib. Here is an example of code:

link

Here is a part of code:

OpenVG_SVGHandler::OpenVG_SVGHandler()
    :   ISVGHandler()
    ,   _mode( kGroupParseMode )
    ,   _current_group( &_root_group ) 
    ,   _blackBackFill( 0 )
    ,   _batch( 0 )
    ,   _use_opacity( 1 )
    ,   _has_transparent_colors( false )

As I understand the first one - ISVGHandler() - means the calling of the parent constructor without params.

So:

  • what do the other params mean?

  • _current_group( &_root_group ) means I need to pass an additional parameter to it, isn't it?

  • For example, is there any difference between _batch(0) and batch = 0;?

  • has an order any influence?

user2083364
  • 744
  • 1
  • 7
  • 20

1 Answers1

0
OpenVG_SVGHandler::OpenVG_SVGHandler()
    :   ISVGHandler()
{
    _mod = kGroupParseMode;
    _current_group = &_root_group;
    _blackBackFill = 0;
    _batch = 0;
    _use_opacity = 1;
    _has_transparent_colors = false;
}

=> shortcut =>

OpenVG_SVGHandler::OpenVG_SVGHandler()
    :   ISVGHandler()
    ,   _mode( kGroupParseMode )
    ,   _current_group( &_root_group ) 
    ,   _blackBackFill( 0 )
    ,   _batch( 0 )
    ,   _use_opacity( 1 )
    ,   _has_transparent_colors( false )
{
}

order has some influance

Class::Class()
    :  b(a),    // b == 10, 0, or random value ?? Compiller usually raises warrning
       a(10)
{
}
user993954
  • 423
  • 4
  • 8
  • Members will be initialized in the order in which they appear in the class body. The order in which they appear in the initialization list is irrelevant to the compiler, though good practice dictates that the order should be the same as that of the class body. In your example, if `a` appears before `b` in the definition of `Class`, the initialization will work correctly, and `b` will be correctly initialized with `a`. – Benjamin Lindley Oct 02 '13 at 15:11
  • -1: An initialization list is not a *shortcut* for assignments within the constructor body. The implication is that they are the same thing -- but they aren't. – John Dibling Oct 02 '13 at 15:13
  • This answer is incomplete but no one can post new answers so I accept it. – user2083364 Oct 03 '13 at 06:37