#include <Fireworks/Core/interface/FWConfiguration.h>
Public Types | |
typedef std::vector< std::pair < std::string, FWConfiguration > > | KeyValues |
typedef KeyValues::const_iterator | KeyValuesIt |
typedef std::vector< std::string > | StringValues |
typedef StringValues::const_iterator | StringValuesIt |
Public Member Functions | |
FWConfiguration & | addKeyValue (const std::string &, const FWConfiguration &) |
FWConfiguration & | addKeyValue (const std::string &, FWConfiguration &, bool iDoSwap=false) |
FWConfiguration & | addValue (const std::string &) |
FWConfiguration (unsigned int iVersion=1) | |
FWConfiguration (const FWConfiguration &) | |
FWConfiguration (const std::string &iValue) | |
const KeyValues * | keyValues () const |
FWConfiguration & | operator= (const FWConfiguration &) |
const StringValues * | stringValues () const |
void | swap (FWConfiguration &) |
const std::string & | value (unsigned int iIndex=0) const |
const FWConfiguration * | valueForKey (const std::string &iKey) const |
unsigned int | version () const |
virtual | ~FWConfiguration () |
Private Attributes | |
boost::scoped_ptr< std::vector < std::pair< std::string, FWConfiguration > > > | m_keyValues |
boost::scoped_ptr< std::vector < std::string > > | m_stringValues |
unsigned int | m_version |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 32 of file FWConfiguration.h.
typedef std::vector<std::pair< std::string, FWConfiguration> > FWConfiguration::KeyValues |
Definition at line 46 of file FWConfiguration.h.
typedef KeyValues::const_iterator FWConfiguration::KeyValuesIt |
Definition at line 47 of file FWConfiguration.h.
typedef std::vector<std::string> FWConfiguration::StringValues |
Definition at line 49 of file FWConfiguration.h.
typedef StringValues::const_iterator FWConfiguration::StringValuesIt |
Definition at line 50 of file FWConfiguration.h.
FWConfiguration::FWConfiguration | ( | unsigned int | iVersion = 1 | ) | [inline] |
Definition at line 36 of file FWConfiguration.h.
Referenced by addKeyValue().
: m_version(iVersion) { }
FWConfiguration::FWConfiguration | ( | const std::string & | iValue | ) | [inline] |
Definition at line 38 of file FWConfiguration.h.
: m_stringValues(new std::vector<std::string>( 1, iValue) ), m_version(0) { }
FWConfiguration::~FWConfiguration | ( | ) | [virtual] |
Definition at line 45 of file FWConfiguration.cc.
{ }
FWConfiguration::FWConfiguration | ( | const FWConfiguration & | rhs | ) |
Definition at line 38 of file FWConfiguration.cc.
: m_stringValues( rhs.m_stringValues ? new std::vector<std::string>(*(rhs.m_stringValues)) : 0), m_keyValues( rhs.m_keyValues ? new KeyValues(*(rhs.m_keyValues)) : 0), m_version(rhs.m_version) { }
FWConfiguration & FWConfiguration::addKeyValue | ( | const std::string & | iKey, |
const FWConfiguration & | iConfig | ||
) |
Definition at line 65 of file FWConfiguration.cc.
References m_keyValues, and m_stringValues.
Referenced by addAreaInfoTo(), FWGenericParameter< T >::addTo(), CmsShowNavigator::addTo(), CmsAnnotation::addTo(), FWProxyBuilderConfiguration::addTo(), FWTableView::addTo(), FWTriggerTableView::addTo(), FWLegoViewBase::addTo(), FWGeometryTableViewBase::addTo(), FWGUIManager::addTo(), FWEventAnnotation::addTo(), FWEventItemsManager::addTo(), FWCompositeParameter::addTo(), FWTableViewManager::addToImpl(), FWEveView::addToOrthoCamera(), FWEveView::addToPerspectiveCamera(), addWindowInfoTo(), FWEventItemsManager::setFrom(), and FWConfigurationManager::to().
{ if( m_stringValues ) { throw std::runtime_error("adding key/value to configuration containing string values"); } if(not m_keyValues) { m_keyValues.reset(new KeyValues(1, std::make_pair(iKey,iConfig) ) ); } else { m_keyValues->push_back(std::make_pair(iKey,iConfig)); } return *this; }
FWConfiguration & FWConfiguration::addKeyValue | ( | const std::string & | iKey, |
FWConfiguration & | iConfig, | ||
bool | iDoSwap = false |
||
) |
Definition at line 78 of file FWConfiguration.cc.
References FWConfiguration(), m_keyValues, and m_stringValues.
{ if( m_stringValues ) { throw std::runtime_error("adding key/value to configuration containing string values"); } if( m_stringValues ) { throw std::runtime_error("adding key/value to configuration containing string values"); } if(not m_keyValues) { if(not iDoSwap) { m_keyValues.reset(new KeyValues(1, std::make_pair(iKey,iConfig) ) ); } else { m_keyValues.reset(new KeyValues(1, std::make_pair(iKey,FWConfiguration()) ) ); m_keyValues->back().second.swap(iConfig); } } else { if(not iDoSwap) { m_keyValues->push_back(std::make_pair(iKey,iConfig)); } else { m_keyValues->push_back(std::make_pair(iKey,FWConfiguration())); m_keyValues->back().second.swap(iConfig); } } return *this; }
FWConfiguration & FWConfiguration::addValue | ( | const std::string & | iValue | ) |
Definition at line 105 of file FWConfiguration.cc.
References m_keyValues, and m_stringValues.
Referenced by FWTableViewManager::addToImpl().
{ if( m_keyValues ) { throw std::runtime_error("adding string value to configuration containing key/value pairs"); } if( not m_stringValues ) { m_stringValues.reset( new std::vector<std::string>(1,iValue) ); } else { m_stringValues->push_back(iValue); } return *this; }
const KeyValues* FWConfiguration::keyValues | ( | ) | const [inline] |
Definition at line 59 of file FWConfiguration.h.
References m_keyValues.
Referenced by FWProxyBuilderConfiguration::assertParam(), FWGeometryTableViewBase::populate3DViewsFromConfig(), CmsShowNavigator::setFrom(), FWCompositeParameter::setFrom(), FWConfigurationManager::setFrom(), FWEventItemsManager::setFrom(), FWGUIManager::setFrom(), and streamTo().
{ return m_keyValues.get(); }
FWConfiguration & FWConfiguration::operator= | ( | const FWConfiguration & | rhs | ) |
Definition at line 52 of file FWConfiguration.cc.
References swap(), and groupFilesInBlocks::temp.
{ //An exception safe implementation is FWConfiguration temp(rhs); swap(temp); return *this; }
const StringValues* FWConfiguration::stringValues | ( | ) | const [inline] |
Definition at line 62 of file FWConfiguration.h.
References m_stringValues.
Referenced by FWTableViewManager::setFrom(), and streamTo().
{ return m_stringValues.get(); }
void FWConfiguration::swap | ( | FWConfiguration & | iRHS | ) |
Definition at line 119 of file FWConfiguration.cc.
References m_keyValues, m_stringValues, and m_version.
Referenced by operator=().
{ std::swap(m_version, iRHS.m_version); m_stringValues.swap(iRHS.m_stringValues); m_keyValues.swap(iRHS.m_keyValues); }
const std::string & FWConfiguration::value | ( | unsigned int | iIndex = 0 | ) | const |
Definition at line 130 of file FWConfiguration.cc.
References m_stringValues.
Referenced by FWLegoViewBase::setFrom(), FWEventAnnotation::setFrom(), CmsAnnotation::setFrom(), CmsShowNavigator::setFrom(), FWRPZView::setFrom(), FW3DViewBase::setFrom(), CmsShowCommon::setFrom(), FWTableView::setFrom(), FWGUIManager::setFrom(), FWTriggerTableView::setFrom(), FWEveView::setFromOrthoCamera(), FWEveView::setFromPerspectiveCamera(), FWGeometryTableViewBase::setTopNodePathFromConfig(), and FWGUIManager::setWindowInfoFrom().
{ if( not m_stringValues ) { throw std::runtime_error("no string values set"); } return m_stringValues->at(iIndex); }
const FWConfiguration * FWConfiguration::valueForKey | ( | const std::string & | iKey | ) | const |
Definition at line 139 of file FWConfiguration.cc.
References first, m_keyValues, and m_stringValues.
Referenced by FWProxyBuilderConfiguration::assertParam(), FWEventAnnotation::setFrom(), FWLegoViewBase::setFrom(), CmsAnnotation::setFrom(), FWTableViewManager::setFrom(), FWGenericParameter< T >::setFrom(), CmsShowNavigator::setFrom(), FWRPZView::setFrom(), CmsShowCommon::setFrom(), FW3DViewBase::setFrom(), FWCompositeParameter::setFrom(), FWGeometryTableView::setFrom(), FWEventItemsManager::setFrom(), FWTableView::setFrom(), FWGUIManager::setFrom(), FWOverlapTableView::setFrom(), FWTriggerTableView::setFrom(), FWEveView::setFromOrthoCamera(), FWEveView::setFromPerspectiveCamera(), FWGeometryTableViewBase::setTopNodePathFromConfig(), and FWGUIManager::setWindowInfoFrom().
{ if( m_stringValues ) { throw std::runtime_error("valueFoKey fails because configuration containing string values"); } if(not m_keyValues) { throw std::runtime_error("valueForKey fails becuase no key/values set"); } KeyValues::iterator itFind = std::find_if(m_keyValues->begin(), m_keyValues->end(), boost::bind(&std::pair<std::string,FWConfiguration>::first,_1) == iKey); if(itFind == m_keyValues->end()) { return 0; } return &(itFind->second); }
unsigned int FWConfiguration::version | ( | ) | const [inline] |
Definition at line 55 of file FWConfiguration.h.
References m_version.
Referenced by FWLegoViewBase::setFrom(), FWEveView::setFrom(), FWConfigurableParameterizable::setFrom(), FWRPZView::setFrom(), FWCompositeParameter::setFrom(), FW3DViewBase::setFrom(), FWTableView::setFrom(), FWEventItemsManager::setFrom(), FWGUIManager::setFrom(), FWTriggerTableView::setFrom(), and streamTo().
{ return m_version; }
boost::scoped_ptr<std::vector<std::pair< std::string, FWConfiguration> > > FWConfiguration::m_keyValues [private] |
Definition at line 80 of file FWConfiguration.h.
Referenced by addKeyValue(), addValue(), keyValues(), swap(), and valueForKey().
boost::scoped_ptr<std::vector<std::string> > FWConfiguration::m_stringValues [private] |
Definition at line 79 of file FWConfiguration.h.
Referenced by addKeyValue(), addValue(), stringValues(), swap(), value(), and valueForKey().
unsigned int FWConfiguration::m_version [private] |
Definition at line 81 of file FWConfiguration.h.