~marcustomlinson/dspatch/overall_cleanup

« back to all changes in this revision

Viewing changes to include/dspatch/DspSignal.h

  • Committer: Marcus Tomlinson
  • Date: 2014-07-26 08:01:41 UTC
  • Revision ID: marcus.tomlinson@canonical.com-20140726080141-dwodfnmwuo7j90pa
Added alternative Get* methods that return const pointers rather than expecting a reference parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  template< class ValueType >
60
60
  bool GetValue( ValueType& returnValue ) const;
61
61
 
 
62
  template< class ValueType >
 
63
  ValueType const* GetValue() const;
 
64
 
62
65
  bool SetSignal( DspSignal const* newSignal );
63
66
 
64
67
  void ClearValue();
107
110
  }
108
111
}
109
112
 
 
113
//-------------------------------------------------------------------------------------------------
 
114
 
 
115
template< class ValueType >
 
116
ValueType const* DspSignal::GetValue() const
 
117
{
 
118
    if( _valueAvailable )
 
119
    {
 
120
      return DspRunType::RunTypeCast< ValueType >( &_signalValue );
 
121
    }
 
122
    else
 
123
    {
 
124
      return NULL; // no value available
 
125
    }
 
126
}
 
127
 
110
128
//=================================================================================================
111
129
 
112
130
#endif // DSPSIGNAL_H