Skip to content

Commit 2237fee

Browse files
committed
CompoundObject : Default member() template argument to Object
1 parent edc2b63 commit 2237fee

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Improvements
55
------------
66

77
- MurmurHash : Added specialisation for `std::hash`, among other things allowing the use of MurmurHash as a key in `unordered_map`.
8+
- CompoundObject : Defaulted template argument to `Object` in `member()` methods.
89

910
10.5.3.0 (relative to 10.5.2.1)
1011
========

include/IECore/CompoundObject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ class IECORE_API CompoundObject : public Object
6464
/// or doesn't match the type specified as the template argument, behavior
6565
/// is defined by the throwExceptions parameter. When this parameter is true a descriptive
6666
/// Exception is thrown, and when false 0 is returned.
67-
template<typename T>
67+
template<typename T = Object>
6868
T *member( const InternedString &name, bool throwExceptions = false );
69-
template<typename T>
69+
template<typename T = Object>
7070
const T *member( const InternedString &name, bool throwExceptions = false ) const;
7171

7272
/// A Convenience function to find an object in members().
7373
/// If the named object doesn't exist, if createIfMissing is true, an object will be added
7474
/// with the type's object factory create method. If false, or the named entry does not match the
7575
/// type specified as the template argument, behavior is defined by the throwExceptions parameter.
7676
/// When this parameter is true a descriptive Exception is thrown, and when false 0 is returned.
77-
template<typename T>
77+
template<typename T = Object>
7878
T *member( const InternedString &name, bool throwExceptions, bool createIfMissing );
7979

8080
/// Returns an instance of CompoundObject which can be shared by everyone - for instance a procedural

src/IECoreMaya/ParameterisedHolderModificationCmd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void ParameterisedHolderModificationCmd::storeParametersWithNewValues( const IEC
323323
{
324324
childParameterPath = it->first;
325325
}
326-
storeParametersWithNewValues( it->second.get(), newCompound->member<Object>( it->first ), childParameterPath );
326+
storeParametersWithNewValues( it->second.get(), newCompound->member( it->first ), childParameterPath );
327327
}
328328

329329
const CompoundObject::ObjectMap &newChildren = static_cast<const CompoundObject *>( newValue )->members();

src/IECoreNuke/ParameterisedHolder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ int ParameterisedHolder<BaseType>::knob_changed( DD::Image::Knob *knob )
188188
ParameterisedInterface *parameterisedInterface = dynamic_cast<ParameterisedInterface *>( g_getParameterisedResult.get() );
189189
// apply current state
190190
ConstCompoundObjectPtr classSpecifier = runTimeCast<const CompoundObject>( m_classSpecifierKnob->getValue() );
191-
ConstObjectPtr handlerState = classSpecifier->member<Object>( "handlerState" );
191+
ConstObjectPtr handlerState = classSpecifier->member( "handlerState" );
192192
if( handlerState )
193193
{
194194
m_parameterHandler->setState( parameterisedInterface->parameters(), handlerState.get() );
@@ -525,7 +525,7 @@ void ParameterisedHolder<BaseType>::updateParameterised( bool reload )
525525
// apply the previously stored handler state
526526

527527
ConstCompoundObjectPtr classSpecifier = runTimeCast<const CompoundObject>( m_classSpecifierKnob->getValue() );
528-
ConstObjectPtr handlerState = classSpecifier->member<Object>( "handlerState" );
528+
ConstObjectPtr handlerState = classSpecifier->member( "handlerState" );
529529
if( handlerState )
530530
{
531531
m_parameterHandler->setState( parameterisedInterface->parameters(), handlerState.get() );

0 commit comments

Comments
 (0)