Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
Streamer
src
StreamedProducts.cc
Go to the documentation of this file.
1
#include "
DataFormats/Streamer/interface/StreamedProducts.h
"
2
#include "
FWCore/Utilities/interface/EDMException.h
"
3
#include "
FWCore/Utilities/interface/WrappedClassName.h
"
4
5
namespace
edm {
6
StreamedProduct::StreamedProduct
(
void
const
*
prod
,
7
BranchDescription
const
& desc,
8
bool
present,
9
std::vector<BranchID>
const
*
parents
) :
10
desc_(&desc), present_(present), parents_(parents), prod_(const_cast<void*>(prod)), classRef_() {
11
if
(
present_
&& prod == 0) {
12
desc.
init
();
13
throw
edm::Exception
(
edm::errors::LogicError
,
"StreamedProduct::StreamedProduct\n"
)
14
<<
"A product with a status of 'present' is not actually present.\n"
15
<<
"The branch name is "
<< desc.
branchName
() <<
"\n"
16
<<
"Contact a framework developer.\n"
;
17
}
18
}
19
20
void
21
StreamedProduct::allocateForReading
() {
22
setNewClassType
();
23
prod_
=
classRef_
->New();
24
}
25
26
void
27
StreamedProduct::setNewClassType
() {
28
classRef_
.SetName(
wrappedClassName
(
desc_
->
fullClassName
()).c_str());
29
}
30
31
void
32
StreamedProduct::clearClassType
() {
33
if
(
prod_
!= 0) {
34
classRef_
->Destructor(
prod_
);
35
prod_
= 0;
36
}
37
}
38
}
39
edm::BranchDescription::init
void init() const
Definition:
BranchDescription.h:58
edm::StreamedProduct::prod_
void * prod_
Definition:
StreamedProducts.h:66
parents
TPRegexp parents
Definition:
eve_filter.cc:24
edm::StreamedProduct::present_
bool present_
Definition:
StreamedProducts.h:64
edm::StreamedProduct::classRef_
TClassRef classRef_
Definition:
StreamedProducts.h:67
edm::BranchDescription::branchName
std::string & branchName() const
Definition:
BranchDescription.h:101
edm::StreamedProduct::setNewClassType
void setNewClassType()
Definition:
StreamedProducts.cc:27
WrappedClassName.h
edm::StreamedProduct::desc_
BranchDescription const * desc_
Definition:
StreamedProducts.h:63
EDMException.h
edm::BranchDescription::fullClassName
std::string const & fullClassName() const
Definition:
BranchDescription.h:74
edm::hlt::Exception
error
Definition:
HLTenums.h:24
edm::BranchDescription
Definition:
BranchDescription.h:35
edm::wrappedClassName
std::string wrappedClassName(std::string const &iFullName)
Definition:
WrappedClassName.cc:5
StreamedProducts.h
edm::StreamedProduct::clearClassType
void clearClassType()
Definition:
StreamedProducts.cc:32
edm::StreamedProduct::StreamedProduct
StreamedProduct()
Definition:
StreamedProducts.h:34
edm::StreamedProduct::allocateForReading
void allocateForReading()
Definition:
StreamedProducts.cc:21
parseEventContent.prod
dictionary prod
Definition:
parseEventContent.py:153
edm::errors::LogicError
Definition:
EDMException.h:41
Generated for CMSSW Reference Manual by
1.8.5