From 1ae45f2b0b430d356ea1e9b03515b0f73bcc96dc Mon Sep 17 00:00:00 2001 From: cantor Date: Sat, 18 Sep 2010 20:14:21 +0000 Subject: [PATCH] Add accessor for feature bitmask. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3322 cb58f699-b61c-0410-a6fe-9272a202ed29 --- shibsp/SPConfig.cpp | 6 +++++- shibsp/SPConfig.h | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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 -- 2.1.4