.
This class provides public interface as follows.
- write(): Write data into the buffer.
- read(): Read data from the buffer.
- length(): Get the buffer length.
- isFull(): Check on whether the buffer is full.
- isEmpty(): Check on whether the buffer is empty.
This class provides protected interface as follows.
- put(): Store data into the buffer.
- get(): Get data from the buffer.
init
void init(Properties prop)
-
Set the buffer
- Parameters:
prop
-
Properties
reset
ReturnCode reset()
-
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
wptr
DataType wptr(int n)
-
Get the writing pointer
Pure virtual function to get the writing pointer.
- Parameters:
n
-
writeing pinter + n previous pointer
- Returns:
-
writing pointer
wptr
DataType wptr()
-
Get the writing pointer
Pure virtual function to get the writing pointer.
- Returns:
-
writing pointer
advanceWptr
ReturnCode advanceWptr(int n)
-
Forward n writing pointers.
Pure virtual function to forward n writing pointers.
- Parameters:
n
-
writeing pinter + n previous pointer
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
advanceWptr
ReturnCode advanceWptr()
-
Forward n writing pointers.
Pure virtual function to forward 1 writing pointers.
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
writable
int writable()
-
Get a writable number.
Pure virtual function to get a writable number.
- Returns:
-
value writable number
full
boolean full()
-
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.
rptr
DataType rptr(int n)
-
Get the reading pointer
Pure virtual function to get the reading pointer.
- Parameters:
n
-
reading pinter + n previous pointer
- Returns:
-
reading pointer
rptr
DataType rptr()
-
Get the reading pointer
Pure virtual function to get the reading pointer.
- Returns:
-
reading pointer
advanceRptr
ReturnCode advanceRptr()
-
Forward n reading pointers.
Pure virtual function to forward 1 reading pointers.
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
advanceRptr
ReturnCode advanceRptr(int n)
-
Forward n reading pointers.
Pure virtual function to forward n reading pointers.
- Parameters:
n
-
reading pinter + n previous pointer
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
readable
int readable()
-
Write data into the buffer
Pure virtual function to get a reading number.
- Returns:
-
readable number
empty
boolean empty()
-
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.
length
int length()
-
Get the buffer length
Pure virtual function to get the buffer length.
- Returns:
-
Buffer length
length
ReturnCode length(int n)
-
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
write
ReturnCode write(DataType value)
-
Write data into the buffer
Pure virtual function to write data into the buffer.
- Parameters:
value
-
value Target data to write.
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
write
ReturnCode write(DataType value,
int sec,
int nsec)
-
Write data into the buffer
Pure virtual function to write data into the buffer.
- Parameters:
value
-
value Target data to write.sec
-
TimeOut sec ordernsec
-
TimeOut nsec order
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
read
ReturnCode read(DataRef<DataType> valueRef)
-
Read data from the buffer
Pure virtual function to read data from the buffer.
- Parameters:
valueRef
-
Readout data stored into the buffer.
- Returns:
-
Result of having read
read
ReturnCode read(DataRef<DataType> valueRef,
int sec,
int nsec)
-
Read data from the buffer
Pure virtual function to read data from the buffer.
- Parameters:
valueRef
-
Readout data stored into the buffer.sec
-
TimeOut sec ordernsec
-
TimeOut nsec order
- Returns:
-
Result of having read
put
ReturnCode put(DataType data)
-
Write data into the buffer
Pure virtual function to write data into the buffer.
- Parameters:
data
-
value Target data to write.
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed
get
DataType get()
-
Read data from the buffer
Pure virtual function to read data form the buffer.
- Returns:
-
value Data to read.
get
ReturnCode get(DataRef<DataType> value)
-
Read data from the buffer
Pure virtual function to read data form the buffer.
- Parameters:
value
-
value Data to read.
- Returns:
-
BUFFER_OK: Successful
BUFFER_ERROR: Failed