-3

I am trying to understand some code of the Linear Collider I/O project. I am C++ newbie and I cannot understand what the below line means in the code that I have copied below.

vertex::vertex(): Processor("vertex"),_output(0)

What does : mean in the above line of code? Thanks to everybody in advance!

The code is written below

#include <marlin/Global.h>
#include "lcio.h"
//more .h files that I have not shown here

using namespace lcio ;
using namespace marlin ;

using namespace std;

vertex avertex ;

 vertex::vertex():Processor("vertex"),_output(0)
{
    _description = "Measure Bush Quantities" ;

std::vector<std::string> branchCollections;
branchCollections.push_back(std::string("Branch_ECALEndcap"));
branchCollections.push_back(std::string("Branch_HCALEndcap"));
registerProcessorParameter("branchCollections" ,                      "Name of Branch Collections" ,_branchCollections,branchCollections);



_treeFileName="vertex.root";
registerProcessorParameter( "TreeOutputFile" , 
        "The name of the file to which the ROOT tree will be written" ,
        _treeFileName ,
        _treeFileName);


}

void vertex::init() {
 //not important

}


void vertex::processEvent( LCEvent * evtP ) 
{       

    //not important

}
isht
  • 65
  • 2
  • 11

3 Answers3

2

The following code

vertex::vertex():Processor("vertex"),_output(0)

is the definition of a constructor for vertex class. After the column you get the constructor of the base class (in this case Processor) and then data members (output_). Then the curly brace you get the actual contructor function body

marom
  • 5,064
  • 10
  • 14
0

It is the beginning of the constructor initializer list.

rds504
  • 146
  • 6
0

:: is the Scope resolution operator, whereas : marks the beginning of a Member initializer list.

Pixelchemist
  • 24,090
  • 7
  • 47
  • 71