CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: FWSimpleProxyHelper.cc,v 1.4 2012/06/26 22:09:35 wmtan Exp $
12 //
13 
14 // system include files
15 #include <sstream>
16 
17 #include "Reflex/Object.h"
18 #include "Reflex/Type.h"
19 #include "TClass.h"
20 
21 // user include files
24 
25 
26 //
27 // constants, enums and typedefs
28 //
29 
30 //
31 // static data member definitions
32 //
33 
34 //
35 // constructors and destructor
36 //
37 FWSimpleProxyHelper::FWSimpleProxyHelper(const std::type_info& iType) :
38  m_itemType(&iType),
39  m_objectOffset(0)
40 {
41 }
42 
43 // FWSimpleProxyHelper::FWSimpleProxyHelper(const FWSimpleProxyHelper& rhs)
44 // {
45 // // do actual copying here;
46 // }
47 
48 //FWSimpleProxyHelper::~FWSimpleProxyHelper()
49 //{
50 //}
51 
52 //
53 // assignment operators
54 //
55 // const FWSimpleProxyHelper& FWSimpleProxyHelper::operator=(const FWSimpleProxyHelper& rhs)
56 // {
57 // //An exception safe implementation is
58 // FWSimpleProxyHelper temp(rhs);
59 // swap(rhs);
60 //
61 // return *this;
62 // }
63 
64 //
65 // member functions
66 //
67 void
69 {
70  if(0!=iItem) {
71  Reflex::Type myType = Reflex::Type::ByTypeInfo(*m_itemType);
72  Reflex::Object dummy(Reflex::Type::ByTypeInfo(*(iItem->modelType()->GetTypeInfo())),
73  reinterpret_cast<void*>(0xFFFF));
74  Reflex::Object castTo = dummy.CastObject(myType);
75  assert(0!=castTo.Address());
76  m_objectOffset=static_cast<char*>(dummy.Address())-static_cast<char*>(castTo.Address());
77  }
78 }
79 
80 //
81 // static member functions
82 //
FWSimpleProxyHelper(const std::type_info &)
const TClass * modelType() const
Definition: FWEventItem.cc:561
const std::type_info * m_itemType
void itemChanged(const FWEventItem *)