Skip to content

Commit 71cc79a

Browse files
author
Francois Keith
committed
Add a method to check if a signal with the given name exists.
1 parent 4a14f68 commit 71cc79a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/dynamic-graph/entity.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ namespace dynamicgraph
8484
}
8585
virtual const std::string& getClassName () const = 0;
8686
virtual std::string getDocString () const;
87+
bool hasSignal( const std::string & signame ) const;
8788
SignalBase<int>& getSignal (const std::string& signalName);
8889
const SignalBase<int>& getSignal (const std::string& signalName) const;
8990
std::ostream& displaySignalList(std::ostream& os) const;

src/dgraph/entity.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ std::string Entity::getDocString () const
149149
return *(sigkey ->second) ;
150150

151151

152+
bool Entity::
153+
hasSignal( const string & signame ) const
154+
{
155+
return (!(signalMap.find(signame) == signalMap.end ()));
156+
}
152157

153158
SignalBase<int>& Entity::
154159
getSignal( const string & signame )

0 commit comments

Comments
 (0)