BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkExtInterface.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkExtInterface.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6//
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author(s): Steve Schaffner
12//
13//------------------------------------------------------------------------
14
15// #include "BaBar/BaBar.h"
16#include "TrkBase/TrkExtInterface.h"
17#include "ProxyDict/IfdIntKey.h"
18#include "TrkBase/TrkRep.h"
19// #include "ErrLogger/ErrLog.h"
20
21//------------------------------------------------------------------------
22TrkExtInterface::TrkExtInterface() : _myRep( 0 ), _nonconst( false ) {
23 //------------------------------------------------------------------------
24}
25
26//------------------------------------------------------------------------
28 //------------------------------------------------------------------------
29}
30
31//------------------------------------------------------------------------
33 //------------------------------------------------------------------------
34 bool retval( false );
35 if ( myKey() == newRep->myKey() )
36 {
37 setRep( newRep );
38 retval = true;
39 }
40 return retval;
41}
42
43//------------------------------------------------------------------------
44bool TrkExtInterface::attach( const TrkRep* newRep ) {
45 //------------------------------------------------------------------------
46 bool retval( false );
47 if ( myKey() == newRep->myKey() )
48 {
49 setRep( newRep );
50 retval = true;
51 }
52 return retval;
53}
54
55void TrkExtInterface::setRep( const TrkRep* newRep ) {
56 _myRep = (TrkRep*)newRep;
57 _nonconst = false;
58}
59
61 _myRep = newRep;
62 _nonconst = true;
63}
64
65//------------------------------------------------------------------------
67 //------------------------------------------------------------------------
68 if ( _myRep != 0 && _nonconst ) return _myRep;
69 else if ( 0 == _myRep )
70 {
71 std::cout << "ErrMsg(error) "
72 << "Cannot use interface without attached rep." << std::endl;
73 return 0;
74 }
75 else
76 std::cout << "ErrMsg(error) "
77 << "Cannot return non-const rep after const attachment" << std::endl;
78 return 0;
79}
80
81//------------------------------------------------------------------------
83 //------------------------------------------------------------------------
84 if ( 0 == _myRep )
85 {
86 std::cout << "ErrMsg(error) "
87 << "Cannot use interface without attached rep." << std::endl;
88 return 0;
89 }
90 return _myRep;
91}
const TrkRep * myConstRep() const
virtual ~TrkExtInterface()
virtual bool attach(TrkRep *)
void setRep(const TrkRep *)
virtual const IfdKey & myKey() const =0
virtual const IfdKey & myKey() const
Definition TrkRep.cxx:251