含义:代码中的运算符

时间:2015-05-28 09:32:02

标签: c++ function class c++11

我正在尝试了解Linear Collider I / O项目的一些代码。 我是C ++新手,我无法理解下面的代码中我在下面复制的内容。

vertex :: vertex():Processor(“vertex”),_ output(0)

什么是:在上面的代码行中是什么意思? 感谢所有人提前!

代码写在下面

#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

}

3 个答案:

答案 0 :(得分:2)

以下代码

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

是顶点类的构造函数的定义。在列之后,您将获得基类的构造函数(在本例中为Processor),然后是数据成员(output_)。然后大括号你得到实际的构造函数体

答案 1 :(得分:0)

这是constructor initializer list

的开头

答案 2 :(得分:0)

::Scope resolution operator,而:标志着Member initializer list的开头。

相关问题