ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DefaultHepRepInstance.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DefaultHepRepInstance.cc
1 // Copyright FreeHEP, 2005.
2 
3 #include <iostream>
4 
6 
7 using namespace std;
8 using namespace HEPREP;
9 
13 namespace cheprep {
14 
15 DefaultHepRepInstance::DefaultHepRepInstance(HepRepInstance* instance, HepRepType* heprepType)
16  : DefaultHepRepAttribute(), parent(instance), type(heprepType) {
17 
18  if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
19  parent->addInstance(this);
20 }
21 
23  : DefaultHepRepAttribute(), parent(NULL), type(heprepType) {
24 
25  if (type == NULL) cerr << "HepRepInstance cannot be created without a HepRepType." << endl;
26  instanceTree->addInstance(this);
27 }
28 
30  parent = NULL;
31  type = NULL;
32  for (vector<HepRepInstance*>::iterator i1 = instances.begin(); i1 != instances.end(); i1++) {
33  delete (*i1);
34  }
35  for (vector<HepRepPoint*>::iterator i2 = points.begin(); i2 != points.end(); i2++) {
36  delete (*i2);
37  }
38 }
39 
41  cerr << "DefaultHepRepInstance::overlay(HepRepInstance * instance) not implemented." << endl;
42 }
43 
45  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstance*, HepRepSelectFilter*) not implemented." << endl;
46  return NULL;
47 }
48 
50  cerr << "DefaultHepRepInstance::copy(HepRepTypeTree*, HepRepInstanceTree*, HepRepSelectFilter*) not implemented." << endl;
51  return NULL;
52 }
53 
55  return type;
56 }
57 
59  points.push_back(point);
60 }
61 
62 vector<HepRepPoint*> DefaultHepRepInstance::getPoints() {
63  return points;
64 }
65 
67  return parent;
68 }
69 
71  instances.push_back(instance);
72 }
73 
75  cerr << "DefaultHepRepInstance::removeInstance(HepRepInstance*) not implemented." << endl;
76 }
77 
78 vector<HepRepInstance*> DefaultHepRepInstance::getInstances() {
79  return instances;
80 }
81 
84  return (value != NULL) ? value : type->getAttValue(name);
85 }
86 
87 } // cheprep