From: cantor Date: Sat, 18 Sep 2010 20:14:21 +0000 (+0000) Subject: Add accessor for feature bitmask. X-Git-Tag: 2.4~17 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=1ae45f2b0b430d356ea1e9b03515b0f73bcc96dc Add accessor for feature bitmask. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3322 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp index de35b4d..c62c668 100644 --- a/shibsp/SPConfig.cpp +++ b/shibsp/SPConfig.cpp @@ -121,7 +121,11 @@ void SPConfig::setFeatures(unsigned long enabled) m_features = enabled; } -bool SPConfig::isEnabled(components_t feature) +unsigned long SPConfig::getFeatures() const { + return m_features; +} + +bool SPConfig::isEnabled(components_t feature) const { return (m_features & feature)>0; } diff --git a/shibsp/SPConfig.h b/shibsp/SPConfig.h index 918b102..73a70a1 100644 --- a/shibsp/SPConfig.h +++ b/shibsp/SPConfig.h @@ -108,13 +108,21 @@ namespace shibsp { */ void setFeatures(unsigned long enabled); + + /** + * Gets the bitmask of subsystems being activated. + * + * @return bitmask of component constants + */ + unsigned long getFeatures() const; + /** * Test whether a subsystem is enabled. * * @param feature subsystem/component to test * @return true iff feature is enabled */ - bool isEnabled(components_t feature); + bool isEnabled(components_t feature) const; /** * Initializes library