CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkExtInterface Class Referenceabstract

#include <TrkExtInterface.h>

+ Inheritance diagram for TrkExtInterface:

Public Member Functions

 TrkExtInterface ()
 
virtual ~TrkExtInterface ()
 
virtual bool attach (TrkRep *)
 
virtual bool attach (const TrkRep *)
 
bool isAttached () const
 
bool nonConstAttachment () const
 

Protected Member Functions

TrkRepmyRep ()
 
const TrkRepmyConstRep () const
 
virtual const IfdKeymyKey () const =0
 
void setRep (const TrkRep *)
 
void setRep (TrkRep *)
 

Detailed Description

Definition at line 28 of file TrkExtInterface.h.

Constructor & Destructor Documentation

◆ TrkExtInterface()

TrkExtInterface::TrkExtInterface ( )

Definition at line 22 of file TrkExtInterface.cxx.

22 : _myRep(0), _nonconst(false){
23//------------------------------------------------------------------------
24}

◆ ~TrkExtInterface()

TrkExtInterface::~TrkExtInterface ( )
virtual

Definition at line 27 of file TrkExtInterface.cxx.

27 {
28//------------------------------------------------------------------------
29}

Member Function Documentation

◆ attach() [1/2]

bool TrkExtInterface::attach ( const TrkRep * newRep)
virtual

Definition at line 46 of file TrkExtInterface.cxx.

46 {
47//------------------------------------------------------------------------
48 bool retval(false);
49 if (myKey() == newRep->myKey()) {
50 setRep(newRep);
51 retval = true;
52 }
53 return retval;
54}
void setRep(const TrkRep *)
virtual const IfdKey & myKey() const =0
virtual const IfdKey & myKey() const
Definition TrkRep.cxx:314

◆ attach() [2/2]

bool TrkExtInterface::attach ( TrkRep * newRep)
virtual

Definition at line 34 of file TrkExtInterface.cxx.

34 {
35//------------------------------------------------------------------------
36 bool retval(false);
37 if (myKey() == newRep->myKey()) {
38 setRep(newRep);
39 retval = true;
40 }
41 return retval;
42}

Referenced by TrkRecoTrk::attach(), and TrkRecoTrk::attach().

◆ isAttached()

bool TrkExtInterface::isAttached ( ) const
inline

Definition at line 35 of file TrkExtInterface.h.

35{return _myRep != 0;}

◆ myConstRep()

const TrkRep * TrkExtInterface::myConstRep ( ) const
protected

Definition at line 86 of file TrkExtInterface.cxx.

86 {
87//------------------------------------------------------------------------
88 if (0 == _myRep) {
89 std::cout<<"ErrMsg(error) "<< "Cannot use interface without attached rep."
90 << std::endl;
91 return 0;
92 }
93 return _myRep;
94}

◆ myKey()

virtual const IfdKey & TrkExtInterface::myKey ( ) const
protectedpure virtual

Implemented in TrkDeadInterface.

Referenced by attach(), and attach().

◆ myRep()

TrkRep * TrkExtInterface::myRep ( )
protected

Definition at line 70 of file TrkExtInterface.cxx.

70 {
71//------------------------------------------------------------------------
72 if(_myRep != 0 && _nonconst)
73 return _myRep;
74 else if (0 == _myRep) {
75 std::cout<<"ErrMsg(error) "<< "Cannot use interface without attached rep."
76 << std::endl;
77 return 0;
78 } else
79 std::cout<<"ErrMsg(error) "<< "Cannot return non-const rep after const attachment"
80 << std::endl;
81 return 0;
82}

◆ nonConstAttachment()

bool TrkExtInterface::nonConstAttachment ( ) const
inline

Definition at line 36 of file TrkExtInterface.h.

36{ return _nonconst; }

◆ setRep() [1/2]

void TrkExtInterface::setRep ( const TrkRep * newRep)
protected

Definition at line 57 of file TrkExtInterface.cxx.

57 {
58 _myRep = (TrkRep*) newRep;
59 _nonconst = false;
60}

Referenced by attach(), and attach().

◆ setRep() [2/2]

void TrkExtInterface::setRep ( TrkRep * newRep)
protected

Definition at line 63 of file TrkExtInterface.cxx.

63 {
64 _myRep = newRep;
65 _nonconst = true;
66}

The documentation for this class was generated from the following files: