MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
MFM::TeeByteSink Class Reference

#include <TeeByteSink.h>

Inheritance diagram for MFM::TeeByteSink:
MFM::ByteSink

Public Member Functions

 TeeByteSink ()
 
 TeeByteSink (ByteSink &sink1, ByteSink &sink2)
 
ByteSinkGetSink1 () const
 
ByteSinkGetSink2 () const
 
ByteSinkSetSink1 (ByteSink *sink)
 
ByteSinkSetSink2 (ByteSink *sink)
 
virtual void WriteBytes (const u8 *data, const u32 len)
 
virtual s32 CanWrite ()
 
- Public Member Functions inherited from MFM::ByteSink
virtual void WriteByte (u8 ch)
 
virtual void WriteNewline ()
 
void Print (const char *str, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (const u8 *str, u32 len, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (s32 decimal, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (u32 decimal, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (s64 decimal, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (u64 decimal, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (u32 num, Format::Type code, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (s32 num, Format::Type code, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (u64 num, Format::Type code, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (s64 num, Format::Type code, s32 fieldWidth=-1, u8 padChar= ' ')
 
void Print (ByteSerializable &byteSerializble, s32 argument=0)
 
void Println ()
 
void Println (u8 byte)
 
void Println (const char *str)
 
void Println (const u8 *str, u32 len)
 
void Println (s32 decimal)
 
void Println (u32 decimal)
 
void Println (u32 decimal, Format::Type code)
 
void Println (ByteSerializable &byteSerializable, s32 argument=0)
 
void Printf (const char *format,...)
 
void Vprintf (const char *format, va_list &ap)
 

Detailed Description

A ByteSink that wraps two other ByteSinks, routing all bytes sent to it on to both underlying ByteSinks.

Constructor & Destructor Documentation

MFM::TeeByteSink::TeeByteSink ( )
inline

Creates a new TeeByteSink which contains two NULL pointers as its underlying ByteSinks. These need to be set before this ByteSink can become useful.

See Also
SetSink1
SetSink2
MFM::TeeByteSink::TeeByteSink ( ByteSink sink1,
ByteSink sink2 
)
inline

Creates a new TeeByteSink which points to the specifiend ByteSinks. Either or both of these ByteSinks may be NULL, which will not be written to.

Parameters
sink1The first ByteSink that this TeeByteSink will initially begin writing to.
sink1The second ByteSink that this TeeByteSink will initially begin writing to.

Member Function Documentation

virtual s32 MFM::TeeByteSink::CanWrite ( )
inlinevirtual

Gets the maximum number of bytes which may be written to both of the ByteSinks held by this TeeByteSink.

Returns
The maximum number of bytes which may be written to both of the ByteSinks held by this TeeByteSink.

Implements MFM::ByteSink.

ByteSink* MFM::TeeByteSink::GetSink1 ( ) const
inline

Gets a pointer to the first ByteSink that this TeeByteSink is currently configured to write to.

Returns
A pointer to the first ByteSink that this TeeByteSink is currently configured to write to.
ByteSink* MFM::TeeByteSink::GetSink2 ( ) const
inline

Gets a pointer to the second ByteSink that this TeeByteSink is currently configured to write to.

Returns
A pointer to the second ByteSink that this TeeByteSink is currently configured to write to.
ByteSink* MFM::TeeByteSink::SetSink1 ( ByteSink sink)
inline

Sets the first ByteSink that this TeeByteSink will be configured to write to.

Parameters
sinkThe first ByteSink that this TeeByteSink will be configured to write to after calling this method.
Returns
A pointer to the first ByteSink that this TeeByteSink was configured to write to before calling this method.
ByteSink* MFM::TeeByteSink::SetSink2 ( ByteSink sink)
inline

Sets the second ByteSink that this TeeByteSink will be configured to write to.

Parameters
sinkThe second ByteSink that this TeeByteSink will be configured to write to after calling this method.
Returns
A pointer to the second ByteSink that this TeeByteSink was configured to write to before calling this method.
virtual void MFM::TeeByteSink::WriteBytes ( const u8 *  data,
const u32  len 
)
inlinevirtual

Writes a series of bytes to the ByteSinks held by this TeeByteSink. If either of these held ByteSinks happen to be NULL, writing to that ByteSink is ignored.

Parameters
dataA pointer to the bytes that will be written to the held ByteSinks.
lenThe number of bytes which will be written to the held ByteSinks.

Implements MFM::ByteSink.


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