CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/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.3 2010/08/18 10:30:14 amraktad Exp $
00012 //
00013 
00014 // system include files
00015 #include <sstream>
00016 
00017 #include "Reflex/Object.h"
00018 #include "Reflex/Type.h"
00019 #include "TClass.h"
00020 
00021 // user include files
00022 #include "Fireworks/Core/interface/FWSimpleProxyHelper.h"
00023 #include "Fireworks/Core/interface/FWEventItem.h"
00024 
00025 
00026 //
00027 // constants, enums and typedefs
00028 //
00029 
00030 //
00031 // static data member definitions
00032 //
00033 
00034 //
00035 // constructors and destructor
00036 //
00037 FWSimpleProxyHelper::FWSimpleProxyHelper(const std::type_info& iType) :
00038    m_itemType(&iType),
00039    m_objectOffset(0)
00040 {
00041 }
00042 
00043 // FWSimpleProxyHelper::FWSimpleProxyHelper(const FWSimpleProxyHelper& rhs)
00044 // {
00045 //    // do actual copying here;
00046 // }
00047 
00048 //FWSimpleProxyHelper::~FWSimpleProxyHelper()
00049 //{
00050 //}
00051 
00052 //
00053 // assignment operators
00054 //
00055 // const FWSimpleProxyHelper& FWSimpleProxyHelper::operator=(const FWSimpleProxyHelper& rhs)
00056 // {
00057 //   //An exception safe implementation is
00058 //   FWSimpleProxyHelper temp(rhs);
00059 //   swap(rhs);
00060 //
00061 //   return *this;
00062 // }
00063 
00064 //
00065 // member functions
00066 //
00067 void
00068 FWSimpleProxyHelper::itemChanged(const FWEventItem* iItem)
00069 {
00070    if(0!=iItem) {
00071       using namespace ROOT::Reflex;
00072       Type myType = Type::ByTypeInfo(*m_itemType);
00073       Object dummy(Type::ByTypeInfo(*(iItem->modelType()->GetTypeInfo())),
00074                    reinterpret_cast<void*>(0xFFFF));
00075       Object 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 //