ATLAS Offline Software
LinkObj.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "LinkObj.h"
6 #include "Tutorial_ClassDEF.h"
7 
8 using namespace SGTutorial;
9 using std::vector;
10 
11 //sample data class for the Link example
12 
13  // Set links to an object
15 {
16  // Link to a data object
17  // set it to refer to its target
18 }
19  // Set links to an element of a collection
20 void LinkObj::setContLink(vector<MyElement>&, //coll
21  const MyElement&) //cobj
22 {
23  // Link to an element of a collection
24  // set it to refer to its target
25 
26  // Here we pass the element to the DataLink and it figures out the
27  // index... which locates the element in the collection.
28 }
29 
30 void LinkObj::setContLink(vector<MyElement>&, //coll
31  int) //index
32 {
33  // Link to an element of a collection
34  // set it to refer to its target
35 
36  // Faster method: we pass the index directly
37 
38 }
39  // Access linked object/collection
41 {
42  static const MyDataObj replaceMe;
43  return replaceMe;
44 }
45 
47 {
48  static const MyElement replaceMe;
49  return replaceMe;
50 
51 }
52 
Tutorial_ClassDEF.h
SGTutorial::MyElement
Definition: MyElement.h:13
SGTutorial::LinkObj::setContLink
void setContLink(std::vector< MyElement > &, const MyElement &)
Definition: LinkObj.cxx:20
SGTutorial::LinkObj::myLinkedElement
const MyElement & myLinkedElement()
Definition: LinkObj.cxx:46
SGTutorial::MyDataObj
Definition: Tutorial/MyDataObj.h:13
SGTutorial::LinkObj::setObjLink
void setObjLink(MyDataObj &)
Definition: LinkObj.cxx:14
SGTutorial
Definition: LinkObj.h:18
SGTutorial::LinkObj::myLinkedObj
const MyDataObj & myLinkedObj()
Definition: LinkObj.cxx:40
LinkObj.h