Commit 45bc2435 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[CHANGE] findProperty memeber functions may hinder const correctness, so there...

[CHANGE] findProperty memeber functions may hinder const correctness, so there is no obvious reason to make them const. If we really need non const functions we should provide both.
parent 2a010852
......@@ -256,7 +256,7 @@ void WProperties::removeProperty( boost::shared_ptr< WPropertyBase > prop )
m_childUpdateCondition->remove( prop->getUpdateCondition() );
}
boost::shared_ptr< WPropertyBase > WProperties::findProperty( WProperties* props, std::string name )
boost::shared_ptr< WPropertyBase > WProperties::findProperty( const WProperties* const props, std::string name ) const
{
boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
......@@ -277,7 +277,7 @@ boost::shared_ptr< WPropertyBase > WProperties::findProperty( WProperties* props
return result;
}
boost::shared_ptr< WPropertyBase > WProperties::findProperty( std::string name )
boost::shared_ptr< WPropertyBase > WProperties::findProperty( std::string name ) const
{
boost::shared_ptr< WPropertyBase > result = boost::shared_ptr< WPropertyBase >();
......@@ -287,7 +287,7 @@ boost::shared_ptr< WPropertyBase > WProperties::findProperty( std::string name )
tokenizer tok( name, sep );
// iterate along the path
WProperties* curProps = this; // the group currently in while traversing the path
const WProperties* curProps = this; // the group currently in while traversing the path
for ( tokenizer::iterator it = tok.begin(); it != tok.end(); ++it )
{
// was the last token not a group?
......
......@@ -173,7 +173,7 @@ public:
*
* \return the property or NULL if not found.
*/
boost::shared_ptr< WPropertyBase > findProperty( std::string name );
boost::shared_ptr< WPropertyBase > findProperty( std::string name ) const;
/**
* Removes all properties from the list.
......@@ -935,7 +935,7 @@ protected:
*
* \return the property if found, else NULL.
*/
boost::shared_ptr< WPropertyBase > findProperty( WProperties* props, std::string name );
boost::shared_ptr< WPropertyBase > findProperty( const WProperties* const props, std::string name ) const;
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment