#include <DataSourceController.h>
Inheritance diagram for DataSourceController:
It frequently implements the application logic which should neither be in the GUI nor in the DataSource objects.
Definition at line 39 of file DataSourceController.h.
Public Member Functions | |
void | changeName (const std::string &oldname, const std::string &newname) |
Changes the name of the NTuple. | |
DataSource * | findDataSource (const std::string &name) const throw ( DataSourceException ) |
Returns the DataSource object with registered name name. | |
DataSource * | getDataSource (const std::string &name) const |
Returns the DataSource object with registered name name. | |
const std::vector< DataSource * > & | getDataSources (bool all=true) const |
Returns the vector of the current DataSource objects. | |
const std::vector< std::string > & | getNTupleNames () const |
Returns a vector of the current DataSource names. | |
int | indexOfDataSource (const std::string &name) const |
Returns index of DataSource, or -1 if not found. | |
bool | isSaved (const std::string &name) |
Returns true if the ntuple with name has been saved to or read from a file. | |
void | registerDataSourceFile (DataSource *ds) |
Registers that the DataSource came from a file. | |
void | registerNTuple (const std::string &, DataSource *ntuple) |
Register a NTuple. | |
std::string | registerNTuple (DataSource *nt) |
Register a NTuple. | |
void | unregisterNTuple (const DataSource *nt) |
Un-registers the NTuple. | |
virtual void | update (const Observable *) |
Responds to the Observable having a change. | |
void | willDelete (const Observable *observee) |
Responds to Observable being deleted. | |
Static Public Member Functions | |
static DataSourceController * | instance () |
Returns the pointer to the singleton instance. | |
Private Types | |
typedef std::vector< DataSource * > | DataSourceList_t |
The type of STL container used to keep list of DataSource objects. | |
Private Member Functions | |
DataSourceController (const DataSourceController &) | |
A private copy constructor in order to avoid copying. | |
DataSourceController () | |
A default constructor for avoiding creation except by itself. | |
Private Attributes | |
std::string | m_base_name |
Base of name given to NTuple which is built in memory. | |
std::vector< DataSource * > | m_ds_files |
The list of files that were read from a file. | |
std::vector< std::string > | m_names |
A temporary list of DataSource names. | |
std::vector< DataSource * > | m_ntuples |
A temporary list of DataSource objects. | |
int | m_suffix |
Suffix added to base name given to NTuple which is built in memory. | |
DataSourceList_t | m_tuples |
The list of registered DataSource objects. | |
Static Private Attributes | |
static DataSourceController * | s_instance = 0 |
The pointer to the singleton object. |
|
The type of STL container used to keep list of DataSource objects.
Definition at line 57 of file DataSourceController.h. |
|
A default constructor for avoiding creation except by itself.
Definition at line 46 of file DataSourceController.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 DataSourceController.cxx. |
|
Changes the name of the NTuple. Changes the name of the registered NTuple object designated by oldname, to the name newname. Definition at line 131 of file DataSourceController.cxx. References getDataSource(). |
|
Returns the DataSource object with registered name name. If a object of the given name is found, returns a pointer to it, otherwise throws a DataSourceException. Definition at line 76 of file DataSourceController.cxx. |
|
Returns the DataSource object with registered name name. If the object is found, return a pointer to it. If the object is not found, return a null pointer. Definition at line 112 of file DataSourceController.cxx. References m_tuples, and num_util::size(). Referenced by changeName(), and registerNTuple(). |
|
Returns the vector of the current DataSource objects.
If all is Definition at line 142 of file DataSourceController.cxx. References m_tuples. Referenced by XmlController::fillNTupleMap(), and NTupleController::saveNTuples(). |
|
Returns a vector of the current DataSource names.
Definition at line 147 of file DataSourceController.cxx. References m_names, and m_tuples. Referenced by CanvasView::exportTextTuple(). |
|
Returns index of DataSource, or -1 if not found.
Definition at line 93 of file DataSourceController.cxx. References m_tuples, and num_util::size(). |
|
|
Returns
Definition at line 229 of file DataSourceController.cxx. References m_base_name. Referenced by DisplayController::areDataSourcesSaved(). |
|
Registers that the DataSource came from a file.
Definition at line 69 of file DataSourceController.cxx. References m_ds_files. |
|
Register a NTuple. Register NTuple object ntuple using the name key for later lookup. NTuple objects need to be registered in order to be visible application wide using this singleton controller. Definition at line 185 of file DataSourceController.cxx. References getDataSource(), and m_tuples. |
|
Register a NTuple. A unique name will be generated for the NTuple. Alternately, the programmer could use one of this class's createNTuple methods.
Definition at line 163 of file DataSourceController.cxx. References DataSource::getName(), m_base_name, m_suffix, and DataSource::setName(). Referenced by PickTable::PickTable(), and PyDataSource::registerNTuple(). |
|
Un-registers the NTuple. Un-registers the NTuple from the list of available NTuple objects. If the object is not found, does nothing. Definition at line 201 of file DataSourceController.cxx. References std::find(), and m_tuples. Referenced by willDelete(). |
|
Responds to the Observable having a change. This implementation does noting. The implementation is required because of the pure virtual function in the base class. Implements hippodraw::Observer. Definition at line 212 of file DataSourceController.cxx. |
|
Responds to Observable being deleted. If observer is an object derived from NTuple, then unregisters it. Reimplemented from hippodraw::Observer. Definition at line 218 of file DataSourceController.cxx. References unregisterNTuple(). |
|
Base of name given to NTuple which is built in memory.
Definition at line 76 of file DataSourceController.h. Referenced by isSaved(), and registerNTuple(). |
|
The list of files that were read from a file.
Definition at line 64 of file DataSourceController.h. Referenced by registerDataSourceFile(). |
|
A temporary list of DataSource names.
Definition at line 67 of file DataSourceController.h. Referenced by getNTupleNames(). |
|
A temporary list of DataSource objects.
Definition at line 73 of file DataSourceController.h. |
|
Suffix added to base name given to NTuple which is built in memory.
Definition at line 80 of file DataSourceController.h. Referenced by registerNTuple(). |
|
The list of registered DataSource objects.
Definition at line 61 of file DataSourceController.h. Referenced by getDataSource(), getDataSources(), getNTupleNames(), indexOfDataSource(), registerNTuple(), and unregisterNTuple(). |
|
The pointer to the singleton object.
Definition at line 44 of file DataSourceController.cxx. Referenced by instance(). |