Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DataRepController Class Reference

#include <DataRepController.h>

Collaboration diagram for DataRepController:

Collaboration graph
[legend]
List of all members.

Detailed Description

A singleton class that is the interface between GUI and the DataRep.

It frequently implements the application logic which should neither be in the GUI nor in the display objects.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 35 of file DataRepController.h.

Public Member Functions

const std::vector< std::string > & bindingOptions (DataRep *rep)
 Returns the binding options, if any, for the DataRep.
const std::vector< std::string > & bindingOptions (const std::string &name)
 Returns the binding options, if any, for the named DataRep.
void changeDataSource (DataRep *rep, const DataSource *tuple)
 Changes the DataSource.
DataRepcreateDataRep (const std::string &name, const DataSource *ntuple, const std::vector< std::string > &bindings) const
 Creates a new DataRep object of class name.
DataRepcreateDataRep (const std::string &name)
 Creates a new DataRep object of class name.
void setAxisBindings (DataRep *rep, const DataSource *ntuple, const std::vector< std::string > &bindings) const
 Sets the axis binding of the DataRep object.
 ~DataRepController ()
 The destructor.

Static Public Member Functions

static DataRepControllerinstance ()
 Returns the pointer to the singleton instance.

Protected Member Functions

 DataRepController ()
 A default constructor for avoiding creation except by itself or with derived classes.

Private Member Functions

bool checkBindings (const DataSource *tuple, const std::vector< std::string > &bindings) const
 Returns true if all the the string objects in the vector bindings are valid labels for the columns in DataSource tuple.
 DataRepController (const DataRepController &)
 A private copy constructor in order to avoid copying.

Private Attributes

std::vector< std::stringm_null_vector
 A empty vector of strings.

Static Private Attributes

static DataRepControllers_instance = 0
 The pointer to the singleton object.


Constructor & Destructor Documentation

DataRepController::DataRepController const DataRepController  )  [private]
 

A private copy constructor in order to avoid copying.

DataRepController::DataRepController  )  [protected]
 

A default constructor for avoiding creation except by itself or with derived classes.

Definition at line 36 of file DataRepController.cxx.

Referenced by instance().

DataRepController::~DataRepController  ) 
 

The destructor.

Definition at line 40 of file DataRepController.cxx.


Member Function Documentation

const vector< string > & DataRepController::bindingOptions DataRep rep  ) 
 

Returns the binding options, if any, for the DataRep.

If no binding options are available, return an empty vector.

Definition at line 62 of file DataRepController.cxx.

References NTupleProjector::bindingOptions(), DataRep::getProjector(), and m_null_vector.

const vector< string > & DataRepController::bindingOptions const std::string name  ) 
 

Returns the binding options, if any, for the named DataRep.

If no binding options are available, return an empty vector.

Definition at line 53 of file DataRepController.cxx.

References DataRepFactory::instance(), and Factory< Type >::prototype().

Referenced by DisplayController::bindingOptions().

void DataRepController::changeDataSource DataRep rep,
const DataSource tuple
 

Changes the DataSource.

Attempt to change the DataSource for the DataRep object while perserving the bindings. The object rep must be one that contains a NTupleProjector, otherwise an assertion is raised. If the ntuple doesn't have column labels required, then the old data source is restored and a DataSourceException is thrown.

Definition at line 146 of file DataRepController.cxx.

References setAxisBindings().

bool DataRepController::checkBindings const DataSource tuple,
const std::vector< std::string > &  bindings
const [private]
 

Returns true if all the the string objects in the vector bindings are valid labels for the columns in DataSource tuple.

Otherwise returns false.

Definition at line 75 of file DataRepController.cxx.

Referenced by createDataRep().

DataRep * DataRepController::createDataRep const std::string name,
const DataSource ntuple,
const std::vector< std::string > &  bindings
const
 

Creates a new DataRep object of class name.

Connects the newly created DataRep to ntuple and sets the bindings to bindings. Returns DataRep if successful, otherwise an DataRepException is thrown.

Definition at line 112 of file DataRepController.cxx.

References checkBindings(), Factory< Type >::create(), DataRepFactory::instance(), and setAxisBindings().

DataRep * DataRepController::createDataRep const std::string name  ) 
 

Creates a new DataRep object of class name.

It should be a class that does not have NTuple bindings. Returns the DataRep object if successful, otherwise a DataRepException is thrown.

Definition at line 93 of file DataRepController.cxx.

References DataRepFactory::instance(), and FactoryException::what().

Referenced by DisplayController::addDataRep(), DisplayController::addDataRepStacked(), CutController::createCut(), DataRepXML::createDataRep(), and PyDataRep::PyDataRep().

DataRepController * DataRepController::instance  )  [static]
 

Returns the pointer to the singleton instance.

Definition at line 44 of file DataRepController.cxx.

References DataRepController(), and s_instance.

Referenced by DisplayController::addDataRep(), DisplayController::addDataRepStacked(), DisplayController::bindingOptions(), CutController::createCut(), DataRepXML::createDataRep(), DisplayController::createDisplay(), Inspector::ntupleChanged(), and PyDataRep::PyDataRep().

void DataRepController::setAxisBindings DataRep rep,
const DataSource ntuple,
const std::vector< std::string > &  bindings
const
 

Sets the axis binding of the DataRep object.

Definition at line 129 of file DataRepController.cxx.

References Observable::addObserver(), DataRep::getProjector(), DataRep::setAxisBindings(), and NTupleProjector::setNTuple().

Referenced by changeDataSource(), and createDataRep().


Member Data Documentation

std::vector< std::string > DataRepController::m_null_vector [private]
 

A empty vector of strings.

This vector is returned by member functions that can not obtain a reference from a DataRep.

Definition at line 45 of file DataRepController.h.

Referenced by bindingOptions().

DataRepController * DataRepController::s_instance = 0 [static, private]
 

The pointer to the singleton object.

Definition at line 34 of file DataRepController.cxx.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3