#include <iostream>
#include <boost/program_options.hpp>
#include "TClass.h"
#include "TBufferFile.h"
#include "FWCore/FWLite/interface/AutoLibraryLoader.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 33 of file storageSize.cc.
References dtNoiseDBValidation_cfg::cerr, className(), gather_cfg::cout, AutoLibraryLoader::enable(), relativeConstraints::error, kClassNameOpt, kHelpCommandOpt, kHelpOpt, AlCaHLTBitMon_ParallelJobs::options, AlCaHLTBitMon_ParallelJobs::p, DTTTrigCorrFirst::run, and AlCaHLTBitMon_QueryRunRegistry::string.
36 descString +=
" [options] [--";
38 descString +=
"] class_name"
39 "\n The program dumps information about how much storage space is needed to store the class"
41 boost::program_options::options_description desc(descString);
46 boost::program_options::positional_options_description
p;
49 boost::program_options::variables_map vm;
51 store(boost::program_options::command_line_parser(
argc,
argv).
options(desc).positional(p).
run(),vm);
54 std::cerr <<
"failed to parse command line \n"<<iException.what()<<
"\n";
72 TClass* cls = TClass::GetClass(
className.c_str());
78 void* objInstance = cls->New();
84 TBufferFile bf(TBuffer::kWrite);
87 cls->WriteBuffer(bf, objInstance);
90 std::cout <<
"Total amount stored: "<<bf.Length()<<
" bytes"<<std::endl;
91 std::cout<<
"\nNOTE: add 4 bytes for each 'has written' value because of a bug in ROOT's printout of the accounting"
92 <<
"\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 char const *const kHelpOpt
static void enable()
enable automatic library loading
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 |
char const* const kProgramName = "edmClassStorageSize" |
|
static |