#include <HardwareCanSourceTest.h>
Public Types | |
typedef boost::shared_ptr < const HardwareCanSourceTest > | ConstPtr |
Const shared pointer shorthand. | |
enum | Pattern { P_LINEAR = 1, P_FIXED, P_CHANGING_RANDOM, P_CHANGING_WITH_REPEAT } |
Different test patterns. More... | |
typedef boost::shared_ptr < HardwareCanSourceTest > | Ptr |
Shared pointer shorthand. | |
Public Member Functions | |
virtual CanMessageStamped::Ptr | get () const |
Returns the current data element. | |
virtual bool | good () const |
Always returns true for the test source. | |
virtual bool | isSeekable () const |
This is a non-seekable source. | |
Static Public Member Functions | |
static icl_sourcesink::URISchemeMap | supportedURISchemes () |
URI schemes supported by this source. | |
Protected Member Functions | |
bool | advance () |
Advance to the next data element. | |
unsigned int | createCanMessageId () |
HardwareCanSourceTest (const std::string &uri="", const std::string &name="HardwareCanSourceTest") | |
Constructor. | |
Private Attributes | |
CanMessageStamped::Ptr | m_buffer |
Buffers the latest generated message. | |
boost::random::uniform_int_distribution < unsigned int > | m_can_id_distribution |
Uniform distribution over possible CAN IDs. | |
boost::random::uniform_int_distribution < uint8_t > | m_data_distribution |
Uniform distribution over possible payload bytes. | |
uint16_t | m_next_id |
The next CAN message ID to be used. | |
Pattern | m_pattern |
The message generation pattern. | |
float | m_rate |
Data generation rate in Hz. | |
boost::random::mt19937 | m_rng |
Random number generator. | |
Friends | |
class | icl_sourcesink::DataSourceFactory< HardwareCanSourceTest > |
Provide access for the factory. | |
class | icl_sourcesink::SourceSinkManager |
Provide access for the manager. |
This source creates its own tCanMessage elements for test purposes. Using a URI parameter, a pattern can be set which defines how the messages should be constructed.
Definition at line 44 of file HardwareCanSourceTest.h.
typedef boost::shared_ptr<const HardwareCanSourceTest> icl_hardware::can::HardwareCanSourceTest::ConstPtr |
Const shared pointer shorthand.
Definition at line 50 of file HardwareCanSourceTest.h.
typedef boost::shared_ptr<HardwareCanSourceTest> icl_hardware::can::HardwareCanSourceTest::Ptr |
Shared pointer shorthand.
Definition at line 48 of file HardwareCanSourceTest.h.
Different test patterns.
Definition at line 53 of file HardwareCanSourceTest.h.
icl_hardware::can::HardwareCanSourceTest::HardwareCanSourceTest | ( | const std::string & | uri = "" , |
const std::string & | name = "HardwareCanSourceTest" |
||
) | [protected] |
Constructor.
Definition at line 37 of file HardwareCanSourceTest.cpp.
bool icl_hardware::can::HardwareCanSourceTest::advance | ( | ) | [protected] |
Advance to the next data element.
Definition at line 101 of file HardwareCanSourceTest.cpp.
unsigned int icl_hardware::can::HardwareCanSourceTest::createCanMessageId | ( | ) | [protected] |
Creates the next CAN message ID, according to the selected pattern generation method.
Definition at line 129 of file HardwareCanSourceTest.cpp.
virtual CanMessageStamped::Ptr icl_hardware::can::HardwareCanSourceTest::get | ( | ) | const [inline, virtual] |
Returns the current data element.
Definition at line 91 of file HardwareCanSourceTest.h.
virtual bool icl_hardware::can::HardwareCanSourceTest::good | ( | ) | const [inline, virtual] |
Always returns true
for the test source.
Definition at line 68 of file HardwareCanSourceTest.h.
virtual bool icl_hardware::can::HardwareCanSourceTest::isSeekable | ( | ) | const [inline, virtual] |
This is a non-seekable source.
Definition at line 97 of file HardwareCanSourceTest.h.
static icl_sourcesink::URISchemeMap icl_hardware::can::HardwareCanSourceTest::supportedURISchemes | ( | ) | [inline, static] |
URI schemes supported by this source.
Definition at line 74 of file HardwareCanSourceTest.h.
friend class icl_sourcesink::DataSourceFactory< HardwareCanSourceTest > [friend] |
Provide access for the factory.
Definition at line 111 of file HardwareCanSourceTest.h.
friend class icl_sourcesink::SourceSinkManager [friend] |
Provide access for the manager.
Definition at line 108 of file HardwareCanSourceTest.h.
Buffers the latest generated message.
Definition at line 132 of file HardwareCanSourceTest.h.
boost::random::uniform_int_distribution<unsigned int> icl_hardware::can::HardwareCanSourceTest::m_can_id_distribution [private] |
Uniform distribution over possible CAN IDs.
Definition at line 126 of file HardwareCanSourceTest.h.
boost::random::uniform_int_distribution<uint8_t> icl_hardware::can::HardwareCanSourceTest::m_data_distribution [private] |
Uniform distribution over possible payload bytes.
Definition at line 129 of file HardwareCanSourceTest.h.
The next CAN message ID to be used.
Definition at line 141 of file HardwareCanSourceTest.h.
The message generation pattern.
Definition at line 138 of file HardwareCanSourceTest.h.
float icl_hardware::can::HardwareCanSourceTest::m_rate [private] |
Data generation rate in Hz.
Definition at line 135 of file HardwareCanSourceTest.h.
boost::random::mt19937 icl_hardware::can::HardwareCanSourceTest::m_rng [private] |
Random number generator.
Definition at line 123 of file HardwareCanSourceTest.h.