StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtNamed.cc
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Laurent Conin, Fabrice Retiere, Subatech, France
6  ****************************************************************************
7  * Description: implementation of StHbtNamed
8  *
9  ***************************************************************************/
10 
11 #include <stdlib.h>
12 #include <string.h>
13 #include "StHbtMaker/Infrastructure/StHbtNamed.hh"
14 
15 #ifdef __ROOT2__
16  ClassImp(StHbtNamed)
17 #endif
18 
19 StHbtNamed::StHbtNamed() : mName(new char[1]) {mName[0]=0;};
20 
21 StHbtNamed::StHbtNamed(const char * aName) {
22  SetName(aName);
23 };
24 
25 StHbtNamed::StHbtNamed(const StHbtNamed& aNamed) { SetName(aNamed.GetName()); }
26 
27 void StHbtNamed::SetName(const char * aName) {
28  if (mName) delete[] mName;
29  if (aName) {
30  mName=new char[strlen(aName)+1];
31  strcpy(mName,aName);
32  } else {
33  mName=new char[1];
34  mName[0]=0;
35  };
36 };