/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
RootInputFileList Class Reference

#include <RootInputFile.h>

Collaboration diagram for RootInputFileList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RootInputFileList ()
 ~RootInputFileList ()
int index ()
 The index of current file.
RootInputFilecurrent ()
 Access the current file.
bool next ()
 Advance one file.
bool prev ()
 Retard one file.
bool last ()
 Go to last file.
bool first ()
 Go to first file.
bool jump (int index)
 Go to the file at given index.
int entriesBefore (int index)
 Total number of entries of all files upto but not including file at given index.

Private Attributes

int m_index
Dyb::MsgStreamMember log

Detailed Description

Definition at line 99 of file RootInputFile.h.


Constructor & Destructor Documentation

RootInputFileList::RootInputFileList ( )

Definition at line 459 of file RootInputFile.cc.

    : std::vector<RootInputFile*>()
    , m_index(-1)
    , log("RootInputFileList")
{
}
RootInputFileList::~RootInputFileList ( )

Definition at line 466 of file RootInputFile.cc.

{
}

Member Function Documentation

int RootInputFileList::index ( )

The index of current file.

Definition at line 470 of file RootInputFile.cc.

{
    return m_index;
}
RootInputFile * RootInputFileList::current ( )

Access the current file.

Definition at line 475 of file RootInputFile.cc.

{
    if (m_index < 0 || m_index >= (int)size()) return 0;
    return (*this)[m_index];
}
bool RootInputFileList::next ( )

Advance one file.

Definition at line 481 of file RootInputFile.cc.

{
    if (m_index + 1 >= (int)size()) {
        log << MSG::WARNING << "next(): already at last file"
            << endreq;
        return false;
    }
    RootInputFile* rif = current();
    if (rif) rif->leave();
    ++m_index;
    rif = current();
    if (!rif) {
        log << MSG::ERROR
            << "next(): failed to make next file curren"
            << endreq;
        return false;
    }
    return true;
}
bool RootInputFileList::prev ( )

Retard one file.

Definition at line 517 of file RootInputFile.cc.

{
    if (m_index <= 0) {
        log << MSG::ERROR
            << "prev(): already at first file"
            << endreq;
        return false;
    }
    RootInputFile* rif = current();
    if (rif) rif->leave();
    --m_index;
    rif = current();
    if (!rif) {
        log << MSG::ERROR
            << "prev(): failed to make prev file curren"
            << endreq;
        return false;
    }
    return true;
}
bool RootInputFileList::last ( )

Go to last file.

Definition at line 501 of file RootInputFile.cc.

{
    if (m_index+1 == (int)size()) return true;
    RootInputFile* rif = current();
    if (rif) rif->leave();
    m_index = (int)size() - 1;
    rif = current();
    if (!rif) {
        log << MSG::ERROR
            << "last(): falied to make last file current"
            << endreq;
        return false;
    }
    return true;
}
bool RootInputFileList::first ( )

Go to first file.

Definition at line 540 of file RootInputFile.cc.

{
    if (!m_index) return true;
    RootInputFile* rif = current();
    if (rif) rif->leave();
    m_index = 0;
    rif = current();
    if (!rif) {
        log << MSG::ERROR
            << "first(): failed to make first file current"
            << endreq;
        return false;
    }
    return true;
}
bool RootInputFileList::jump ( int  index)

Go to the file at given index.

Definition at line 556 of file RootInputFile.cc.

{
    if (m_index == index) return true;
    RootInputFile* rif = current();
    if (rif) rif->leave();
    m_index = index;
    rif = current();
    if (!rif) {
        log << MSG::ERROR
            << "goto("<<index<<") failed"
            << endreq;
        return false;
    }
    return true;
}
int RootInputFileList::entriesBefore ( int  index)

Total number of entries of all files upto but not including file at given index.

Returns -1 on error

Definition at line 572 of file RootInputFile.cc.

{
    if (index < 0 || index >= (int)size()) return -1;
    // cound up entries up to but not including current index
    int totEntries = 0;
    for (int ind = 0; ind < index; ++ind) {
        int entries = (*this)[ind]->entries();
        if (entries < 0) return -1;
        totEntries += entries;
    }
    return totEntries;
}

Member Data Documentation

Definition at line 100 of file RootInputFile.h.

Definition at line 101 of file RootInputFile.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:58:18 for RootIOSvc by doxygen 1.7.4