PyNTupleController Class Reference

#include <PyNTupleController.h>

Collaboration diagram for PyNTupleController:

Collaboration graph
NTupleController
[legend]
List of all members.

Detailed Description

A wrapper for NTupleController for use from Python.

Note:
This wrapper was used instead of the export_ pattern so that this class could generate the PyDataSource object without have circular dependency between sub-directories.
Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 35 of file PyNTupleController.h.

Public Member Functions

void changeName (DataSource *source, const std::string &new_name)
 Changes the name of the DataSource.
CircularBuffercreateCircularBuffer (unsigned int n)
 Creates an empty CircularBuffer object with n columns.
PyDataSourcecreateDataArray (const std::string &filename)
 Creates a DataArray Python object from the file filename.
DataSourcecreateNTuple (const std::string &filename)
 Creates a NTuple object from file filename.
NTuplecreateNTuple ()
 Creates an empty NTuple object.
DataSourcefindDataSource (const std::string &name) const
 Finds the DataSource by name.
void registerNTuple (const std::string &name, DataSource *source)
 Registers the DataSource object as name.
std::string registerNTuple (DataSource *source)
 Registers the DataSource object and returns its assigned name.
int writeNTupleToFile (DataSource *source, const std::string &filename)
 Writes the DataSource to the file filename.

Static Public Member Functions

static PyNTupleControllerinstance ()
 The singleton instance method.

Private Member Functions

 PyNTupleController (const PyNTupleController &)
 The copy constructor, protected from being used.
 PyNTupleController ()
 The default constructor, protected from being used.

Static Private Attributes

static NTupleControllerm_instance = 0
 The singleton NTupleController object.
static PyNTupleControllers_instance = 0
 The singleton PyNTupleController instance.


Constructor & Destructor Documentation

PyNTupleController (  )  [private]

The default constructor, protected from being used.

Definition at line 44 of file PyNTupleController.cxx.

Referenced by PyNTupleController::instance().

PyNTupleController ( const PyNTupleController  )  [private]

The copy constructor, protected from being used.


Member Function Documentation

void changeName ( DataSource source,
const std::string &  new_name 
)

Changes the name of the DataSource.

Definition at line 156 of file PyNTupleController.cxx.

Referenced by hippodraw::Python::export_NTupleController().

CircularBuffer * createCircularBuffer ( unsigned int  n  ) 

Creates an empty CircularBuffer object with n columns.

Definition at line 94 of file PyNTupleController.cxx.

References PyNTupleController::m_instance.

Referenced by hippodraw::Python::export_NTupleController().

PyDataSource * createDataArray ( const std::string &  filename  ) 

Creates a DataArray Python object from the file filename.

Definition at line 101 of file PyNTupleController.cxx.

References PyNTupleController::createNTuple().

Referenced by hippodraw::Python::export_NTupleController().

DataSource * createNTuple ( const std::string &  filename  ) 

Creates a NTuple object from file filename.

Definition at line 73 of file PyNTupleController.cxx.

References PyApp::lock(), PyNTupleController::m_instance, and PyApp::unlock().

NTuple * createNTuple (  ) 

Creates an empty NTuple object.

Definition at line 62 of file PyNTupleController.cxx.

References DataSourceController::instance(), and PyNTupleController::registerNTuple().

Referenced by PyNTupleController::createDataArray(), and hippodraw::Python::export_NTupleController().

DataSource * findDataSource ( const std::string &  name  )  const

Finds the DataSource by name.

Definition at line 117 of file PyNTupleController.cxx.

References DataSourceController::instance().

Referenced by hippodraw::Python::export_NTupleController().

PyNTupleController * instance (  )  [static]

The singleton instance method.

Definition at line 50 of file PyNTupleController.cxx.

References NTupleController::instance(), PyNTupleController::m_instance, PyNTupleController::PyNTupleController(), and PyNTupleController::s_instance.

Referenced by hippodraw::Python::export_NTupleController().

void registerNTuple ( const std::string &  name,
DataSource source 
)

Registers the DataSource object as name.

Definition at line 139 of file PyNTupleController.cxx.

References DataSourceController::instance(), and PyNTupleController::registerNTuple().

std::string registerNTuple ( DataSource source  ) 

Registers the DataSource object and returns its assigned name.

Definition at line 126 of file PyNTupleController.cxx.

References DataSourceController::instance(), PyApp::lock(), and PyApp::unlock().

Referenced by PyNTupleController::createNTuple(), hippodraw::Python::export_NTupleController(), and PyNTupleController::registerNTuple().

int writeNTupleToFile ( DataSource source,
const std::string &  filename 
)

Writes the DataSource to the file filename.

Returns 0 if successful, otherwise returns a yet to be determined return code.

Definition at line 148 of file PyNTupleController.cxx.

References PyNTupleController::m_instance.

Referenced by hippodraw::Python::export_NTupleController().


Member Data Documentation

NTupleController * m_instance = 0 [static, private]

The singleton NTupleController object.

Definition at line 46 of file PyNTupleController.h.

Referenced by PyNTupleController::createCircularBuffer(), PyNTupleController::createNTuple(), PyNTupleController::instance(), and PyNTupleController::writeNTupleToFile().

PyNTupleController * s_instance = 0 [static, private]

The singleton PyNTupleController instance.

Definition at line 42 of file PyNTupleController.h.

Referenced by PyNTupleController::instance().


The documentation for this class was generated from the following files:
Generated for HippoDraw Class Library by doxygen