Skip to content

Commit 7a4d222

Browse files
authored
ofParameter::isOfType<> new method to match type (#7620)
Helper function to unclutter ofParameter type conditionals
1 parent a8dcf93 commit 7a4d222

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libs/openFrameworks/types/ofParameter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class ofAbstractParameter{
5656
return static_cast<const ofReadOnlyParameter<ParameterType, Friend> &>(*this);
5757
}
5858

59+
template<typename OtherType>
60+
bool isOfType() const {
61+
return typeid(*this) == typeid(ofParameter<OtherType>);
62+
}
63+
5964
ofParameterGroup & castGroup();
6065
const ofParameterGroup & castGroup() const;
6166

0 commit comments

Comments
 (0)