#include <NTupleController.h>
Collaboration diagram for NTupleController:
It frequently implements the application logic which should neither be in the GUI nor in the NTuple objects.
Definition at line 40 of file NTupleController.h.
Public Member Functions | |
void | changeName (DataSource *source, const std::string &newname) |
Changes the name of the DataSource object. | |
CircularBuffer * | createCircularBuffer () |
Creates and registers an empty CircularBuffer. | |
CircularBuffer * | createCircularBuffer (unsigned int columns) |
Creates and registers an empty CircularBuffer. | |
CircularBuffer * | createCircularBuffer (const std::vector< std::string > &labels) |
Creates and registers an empty CircularBuffer. | |
NTuple * | createNTuple () |
Creates and registers an empty NTuple. | |
NTuple * | createNTuple (unsigned int columns) |
Creates and registers an empty NTuple. | |
NTuple * | createNTuple (const std::vector< std::string > &labels) |
Creates and registers an empty NTuple. | |
DataSource * | createNTuple (const std::string &filename) |
Creates and registers an NTuple from data in file filename. | |
DataSource * | findDataSource (const std::string &name) const |
Returns the DataSource object with name name. | |
void | registerNTuple (const std::string &, DataSource *ntuple) |
Register a NTuple. | |
std::string | registerNTuple (DataSource *nt) |
Register a NTuple. | |
void | saveNTuples (const std::string &prefix, const std::string &suffix) |
Saves all the NTuple. | |
int | writeNTupleToFile (const std::string &name, const std::string &filename) |
Writes the NTuple named name to the file filename. | |
int | writeNTupleToFile (DataSource *source, const std::string &filename) |
Writes the DataSource source to a file given by filename. | |
Static Public Member Functions | |
static NTupleController * | instance () |
Returns the pointer to the singleton instance. | |
Private Member Functions | |
std::string::size_type | findWhite (const std::string &line, unsigned int left=0, bool tabs_only=false) |
Find and return position of white space. | |
NTupleController (const NTupleController &) | |
A private copy constructor in order to avoid copying. | |
NTupleController () | |
A default constructor for avoiding creation except by itself. | |
int | readAsciiNTuple (NTuple *ntuple, const std::string &filename) |
Reads ASCII formatted file and fills the ntuple. | |
Static Private Attributes | |
static NTupleController * | s_instance = 0 |
The pointer to the singleton object. |
|
A default constructor for avoiding creation except by itself.
Definition at line 48 of file NTupleController.cxx. Referenced by instance(). |
|
A private copy constructor in order to avoid copying. Only needed for SIP interface and should never be called. Definition at line 54 of file NTupleController.cxx. |
|
Changes the name of the DataSource object. This method is deprecated. There's no need to call this member function. Definition at line 307 of file NTupleController.cxx. Referenced by hippodraw::Python::export_NTupleController(), and saveNTuples(). |
|
Creates and registers an empty CircularBuffer. Creates an empty CircularBuffer with no columns or rows.
Definition at line 287 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). Referenced by hippodraw::Python::export_NTupleController(). |
|
Creates and registers an empty CircularBuffer. Creates an empty CircularBuffer with columns columns.
Definition at line 265 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). |
|
Creates and registers an empty CircularBuffer. Creates an empty CircularBuffer with the number of columns equal to the length of the vector labels. The labels for the columns is taken from the elements of the vector labels. Definition at line 243 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). |
|
Creates and registers an empty NTuple. Creates an empty NTuple with no columns or rows. Definition at line 276 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). Referenced by hippodraw::Python::export_NTupleController(). |
|
Creates and registers an empty NTuple. Creates an empty NTuple with columns columns.
Definition at line 254 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). |
|
Creates and registers an empty NTuple. Creates an empty NTuple with the number of columns equal to the length of the vector labels. The labels for the columns is taken from the elements of the vector labels.
Definition at line 232 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). |
|
Creates and registers an NTuple from data in file filename. If file has already been opened, return pointer to the existing NTuple. Otherwise attempts to read the file as NTuple and if successful returns a pointer to the created NTuple object. If file was not found, or could not be parsed, then throws a DataSourceException with an explanation.
Definition at line 194 of file NTupleController.cxx. References DataSourceController::instance(), readAsciiNTuple(), registerNTuple(), and DataSource::setName(). Referenced by HiNTupleXML::getObject(), and main(). |
|
Returns the DataSource object with name name.
Definition at line 298 of file NTupleController.cxx. References DataSourceController::instance(). Referenced by hippodraw::Python::export_NTupleController(), and writeNTupleToFile(). |
|
Find and return position of white space.
The argument left is the starting position. If tabs_only is Definition at line 69 of file NTupleController.cxx. Referenced by readAsciiNTuple(). |
|
Returns the pointer to the singleton instance.
Definition at line 59 of file NTupleController.cxx. References NTupleController(), and s_instance. Referenced by hippodraw::Python::export_NTupleController(), CanvasView::exportTextTuple(), HiNTupleXML::getObject(), main(), QtFileDialog::openTextTuple(), CanvasWindow::saveAllAs(), and saveNTuples(). |
|
Reads ASCII formatted file and fills the ntuple.
Returns Definition at line 101 of file NTupleController.cxx. References NTuple::addRow(), findWhite(), NTuple::setLabels(), DataSource::setTitle(), num_util::shape(), and num_util::size(). Referenced by createNTuple(). |
|
Register a NTuple.
Definition at line 418 of file NTupleController.cxx. References DataSourceController::instance(), and registerNTuple(). |
|
Register a NTuple.
Definition at line 408 of file NTupleController.cxx. References DataSourceController::instance(). Referenced by createCircularBuffer(), createNTuple(), hippodraw::Python::export_NTupleController(), and registerNTuple(). |
|
Saves all the NTuple. Saves all the NTuple objects of the application with the file name prefixed by prefix followed by index number and a suffix suffix. After the file is saved, the the file name part of prefix is used to set the NTuple name. Definition at line 372 of file NTupleController.cxx. References changeName(), DataSourceController::getDataSources(), DataSource::getName(), instance(), DataSourceController::instance(), num_util::size(), and writeNTupleToFile(). |
|
Writes the NTuple named name to the file filename.
Returns Definition at line 314 of file NTupleController.cxx. References findDataSource(), DataSourceController::instance(), and writeNTupleToFile(). |
|
Writes the DataSource source to a file given by filename.
Returns Definition at line 328 of file NTupleController.cxx. References DataSource::getLabels(), DataSource::getRow(), DataSource::rows(), and DataSource::title(). Referenced by hippodraw::Python::export_NTupleController(), CanvasView::exportTextTuple(), saveNTuples(), and writeNTupleToFile(). |
|
The pointer to the singleton object.
Definition at line 46 of file NTupleController.cxx. Referenced by instance(). |