CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/Fireworks/Core/src/FWSimpleProxyHelper.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Core
00004 // Class  :     FWSimpleProxyHelper
00005 //
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Tue Dec  2 15:13:22 EST 2008
00011 // $Id: FWSimpleProxyHelper.cc,v 1.6 2012/09/21 09:26:26 eulisse Exp $
00012 //
00013 
00014 // system include files
00015 #include <sstream>
00016 #include <cassert>
00017 
00018 #include "FWCore/Utilities/interface/ObjectWithDict.h"
00019 #include "FWCore/Utilities/interface/TypeWithDict.h"
00020 #include "TClass.h"
00021 
00022 // user include files
00023 #include "Fireworks/Core/interface/FWSimpleProxyHelper.h"
00024 #include "Fireworks/Core/interface/FWEventItem.h"
00025 
00026 
00027 //
00028 // constants, enums and typedefs
00029 //
00030 
00031 //
00032 // static data member definitions
00033 //
00034 
00035 //
00036 // constructors and destructor
00037 //
00038 FWSimpleProxyHelper::FWSimpleProxyHelper(const std::type_info& iType) :
00039    m_itemType(&iType),
00040    m_objectOffset(0)
00041 {
00042 }
00043 
00044 // FWSimpleProxyHelper::FWSimpleProxyHelper(const FWSimpleProxyHelper& rhs)
00045 // {
00046 //    // do actual copying here;
00047 // }
00048 
00049 //FWSimpleProxyHelper::~FWSimpleProxyHelper()
00050 //{
00051 //}
00052 
00053 //
00054 // assignment operators
00055 //
00056 // const FWSimpleProxyHelper& FWSimpleProxyHelper::operator=(const FWSimpleProxyHelper& rhs)
00057 // {
00058 //   //An exception safe implementation is
00059 //   FWSimpleProxyHelper temp(rhs);
00060 //   swap(rhs);
00061 //
00062 //   return *this;
00063 // }
00064 
00065 //
00066 // member functions
00067 //
00068 void
00069 FWSimpleProxyHelper::itemChanged(const FWEventItem* iItem)
00070 {
00071    if(0!=iItem) {
00072       edm::TypeWithDict myType(*m_itemType);
00073       edm::ObjectWithDict dummy(edm::TypeWithDict(*(iItem->modelType()->GetTypeInfo())),
00074                    reinterpret_cast<void*>(0xFFFF));
00075       edm::ObjectWithDict castTo(dummy.castObject(myType));
00076       assert(0!=castTo.address());
00077       m_objectOffset=static_cast<char*>(dummy.address())-static_cast<char*>(castTo.address());
00078    }
00079 }
00080 
00081 //
00082 // static member functions
00083 //