Add const double& operator[] to SpectrumValue
This commit is contained in:
@@ -54,6 +54,8 @@ us a note on ns-developers mailing list.</p>
|
||||
<h1>Changes from ns-3.20 to ns-3.21</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> New "const double& SpectrumValue:: operator[] (size_t index) const".
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
|
||||
@@ -406,10 +406,6 @@ def register_types(module):
|
||||
typehandlers.add_type_alias(u'ns3::Vector3DValue*', u'ns3::VectorValue*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3DValue&', u'ns3::VectorValue&')
|
||||
module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
|
||||
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyRxStartCallback')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyRxStartCallback*')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyRxStartCallback&')
|
||||
@@ -419,6 +415,10 @@ def register_types(module):
|
||||
typehandlers.add_type_alias(u'uint32_t', u'ns3::SpectrumModelUid_t')
|
||||
typehandlers.add_type_alias(u'uint32_t*', u'ns3::SpectrumModelUid_t*')
|
||||
typehandlers.add_type_alias(u'uint32_t&', u'ns3::SpectrumModelUid_t&')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
|
||||
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >', u'ns3::TxSpectrumModelInfoMap_t')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >*', u'ns3::TxSpectrumModelInfoMap_t*')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >&', u'ns3::TxSpectrumModelInfoMap_t&')
|
||||
|
||||
@@ -406,10 +406,6 @@ def register_types(module):
|
||||
typehandlers.add_type_alias(u'ns3::Vector3DValue*', u'ns3::VectorValue*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3DValue&', u'ns3::VectorValue&')
|
||||
module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
|
||||
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyRxStartCallback')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyRxStartCallback*')
|
||||
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyRxStartCallback&')
|
||||
@@ -419,6 +415,10 @@ def register_types(module):
|
||||
typehandlers.add_type_alias(u'uint32_t', u'ns3::SpectrumModelUid_t')
|
||||
typehandlers.add_type_alias(u'uint32_t*', u'ns3::SpectrumModelUid_t*')
|
||||
typehandlers.add_type_alias(u'uint32_t&', u'ns3::SpectrumModelUid_t&')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
|
||||
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
|
||||
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >', u'ns3::TxSpectrumModelInfoMap_t')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >*', u'ns3::TxSpectrumModelInfoMap_t*')
|
||||
typehandlers.add_type_alias(u'std::map< unsigned int, ns3::TxSpectrumModelInfo, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::TxSpectrumModelInfo > > >&', u'ns3::TxSpectrumModelInfoMap_t&')
|
||||
|
||||
@@ -46,6 +46,12 @@ SpectrumValue:: operator[] (size_t index)
|
||||
return m_values.at (index);
|
||||
}
|
||||
|
||||
const double&
|
||||
SpectrumValue:: operator[] (size_t index) const
|
||||
{
|
||||
return m_values.at (index);
|
||||
}
|
||||
|
||||
|
||||
SpectrumModelUid_t
|
||||
SpectrumValue::GetSpectrumModelUid () const
|
||||
|
||||
@@ -89,6 +89,14 @@ public:
|
||||
*/
|
||||
double& operator[] (size_t index);
|
||||
|
||||
/**
|
||||
* Access value at given frequency index
|
||||
*
|
||||
* @param index the given frequency index
|
||||
*
|
||||
* @return const reference to the value
|
||||
*/
|
||||
const double& operator[] (size_t index) const;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user