Skip to content
Snippets Groups Projects
Commit 3e9b9984 authored by Francois Keith's avatar Francois Keith
Browse files

Correct the name of the method isPlugged.

The old one is kept, but with a warning message
(for now).
parent f5c76eca
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,7 @@ namespace dynamicgraph
"(while trying to unplug %s).",this->getName ().c_str ());
}
virtual bool isPluged () const
virtual bool isPlugged () const
{
return false;
}
......
......@@ -73,7 +73,12 @@ namespace dynamicgraph
const SignalBase<Time>* getAbstractPtr () const; // throw
virtual void plug( SignalBase<Time>* ref );
virtual void unplug () { plug(NULL); }
virtual bool isPluged () const { return (NULL!=signalPtr); }
virtual bool isPluged () const {
std::cerr << "The method isPluged is deprecated.";
std::cerr << " Please use isPlugged instead" << std::endl;
return isPlugged ();
}
virtual bool isPlugged () const { return (NULL!=signalPtr); }
virtual SignalBase<Time>* getPluged () const { return signalPtr; }
virtual bool isAbstractPluged () const;
virtual const Time& getTime () const;
......@@ -83,7 +88,7 @@ namespace dynamicgraph
inline const Signal<T,Time>* operator-> () const { return getPtr (); }
inline Signal<T,Time>& operator* () { return *getPtr (); }
inline const Signal<T,Time>& operator* () const { return *getPtr (); }
inline operator bool () const { return isPluged (); }
inline operator bool () const { return isPlugged (); }
public: /* --- INHERITANCE --- */
......
......@@ -38,7 +38,7 @@ namespace dynamicgraph
getPtr ()
{
dgTDEBUGIN(25);
if(! isPluged () )
if(! isPlugged () )
DG_THROW ExceptionSignal( ExceptionSignal::NOT_INITIALIZED,
"In SignalPtr: SIN ptr not set.",
" (in signal <%s>)",getName ().c_str ());
......@@ -50,10 +50,10 @@ namespace dynamicgraph
const Signal<T,Time>* SignalPtr<T,Time>::
getPtr () const
{
dgTDEBUGIN(25) << SignalBase<Time>::name <<"("<< isPluged () <<")"
dgTDEBUGIN(25) << SignalBase<Time>::name <<"("<< isPlugged () <<")"
<< this << "->"<<signalPtr <<std::endl;
dgTDEBUGIN(25);
if(! isPluged () )
if(! isPlugged () )
{ DG_THROW ExceptionSignal( ExceptionSignal::NOT_INITIALIZED,
"In SignalPtr: SIN ptr not set.",
" (in signal <%s>)",getName ().c_str ()); }
......@@ -142,7 +142,7 @@ namespace dynamicgraph
void SignalPtr<T,Time>::
checkCompatibility ()
{
if( isPluged()&&(!autoref ()) )
if( isPlugged()&&(!autoref ()) )
{ getPtr()->checkCompatibility(); }
else if( isAbstractPluged()&&(!autoref ()) )
{ abstractTransmitter->checkCompatibility(); }
......@@ -177,7 +177,7 @@ namespace dynamicgraph
access( const Time & t )
{
dgTDEBUGIN(15);
if( modeNoThrow&&(! isPluged ())&&Signal<T,Time>::copyInit )
if( modeNoThrow&&(! isPlugged ())&&Signal<T,Time>::copyInit )
{
dgTDEBUGOUT(15);
return Signal<T,Time>::accessCopy ();
......@@ -203,7 +203,7 @@ namespace dynamicgraph
const T& SignalPtr<T,Time>::
accessCopy () const
{
if( modeNoThrow&&(! isPluged ())&&Signal<T,Time>::copyInit )
if( modeNoThrow&&(! isPlugged ())&&Signal<T,Time>::copyInit )
return Signal<T,Time>::accessCopy ();
else if( autoref () ) return Signal<T,Time>::accessCopy ();
else if( transmitAbstract ) return *transmitAbstractData;
......@@ -233,7 +233,7 @@ namespace dynamicgraph
std::ostream& SignalPtr<T,Time>::
display( std::ostream& os ) const
{
dgTDEBUGIN(25) << SignalBase<Time>::name << this << "||" << isPluged () << "||"<<signalPtr;
dgTDEBUGIN(25) << SignalBase<Time>::name << this << "||" << isPlugged () << "||"<<signalPtr;
{ Signal<T,Time>::display(os); }
if( (isAbstractPluged ())&&(!autoref ()) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment