CMS 3D CMS Logo

FWItemSingleAccessor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWItemSingleAccessor
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Sat Oct 18 11:36:44 EDT 2008
11 //
12 
13 // system include files
14 #include <cassert>
17 
18 // user include files
20 
21 
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
34  m_type(iClass), m_data(nullptr)
35 {
36 }
37 
38 // FWItemSingleAccessor::FWItemSingleAccessor(const FWItemSingleAccessor& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
44 {
45 }
46 
47 //
48 // assignment operators
49 //
50 // const FWItemSingleAccessor& FWItemSingleAccessor::operator=(const FWItemSingleAccessor& rhs)
51 // {
52 // //An exception safe implementation is
53 // FWItemSingleAccessor temp(rhs);
54 // swap(rhs);
55 //
56 // return *this;
57 // }
58 
59 //
60 // member functions
61 //
62 void
64 {
65  if (product.address() == nullptr)
66  {
67  reset();
68  return;
69  }
70 
71  m_data = product.address();
72  assert(nullptr!=m_data);
73 }
74 
75 void
77 {
78  m_data = nullptr;
79 }
80 
81 //
82 // const member functions
83 //
84 const void*
86 {
87  if(0==iIndex) {
88  return m_data;
89  }
90  return nullptr;
91 }
92 
93 const void*
95 {
96  return m_data;
97 }
98 
99 unsigned int
101 {
102  return nullptr == m_data ? 0 : 1;
103 }
104 
105 const TClass*
107 {
108  return m_type;
109 }
110 
111 const TClass*
113 {
114  return m_type;
115 }
116 
117 bool
119 {
120  return false;
121 }
122 
123 //
124 // static member functions
125 //
void * address() const
#define nullptr
const TClass * type() const override
void setData(const edm::ObjectWithDict &) override
override if id of an object should be different than the index
unsigned int size() const override
const void * modelData(int iIndex) const override
bool isCollection() const override
const void * data() const override
FWItemSingleAccessor(const TClass *)
const TClass * modelType() const override