mFrame
載入中...
搜尋中...
無符合項目
mframe::io::ByteBuffer 類別 參考文件
類別mframe::io::ByteBuffer的繼承圖:
mframe::lang::Object mframe::lang::Appendable mframe::lang::Readable mframe::io::Buffer mframe::lang::Interface mframe::lang::Interface mframe::lang::Interface mframe::lang::Flushable mframe::lang::Interface mframe::io::ByteBufferInvert

公開方法(Public Methods)

 ByteBuffer (const mframe::lang::Memory &memory)
 Construct a new Byte Buffer object.
 
 ByteBuffer (int length)
 Construct a new Byte Buffer object.
 
virtual ~ByteBuffer (void) override
 Destroy the Byte Buffer object.
 
ByteBufferoperator<< (char c)
 
ByteBufferoperator<< (short s)
 
ByteBufferoperator<< (int v)
 
ByteBufferoperator<< (const char *string)
 
ByteBufferoperator<< (mframe::lang::Strings &string)
 
int operator= (int v)
 
void operator+= (int shift)
 
void operator-= (int shift)
 
uint32 operator++ (void)
 
uint32 operator-- (void)
 
uint32 operator++ (int)
 
uint32 operator-- (int)
 
virtual void flush (void) override
 
virtual mframe::lang::ReadablegetReadable (void) override
 
virtual mframe::lang::AppendablegetAppendable (void) override
 
virtual int avariable (void) const override
 取得輸出緩存內剩餘多少位元組
 
virtual int pollByte (char &result) override
 檢索一個字節,並由此緩衝區刪除
 
virtual int poll (mframe::lang::Appendable &appendable) override
 檢索至Appendable指定數量字節,並由此緩衝區刪除
 
virtual int poll (void *pointer, int length) override
 檢索至pointer指定數量字節,並由此緩衝區刪除
 
virtual int skip (int length) override
 跳躍指定的字結數量,並由此緩衝區刪除。
 
virtual void lock (bool enable) override
 鎖定緩存,取出不移除。
 
virtual int remaining (void) const override
 取得緩衝區剩餘空閒字節數。
 
virtual int putByte (const char result) override
 將字節輸入至緩衝區。
 
virtual int put (mframe::lang::Readable &readBuffer) override
 將readable內資料輸入至緩衝區。
 
virtual int put (const void *buffer, int bufferSize) override
 將指針內資料輸入至緩衝區。
 
int limit (void) const
 
int capacity (void) const
 
int position (void) const
 
ByteBufferreset (void)
 
ByteBuffermark (void)
 
ByteBufferrewind (void)
 
bool pollByte (uint8 &result)
 Get the Byte object.
 
bool pollShort (uint16 &result)
 Get the Short object.
 
bool pollInt (uint32 &result)
 Get the Int object.
 
mframe::lang::Memorymemory (void)
 
bool limit (int newLimit)
 
bool position (int newPosition)
 
void flip (void)
 
void move (int position)
 
bool put (const char *string)
 
bool put (const mframe::lang::Strings &string)
 
int putFormat (const char *format,...)
 
int putFormat (const char *format, va_list args)
 
bool putShort (const short value)
 
bool putInt (const int value)
 
bool putFloat (const float value)
 
bool pollShort (short &result)
 Get the Short object.
 
bool pollInt (int &result)
 Get the Int object.
 
bool pollFloat (float &result)
 Get the Float object.
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Object
 Object (void)
 Construct a new Object object.
 
virtual ~Object (void) override
 Destroy the Object object.
 
void * operator new (size_t n)
 
void * operator new (size_t n, void *p)
 
mframe::lang::ObjectgetObject (void) override
 取得類Object
 
void delay (int milliseconds) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
bool equals (Object *object) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
bool equals (Object &object) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
void wait (void) const
 導致當前線程等待,直到另一個線程調用此對象的notify()方法或notifyAll()方法,或指定的時間 已過。
 
bool wait (int timeout) const
 導致當前線程等待,直到另一個線程調用此對象的 notify()方法或 notifyAll()方法,或其他一些線 程中斷當前線程,或一定量的實時時間。
 
bool yield (void) const
 函數yield()將控制權傳遞給處於READY狀態且具有相同優先級的下一個線程。 如果在READY狀態下沒有其他優先級相同的線程,則當前線程繼續執行,不會發生線程切換。
 
int lock (void) const
 核心鎖定,在調用unlock以前將不會進行執行緒切換
 
int unlock (void) const
 核心解鎖。
 
mframe::sys::ThreadcurrentThread (void) const
 取得當前的執行緒
 
virtual int hashcode (void) const
 返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Interface
virtual ~Interface (void)=default
 Destroy the struct object.
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Appendable
int put (mframe::lang::Readable &&Readable)
 將Readable內資料輸入至緩衝區。
 
bool isFull (void) const
 取得Appendable是否已滿。
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Readable
bool isEmpty (void) const
 輸出緩存是否為空?
 
int poll (mframe::lang::Appendable &&appendable)
 檢索至Appendable,並由此緩衝區刪除
 

保護屬性

mframe::lang::Memory vMemory
 
int vPosition
 
int vMark
 
int vLimit
 
bool vUnlock
 

建構子與解構子說明文件

◆ ByteBuffer() [1/2]

mframe::io::ByteBuffer::ByteBuffer ( const mframe::lang::Memory & memory)

Construct a new Byte Buffer object.

參數
memory

◆ ByteBuffer() [2/2]

mframe::io::ByteBuffer::ByteBuffer ( int length)

Construct a new Byte Buffer object.

參數
length

函式成員說明文件

◆ avariable()

virtual int mframe::io::ByteBuffer::avariable ( void ) const
inlineoverridevirtual

取得輸出緩存內剩餘多少位元組

傳回值
int 緩存內有效位元組數量

實作 mframe::lang::Readable.

◆ capacity()

int mframe::io::ByteBuffer::capacity ( void ) const
inline
傳回值
uint32

◆ flush()

virtual void mframe::io::ByteBuffer::flush ( void )
overridevirtual

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

The flush method of OutputStream does nothing.

例外
IOExceptionif an I/O error occurs.

實作 mframe::lang::Flushable.

◆ getAppendable()

virtual mframe::lang::Appendable & mframe::io::ByteBuffer::getAppendable ( void )
overridevirtual

◆ getReadable()

virtual mframe::lang::Readable & mframe::io::ByteBuffer::getReadable ( void )
overridevirtual

◆ limit() [1/2]

bool mframe::io::ByteBuffer::limit ( int newLimit)
參數
newLimit
傳回值
true
false

◆ limit() [2/2]

int mframe::io::ByteBuffer::limit ( void ) const
inline
傳回值
uint32

◆ lock()

virtual void mframe::io::ByteBuffer::lock ( bool enable)
overridevirtual

鎖定緩存,取出不移除。

參數
enable啟用

實作 mframe::lang::Readable.

◆ mark()

ByteBuffer & mframe::io::ByteBuffer::mark ( void )
inline
傳回值
ByteBuffer&

◆ memory()

mframe::lang::Memory & mframe::io::ByteBuffer::memory ( void )
inline

◆ move()

void mframe::io::ByteBuffer::move ( int position)
參數
position

◆ operator++() [1/2]

uint32 mframe::io::ByteBuffer::operator++ ( int )
inline
傳回值
uint32

◆ operator++() [2/2]

uint32 mframe::io::ByteBuffer::operator++ ( void )
inline
傳回值
uint32

◆ operator+=()

void mframe::io::ByteBuffer::operator+= ( int shift)
inline
參數
shift

◆ operator--() [1/2]

uint32 mframe::io::ByteBuffer::operator-- ( int )
inline
傳回值
uint32

◆ operator--() [2/2]

uint32 mframe::io::ByteBuffer::operator-- ( void )
inline
傳回值
uint32

◆ operator-=()

void mframe::io::ByteBuffer::operator-= ( int shift)
inline
參數
shift

◆ operator<<() [1/5]

ByteBuffer & mframe::io::ByteBuffer::operator<< ( char c)
inline
參數
c
傳回值
ByteBuffer&

◆ operator<<() [2/5]

ByteBuffer & mframe::io::ByteBuffer::operator<< ( const char * string)
inline
參數
string
傳回值
ByteBuffer&

◆ operator<<() [3/5]

ByteBuffer & mframe::io::ByteBuffer::operator<< ( int v)
inline
參數
v
傳回值
ByteBuffer&

◆ operator<<() [4/5]

ByteBuffer & mframe::io::ByteBuffer::operator<< ( mframe::lang::Strings & string)
inline
參數
string
傳回值
ByteBuffer&

◆ operator<<() [5/5]

ByteBuffer & mframe::io::ByteBuffer::operator<< ( short s)
inline
參數
s
傳回值
ByteBuffer&

◆ operator=()

int mframe::io::ByteBuffer::operator= ( int v)
inline
參數
v
傳回值
int

◆ poll() [1/2]

virtual int mframe::io::ByteBuffer::poll ( mframe::lang::Appendable & appendable)
overridevirtual

檢索至Appendable指定數量字節,並由此緩衝區刪除

參數
appendable輸出緩衝區
傳回值
int 檢索的位元組數量

實作 mframe::lang::Readable.

◆ poll() [2/2]

virtual int mframe::io::ByteBuffer::poll ( void * pointer,
int length )
overridevirtual

檢索至pointer指定數量字節,並由此緩衝區刪除

參數
pointer資料來源指針
length資料長度
傳回值
int 實際檢索的位元組數量

實作 mframe::lang::Readable.

◆ pollByte() [1/2]

virtual int mframe::io::ByteBuffer::pollByte ( char & result)
overridevirtual

檢索一個字節,並由此緩衝區刪除

參數
result
傳回值
int 緩衝區剩餘可讀取數量

實作 mframe::lang::Readable.

◆ pollByte() [2/2]

bool mframe::io::ByteBuffer::pollByte ( uint8 & result)
inline

Get the Byte object.

參數
result
傳回值
true
false

◆ pollFloat()

bool mframe::io::ByteBuffer::pollFloat ( float & result)

Get the Float object.

參數
result
傳回值
true
false

◆ pollInt() [1/2]

bool mframe::io::ByteBuffer::pollInt ( int & result)

Get the Int object.

參數
result
傳回值
true
false

◆ pollInt() [2/2]

bool mframe::io::ByteBuffer::pollInt ( uint32 & result)
inline

Get the Int object.

參數
result
傳回值
true
false

◆ pollShort() [1/2]

bool mframe::io::ByteBuffer::pollShort ( short & result)

Get the Short object.

參數
result
傳回值
true
false

◆ pollShort() [2/2]

bool mframe::io::ByteBuffer::pollShort ( uint16 & result)
inline

Get the Short object.

參數
result
傳回值
true
false

◆ position() [1/2]

bool mframe::io::ByteBuffer::position ( int newPosition)
參數
newPosition
傳回值
true
false

◆ position() [2/2]

int mframe::io::ByteBuffer::position ( void ) const
inline
傳回值
uint32

◆ put() [1/4]

bool mframe::io::ByteBuffer::put ( const char * string)
參數
string
傳回值
true
false

◆ put() [2/4]

bool mframe::io::ByteBuffer::put ( const mframe::lang::Strings & string)
參數
string
傳回值
true
false

◆ put() [3/4]

virtual int mframe::io::ByteBuffer::put ( const void * pointer,
int length )
overridevirtual

將指針內資料輸入至緩衝區。

參數
pointer資料來源指針
length資料長度
傳回值
int 實際輸入至緩衝區的字節數。

實作 mframe::lang::Appendable.

◆ put() [4/4]

virtual int mframe::io::ByteBuffer::put ( mframe::lang::Readable & readable)
overridevirtual

將readable內資料輸入至緩衝區。

參數
readable資料來源
傳回值
int 實際輸入至緩衝區的字節數。

實作 mframe::lang::Appendable.

◆ putByte()

virtual int mframe::io::ByteBuffer::putByte ( const char data)
overridevirtual

將字節輸入至緩衝區。

參數
data資料來源
傳回值
int 剩餘的空閒字節數。

實作 mframe::lang::Appendable.

◆ putFloat()

bool mframe::io::ByteBuffer::putFloat ( const float value)
參數
value
傳回值
true
false

◆ putFormat() [1/2]

int mframe::io::ByteBuffer::putFormat ( const char * format,
va_list args )
參數
format
args
傳回值
int

◆ putFormat() [2/2]

int mframe::io::ByteBuffer::putFormat ( const char * format,
... )
參數
format
...
傳回值
int

◆ putInt()

bool mframe::io::ByteBuffer::putInt ( const int value)
參數
value
傳回值
true
false

◆ putShort()

bool mframe::io::ByteBuffer::putShort ( const short value)
參數
value
傳回值
true
false

◆ remaining()

virtual int mframe::io::ByteBuffer::remaining ( void ) const
overridevirtual

取得緩衝區剩餘空閒字節數。

傳回值
int 剩餘的空閒字節數。

實作 mframe::lang::Appendable.

◆ reset()

ByteBuffer & mframe::io::ByteBuffer::reset ( void )
inline
傳回值
ByteBuffer&

◆ rewind()

ByteBuffer & mframe::io::ByteBuffer::rewind ( void )
inline
傳回值
ByteBuffer&

◆ skip()

virtual int mframe::io::ByteBuffer::skip ( int length)
overridevirtual

跳躍指定的字結數量,並由此緩衝區刪除。

參數
length指定跳躍的字節數量。
傳回值
int 實際跳躍的字節數量。

實作 mframe::lang::Readable.


此類別(class) 文件是由下列檔案中產生: