Public Member Functions | Static Public Attributes | Private Attributes | List of all members
InPortBase::RingBufferMock< DataType > Class Template Reference
Inheritance diagram for InPortBase::RingBufferMock< DataType >:
Inheritance graph
[legend]

Public Member Functions

virtual ReturnCode advanceRptr (long int n=1)
 Forward n reading pointers. More...
 
virtual ReturnCode advanceWptr (long int n=1)
 Forward n writing pointers. More...
 
virtual bool empty (void) const
 Check on whether the buffer is empty. More...
 
virtual bool full (void) const
 Check on whether the buffer is full. More...
 
virtual ReturnCode get (DataType &value)
 Read data from the buffer. More...
 
virtual DataType & get ()
 Read data from the buffer. More...
 
virtual void init (const coil::Properties &prop)
 Set the buffer. More...
 
virtual size_t length (void) const
 Get the buffer length. More...
 
virtual ReturnCode length (size_t n)
 Set the buffer length. More...
 
virtual ReturnCode put (const DataType &value)
 Write data into the buffer. More...
 
virtual ReturnCode read (DataType &value, long int sec=-1, long int nsec=-1)
 Read data from the buffer. More...
 
virtual size_t readable () const
 Write data into the buffer. More...
 
virtual ReturnCode reset ()
 Reset the buffer status. More...
 
BUFFERSTATUS_ENUM RingBufferMock (long int length=8)
 
virtual DataType * rptr (long int n=0)
 Get the reading pointer. More...
 
void set_read_return_value (::RTC::BufferStatus::Enum value)
 
void setLogger (Logger *logger)
 
virtual DataType * wptr (long int n=0)
 Get the writing pointer. More...
 
virtual size_t writable () const
 Get a writable number. More...
 
virtual ReturnCode write (const DataType &value, long int sec=-1, long int nsec=-1)
 Write data into the buffer. More...
 
virtual ~RingBufferMock (void)
 
- Public Member Functions inherited from RTC::BufferBase< DataType >
virtual BUFFERSTATUS_ENUM ~BufferBase (void)
 Virtual destructor. More...
 

Static Public Attributes

static Logger logger
 

Private Attributes

std::vector< DataType > m_buffer
 
DataType m_data
 
Loggerm_logger
 
::RTC::BufferStatus::Enum m_read_return_value
 

Additional Inherited Members

- Public Types inherited from RTC::BufferStatus
enum  Enum {
  BUFFER_OK = 0, BUFFER_ERROR, BUFFER_FULL, BUFFER_EMPTY,
  NOT_SUPPORTED, TIMEOUT, PRECONDITION_NOT_MET
}
 DataPortStatus return codes. More...
 
- Static Public Member Functions inherited from RTC::BufferStatus
static const char * toString (Enum status)
 Convert BufferStatus into the string. More...
 

Detailed Description

template<class DataType>
class InPortBase::RingBufferMock< DataType >

Definition at line 171 of file InPortBaseTests.cpp.

Constructor & Destructor Documentation

◆ RingBufferMock()

template<class DataType >
BUFFERSTATUS_ENUM InPortBase::RingBufferMock< DataType >::RingBufferMock ( long int  length = 8)
inline

Definition at line 176 of file InPortBaseTests.cpp.

◆ ~RingBufferMock()

template<class DataType >
virtual InPortBase::RingBufferMock< DataType >::~RingBufferMock ( void  )
inlinevirtual

Definition at line 182 of file InPortBaseTests.cpp.

Member Function Documentation

◆ advanceRptr()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::advanceRptr ( long int  n = 1)
inlinevirtual

Forward n reading pointers.

Pure virtual function to forward n reading pointers.

Returns
BUFFER_OK: Successful BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 287 of file InPortBaseTests.cpp.

◆ advanceWptr()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::advanceWptr ( long int  n = 1)
inlinevirtual

Forward n writing pointers.

Pure virtual function to forward n writing pointers.

Returns
BUFFER_OK: Successful BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 238 of file InPortBaseTests.cpp.

◆ empty()

template<class DataType >
virtual bool InPortBase::RingBufferMock< DataType >::empty ( void  ) const
inlinevirtual

Check on whether the buffer is empty.

Pure virtual function to check on whether the buffer is empty.

Returns
True if the buffer is empty, else false.

Implements RTC::BufferBase< DataType >.

Definition at line 333 of file InPortBaseTests.cpp.

◆ full()

template<class DataType >
virtual bool InPortBase::RingBufferMock< DataType >::full ( void  ) const
inlinevirtual

Check on whether the buffer is full.

Pure virtual function to check on whether the buffer is full.

Returns
True if the buffer is full, else false.

Implements RTC::BufferBase< DataType >.

Definition at line 271 of file InPortBaseTests.cpp.

◆ get() [1/2]

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::get ( DataType &  value)
inlinevirtual

Read data from the buffer.

Pure virtual function to read data form the buffer.

Parameters
valueData to read.
Returns
BUFFER_OK: Successful BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 295 of file InPortBaseTests.cpp.

◆ get() [2/2]

template<class DataType >
virtual DataType& InPortBase::RingBufferMock< DataType >::get ( )
inlinevirtual

Read data from the buffer.

Pure virtual function to read data from the buffer.

Returns
Data got from buffer.

Implements RTC::BufferBase< DataType >.

Definition at line 303 of file InPortBaseTests.cpp.

◆ init()

template<class DataType >
virtual void InPortBase::RingBufferMock< DataType >::init ( const coil::Properties prop)
inlinevirtual

Set the buffer.

Implements RTC::BufferBase< DataType >.

Definition at line 199 of file InPortBaseTests.cpp.

◆ length() [1/2]

template<class DataType >
virtual size_t InPortBase::RingBufferMock< DataType >::length ( void  ) const
inlinevirtual

Get the buffer length.

Pure virtual function to get the buffer length.

Returns
buffer length

Implements RTC::BufferBase< DataType >.

Definition at line 206 of file InPortBaseTests.cpp.

◆ length() [2/2]

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::length ( size_t  n)
inlinevirtual

Set the buffer length.

Pure virtual function to set the buffer length.

Returns
BUFFER_OK: Successful NOT_SUPPORTED: The buffer length cannot be set. BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 214 of file InPortBaseTests.cpp.

◆ put()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::put ( const DataType &  value)
inlinevirtual

Write data into the buffer.

Pure virtual function to write data into the buffer.

Parameters
valueTarget data to write.
Returns
BUFFER_OK: Successful BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 246 of file InPortBaseTests.cpp.

◆ read()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::read ( DataType &  value,
long int  sec = -1,
long int  nsec = -1 
)
inlinevirtual

Read data from the buffer.

Pure virtual function to read data from the buffer.

Parameters
valueRead data.
Returns
Result of having read (true:Successful, false:Failed)

Implements RTC::BufferBase< DataType >.

Definition at line 311 of file InPortBaseTests.cpp.

◆ readable()

template<class DataType >
virtual size_t InPortBase::RingBufferMock< DataType >::readable ( ) const
inlinevirtual

Write data into the buffer.

Pure virtual function to get a reading number.

Returns
readable number

Implements RTC::BufferBase< DataType >.

Definition at line 325 of file InPortBaseTests.cpp.

◆ reset()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::reset ( )
inlinevirtual

Reset the buffer status.

Pure virtual function to reset the buffer status.

Returns
BUFFER_OK: Successful NOT_SUPPORTED: The buffer status cannot be reset. BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 222 of file InPortBaseTests.cpp.

◆ rptr()

template<class DataType >
virtual DataType* InPortBase::RingBufferMock< DataType >::rptr ( long int  n = 0)
inlinevirtual

Get the reading pointer.

Pure virtual function to get the reading pointer.

Returns
reading pointer

Implements RTC::BufferBase< DataType >.

Definition at line 279 of file InPortBaseTests.cpp.

◆ set_read_return_value()

template<class DataType >
void InPortBase::RingBufferMock< DataType >::set_read_return_value ( ::RTC::BufferStatus::Enum  value)
inline

Definition at line 191 of file InPortBaseTests.cpp.

◆ setLogger()

template<class DataType >
void InPortBase::RingBufferMock< DataType >::setLogger ( Logger logger)
inline

Definition at line 341 of file InPortBaseTests.cpp.

◆ wptr()

template<class DataType >
virtual DataType* InPortBase::RingBufferMock< DataType >::wptr ( long int  n = 0)
inlinevirtual

Get the writing pointer.

Pure virtual function to get the writing pointer.

Parameters
writeingpinter or n previous pointer
Returns
writing pointer

Implements RTC::BufferBase< DataType >.

Definition at line 230 of file InPortBaseTests.cpp.

◆ writable()

template<class DataType >
virtual size_t InPortBase::RingBufferMock< DataType >::writable ( ) const
inlinevirtual

Get a writable number.

Pure virtual function to get a writable number.

Returns
value writable number

Implements RTC::BufferBase< DataType >.

Definition at line 263 of file InPortBaseTests.cpp.

◆ write()

template<class DataType >
virtual ReturnCode InPortBase::RingBufferMock< DataType >::write ( const DataType &  value,
long int  sec = -1,
long int  nsec = -1 
)
inlinevirtual

Write data into the buffer.

Pure virtual function to write data into the buffer.

Parameters
valueTarget data to write.
Returns
BUFFER_OK: Successful BUFFER_ERROR: Failed

Implements RTC::BufferBase< DataType >.

Definition at line 254 of file InPortBaseTests.cpp.

Member Data Documentation

◆ logger

template<class DataType >
Logger InPortBase::RingBufferMock< DataType >::logger
static

Definition at line 346 of file InPortBaseTests.cpp.

◆ m_buffer

template<class DataType >
std::vector<DataType> InPortBase::RingBufferMock< DataType >::m_buffer
private

Definition at line 349 of file InPortBaseTests.cpp.

◆ m_data

template<class DataType >
DataType InPortBase::RingBufferMock< DataType >::m_data
private

Definition at line 348 of file InPortBaseTests.cpp.

◆ m_logger

template<class DataType >
Logger* InPortBase::RingBufferMock< DataType >::m_logger
private

Definition at line 350 of file InPortBaseTests.cpp.

◆ m_read_return_value

template<class DataType >
::RTC::BufferStatus::Enum InPortBase::RingBufferMock< DataType >::m_read_return_value
private

Definition at line 351 of file InPortBaseTests.cpp.


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


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:46