#include <iostream>
#include <boost/program_options.hpp>
#include "TClass.h"
#include "TBufferFile.h"
#include "FWCore/FWLite/interface/FWLiteEnabler.h"
#include "FWCore/Utilities/interface/Exception.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 30 of file storageSize.cc.
References MessageLogger_cfi::cerr, className(), gather_cfg::cout, MillePedeFileConverter_cfg::e, FWLiteEnabler::enable(), relativeConstraints::error, cppFunctionSkipper::exception, cms::Exception::explainSelf(), kClassNameOpt, kHelpCommandOpt, kHelpOpt, AlcaSiPixelAliHarvester0T_cff::options, AlCaHLTBitMon_ParallelJobs::p, writedatasetfile::run, AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().
32 descString +=
" [options] [--";
36 "\n The program dumps information about how much storage space is needed to store the class" 38 boost::program_options::options_description desc(descString);
41 boost::program_options::positional_options_description
p;
44 boost::program_options::variables_map vm;
46 store(boost::program_options::command_line_parser(
argc,
argv).
options(desc).positional(p).
run(), vm);
49 std::cerr <<
"failed to parse command line \n" << iException.what() <<
"\n";
67 TClass* cls = TClass::GetClass(
className.c_str());
73 void* objInstance = cls->New();
74 if (
nullptr == objInstance) {
79 TBufferFile bf(TBuffer::kWrite);
82 cls->WriteBuffer(bf, objInstance);
85 std::cout <<
"Total amount stored: " << bf.Length() <<
" bytes" << std::endl;
86 std::cout <<
"\nNOTE: add 4 bytes for each 'has written' value because of a bug in ROOT's printout of the accounting" 87 <<
"\n Each class (inheriting or as member data) has metadata an overhead of 10 bytes" << std::endl;
static char const *const kHelpCommandOpt
virtual std::string explainSelf() const
static char const *const kClassNameOpt
static void enable()
enable automatic library loading
static char const *const kHelpOpt
std::string className(const T &t)
char const* const kClassNameOpt = "className" |
|
static |
char const* const kHelpCommandOpt = "help,h" |
|
static |
char const* const kHelpOpt = "help" |
|
static |