LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LCRelationImpl.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef EVENT_LCWGTRELATIONIMPL_H
3 #define EVENT_LCWGTRELATIONIMPL_H 1
4 
5 #include <vector>
6 #include <map>
7 
8 #include "EVENT/LCRelation.h"
9 #include "EVENT/LCObject.h"
10 #include "AccessChecked.h"
11 
12 
13 
14 namespace IMPL {
15 
22 
23  public:
24 
25  LCRelationImpl() : _from(0) , _to(0) , _weight(1.0f) { }
26  LCRelationImpl( EVENT::LCObject* from, EVENT::LCObject* to , float weight=1.0f ) : _from(from),
27  _to(to),
28  _weight(weight) {}
30  LCRelationImpl(const LCRelationImpl&) = default ;
31 
33  LCRelationImpl& operator=(const LCRelationImpl&) = default ;
34 
36 
37  int id() const { return simpleUID() ; }
38 
39  EVENT::LCObject * getFrom() const { return _from ; }
40  EVENT::LCObject * getTo() const { return _to ; }
41  float getWeight() const { return _weight ; }
42 
43  void setFrom( EVENT::LCObject* from ) { _from = from ; }
44  void setTo( EVENT::LCObject* to ) { _to = to ; }
45  void setWeight( float weight ) { _weight = weight ; }
46 
47 
48  protected:
51  float _weight ;
52 
53 }; // class
54 } // namespace IMPL
55 #endif /* ifndef EVENT_LCRELATIONIMPL_H */
The generic object that is held in an LCCollection.
Definition: LCObject.h:30
Implementation of the LCRelation.
EVENT::LCObject * getTo() const
The &#39;to&#39; object of the given relation.
EVENT::LCObject * getFrom() const
The &#39;from&#39; object of the given relation.
LCRelationImpl(EVENT::LCObject *from, EVENT::LCObject *to, float weight=1.0f)
float getWeight() const
The weight of the given relation - only if collection flag bit LCIO::LCREL_WEIGHTED is set...
void setFrom(EVENT::LCObject *from)
EVENT::LCObject * _to
int id() const
Returns an object id for internal (debugging) use in LCIO.
A single weighted relationship between two LCObjects.
Definition: LCRelation.h:29
virtual int simpleUID() const
Definition: AccessChecked.h:26
void setTo(EVENT::LCObject *to)
LCRelationImpl & operator=(const LCRelationImpl &)=default
default assignment operator - use with care
Controls access to objects.
Definition: AccessChecked.h:18
EVENT::LCObject * _from
void setWeight(float weight)