DataBlock.h File Reference

#include <iostream>
#include "TObject.h"

Go to the source code of this file.

Classes

class  DataBlock

Namespaces

namespace  Anp
 

Handle class template - a simplified version of boost::intrusive_ptr.


Functions

std::ostream & operator<< (std::ostream &o, const DataBlock &self)
const DataBlock FindDataBlock (const std::string &path, const std::string &name="block")

Function Documentation

const DataBlock FindDataBlock ( const std::string &  path,
const std::string &  name = "block" 
)

Definition at line 148 of file DataBlock.cxx.

00149 {
00150    TFile *file_ptr = new TFile(path.c_str(), "READ");
00151    if(!file_ptr || !file_ptr -> IsOpen())
00152    {
00153       cerr << "Failed to open root file " << path << endl;
00154       return DataBlock();
00155    }
00156    
00157    DataBlock *block_ptr = dynamic_cast<DataBlock *>(file_ptr -> Get(name.c_str()));
00158    if(!block_ptr)
00159    {
00160       cout << "Failed to find DataBlock" << endl;
00161       return DataBlock();
00162    }
00163 
00164    const DataBlock block = *block_ptr;
00165 
00166    file_ptr -> Close();
00167    
00168    return block;
00169 }

std::ostream& operator<< ( std::ostream &  o,
const DataBlock self 
)

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1