CMS 3D CMS Logo

FWSimpleProxyHelper.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWSimpleProxyHelper
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Tue Dec 2 15:13:22 EST 2008
11 //
12 
13 // system include files
14 #include <sstream>
15 #include <cassert>
16 
19 #include "TClass.h"
20 
21 // user include files
24 
25 //
26 // constants, enums and typedefs
27 //
28 
29 //
30 // static data member definitions
31 //
32 
33 //
34 // constructors and destructor
35 //
36 FWSimpleProxyHelper::FWSimpleProxyHelper(const std::type_info& iType) : m_itemType(&iType), m_objectOffset(0) {}
37 
38 // FWSimpleProxyHelper::FWSimpleProxyHelper(const FWSimpleProxyHelper& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
43 //FWSimpleProxyHelper::~FWSimpleProxyHelper()
44 //{
45 //}
46 
47 //
48 // assignment operators
49 //
50 // const FWSimpleProxyHelper& FWSimpleProxyHelper::operator=(const FWSimpleProxyHelper& rhs)
51 // {
52 // //An exception safe implementation is
53 // FWSimpleProxyHelper temp(rhs);
54 // swap(rhs);
55 //
56 // return *this;
57 // }
58 
59 //
60 // member functions
61 //
63  if (nullptr != iItem) {
64  edm::TypeWithDict baseType(*m_itemType);
65  edm::TypeWithDict mostDerivedType(*(iItem->modelType()->GetTypeInfo()));
66  // The - sign is there because this is the address of a derived object minus the address of the base object.
67  m_objectOffset = -mostDerivedType.getBaseClassOffset(baseType);
68  }
69 }
70 
71 //
72 // static member functions
73 //
const TClass * modelType() const
Definition: FWEventItem.cc:464
FWSimpleProxyHelper(const std::type_info &)
int getBaseClassOffset(TypeWithDict const &baseClass) const
const std::type_info * m_itemType
void itemChanged(const FWEventItem *)