Skip to content

Commit a7f76ee

Browse files
author
Olivier Stasse
committed
Merge pull request #14 from francois-keith/master
Correct the name of the method isPlugged.
2 parents f5c76ec + 3e9b998 commit a7f76ee

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

include/dynamic-graph/signal-base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace dynamicgraph
152152
"(while trying to unplug %s).",this->getName ().c_str ());
153153
}
154154

155-
virtual bool isPluged () const
155+
virtual bool isPlugged () const
156156
{
157157
return false;
158158
}

include/dynamic-graph/signal-ptr.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ namespace dynamicgraph
7373
const SignalBase<Time>* getAbstractPtr () const; // throw
7474
virtual void plug( SignalBase<Time>* ref );
7575
virtual void unplug () { plug(NULL); }
76-
virtual bool isPluged () const { return (NULL!=signalPtr); }
76+
virtual bool isPluged () const {
77+
std::cerr << "The method isPluged is deprecated.";
78+
std::cerr << " Please use isPlugged instead" << std::endl;
79+
return isPlugged ();
80+
}
81+
virtual bool isPlugged () const { return (NULL!=signalPtr); }
7782
virtual SignalBase<Time>* getPluged () const { return signalPtr; }
7883
virtual bool isAbstractPluged () const;
7984
virtual const Time& getTime () const;
@@ -83,7 +88,7 @@ namespace dynamicgraph
8388
inline const Signal<T,Time>* operator-> () const { return getPtr (); }
8489
inline Signal<T,Time>& operator* () { return *getPtr (); }
8590
inline const Signal<T,Time>& operator* () const { return *getPtr (); }
86-
inline operator bool () const { return isPluged (); }
91+
inline operator bool () const { return isPlugged (); }
8792

8893
public: /* --- INHERITANCE --- */
8994

include/dynamic-graph/signal-ptr.t.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace dynamicgraph
3838
getPtr ()
3939
{
4040
dgTDEBUGIN(25);
41-
if(! isPluged () )
41+
if(! isPlugged () )
4242
DG_THROW ExceptionSignal( ExceptionSignal::NOT_INITIALIZED,
4343
"In SignalPtr: SIN ptr not set.",
4444
" (in signal <%s>)",getName ().c_str ());
@@ -50,10 +50,10 @@ namespace dynamicgraph
5050
const Signal<T,Time>* SignalPtr<T,Time>::
5151
getPtr () const
5252
{
53-
dgTDEBUGIN(25) << SignalBase<Time>::name <<"("<< isPluged () <<")"
53+
dgTDEBUGIN(25) << SignalBase<Time>::name <<"("<< isPlugged () <<")"
5454
<< this << "->"<<signalPtr <<std::endl;
5555
dgTDEBUGIN(25);
56-
if(! isPluged () )
56+
if(! isPlugged () )
5757
{ DG_THROW ExceptionSignal( ExceptionSignal::NOT_INITIALIZED,
5858
"In SignalPtr: SIN ptr not set.",
5959
" (in signal <%s>)",getName ().c_str ()); }
@@ -142,7 +142,7 @@ namespace dynamicgraph
142142
void SignalPtr<T,Time>::
143143
checkCompatibility ()
144144
{
145-
if( isPluged()&&(!autoref ()) )
145+
if( isPlugged()&&(!autoref ()) )
146146
{ getPtr()->checkCompatibility(); }
147147
else if( isAbstractPluged()&&(!autoref ()) )
148148
{ abstractTransmitter->checkCompatibility(); }
@@ -177,7 +177,7 @@ namespace dynamicgraph
177177
access( const Time & t )
178178
{
179179
dgTDEBUGIN(15);
180-
if( modeNoThrow&&(! isPluged ())&&Signal<T,Time>::copyInit )
180+
if( modeNoThrow&&(! isPlugged ())&&Signal<T,Time>::copyInit )
181181
{
182182
dgTDEBUGOUT(15);
183183
return Signal<T,Time>::accessCopy ();
@@ -203,7 +203,7 @@ namespace dynamicgraph
203203
const T& SignalPtr<T,Time>::
204204
accessCopy () const
205205
{
206-
if( modeNoThrow&&(! isPluged ())&&Signal<T,Time>::copyInit )
206+
if( modeNoThrow&&(! isPlugged ())&&Signal<T,Time>::copyInit )
207207
return Signal<T,Time>::accessCopy ();
208208
else if( autoref () ) return Signal<T,Time>::accessCopy ();
209209
else if( transmitAbstract ) return *transmitAbstractData;
@@ -233,7 +233,7 @@ namespace dynamicgraph
233233
std::ostream& SignalPtr<T,Time>::
234234
display( std::ostream& os ) const
235235
{
236-
dgTDEBUGIN(25) << SignalBase<Time>::name << this << "||" << isPluged () << "||"<<signalPtr;
236+
dgTDEBUGIN(25) << SignalBase<Time>::name << this << "||" << isPlugged () << "||"<<signalPtr;
237237
{ Signal<T,Time>::display(os); }
238238

239239
if( (isAbstractPluged ())&&(!autoref ()) )

0 commit comments

Comments
 (0)