Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends
icl_hardware::can::HardwareCanSourceTest Class Reference

#include <HardwareCanSourceTest.h>

List of all members.

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.

Detailed Description

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.


Member Typedef Documentation

Const shared pointer shorthand.

Definition at line 50 of file HardwareCanSourceTest.h.

Shared pointer shorthand.

Definition at line 48 of file HardwareCanSourceTest.h.


Member Enumeration Documentation

Different test patterns.

Enumerator:
P_LINEAR 

The IDs will be increased sequentially from 1 to 2047 (2^11-1), then start again. This is the default pattern.

P_FIXED 

A fixed ID is sent at all times.

P_CHANGING_RANDOM 

The IDs will be created randomly (seed is fixed).

P_CHANGING_WITH_REPEAT 

The IDs are created by a function, IDs can repeat.

Definition at line 53 of file HardwareCanSourceTest.h.


Constructor & Destructor Documentation

icl_hardware::can::HardwareCanSourceTest::HardwareCanSourceTest ( const std::string &  uri = "",
const std::string &  name = "HardwareCanSourceTest" 
) [protected]

Constructor.

Definition at line 37 of file HardwareCanSourceTest.cpp.


Member Function Documentation

Advance to the next data element.

Definition at line 101 of file HardwareCanSourceTest.cpp.

Creates the next CAN message ID, according to the selected pattern generation method.

Definition at line 129 of file HardwareCanSourceTest.cpp.

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.


Friends And Related Function Documentation

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.


Member Data Documentation

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.

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.


The documentation for this class was generated from the following files:


fzi_icl_can
Author(s):
autogenerated on Thu Jun 6 2019 20:26:01