PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBFIFO
Wrapper Class for the IFIFO interface.
#include <SFBFIFO.h.hpp>
class SFBFIFO : public SFBPort;
SFMTYPEDEFWRAPPER(SFBFIFO)

Inheritance diagram

 Inheritance diagram of SFBFIFOClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
X X O O

Reference

BREW API IFIFO

Member

Public Functions
SInt32 Flush( SInt32 buf )
Consumes bytes from the FIFO. This is equivalent to SFBFIFO::Read(), except no copy is performed.
SFCError GetBufSize( UInt32Ptr size )
Returns the currently allocated buffer size.
SFCError GetBufUsed( UInt32Ptr count )
Returns the current number of bytes available for reading.
static
SFBFIFOSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBFIFO instance.
static
SFBFIFOSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBFIFO instance.
SFCError OpenEx( ACharConstPtr name , UInt16 mode )
Opens a FIFO for reading and/or writing.
SFCError OpenEx( SFXAnsiStringConstRef name , UInt16 mode )
Opens a FIFO for reading and/or writing.
Void ReadableEx( SFXCallbackPtr callback , PFNNOTIFY notify , VoidPtr data )
schedules a callback to be called when SFBFIFO::Read()is able to return something other than AEEPORT_WAIT.
SFCError SetBufSize( UInt32 size )
Sets the allocated buffer size.
Void WriteableEx( SFXCallbackPtr callback , PFNNOTIFY notify , VoidPtr data )
Schedule a function to be called when SFBFIFO::Write() would return something other than AEEPORT_WAIT.
SFCError Close( Void ) (inherits from SFBPort)
Close an opened port or stops a open in progress.
static
Bool
Exhausted( SInt32 code ) (inherits from SFBSource)
Determine if a SFBSource, a SFBPeek, or a SFBGetLine is out of data.
SFCError GetLastError( Void ) (inherits from SFBPort)
Return the last error that occurred with the SFBPort.
SFCError IOCtl( SInt32 option , UInt32 val ) (inherits from SFBPort)
Allow some control over the behaviour of an SFBPort.
SFCError Open( ACharConstPtr port ) (inherits from SFBPort)
Open the specified prt.
SFCError Open( SFXAnsiStringConstRef port ) (inherits from SFBPort)
Open the specified prt.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SInt32 Read( VoidPtr buf , SInt32 size ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
SInt32 Read( SFXBufferPtr buf ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
Void Readable( SFXCallbackPtr callback ) (inherits from SFBSource)
Schedule a callback to be called when SFBSource::Read() is able to return something other than ISOURCE_WAIT.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SInt32 Write( ACharConstPtr port , SInt32 bufSize ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXAnsiStringConstRef buf ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXBufferConstRef buf ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
Void Writeable( SFXCallbackPtr callback ) (inherits from SFBPort)
Schedule a function to be called when SFBPort::Write() would return something other than AEEPORT_WAIT.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBFIFO::Flush
Consumes bytes from the FIFO. This is equivalent to SFBFIFO::Read(), except no copy is performed.
[ public ]
SInt32 Flush(
    SInt32 buf   // number of bytes to flush
);

Return value

If it is completed successfuly, it returns the number of flushed bytes.

Reference

BREW API IFIFO_Flush | SFBSource::Read


SFBFIFO::GetBufSize
Returns the currently allocated buffer size.
[ public ]
SFCError GetBufSize(
    UInt32Ptr size   // pointer to an uint32 to be filled in with the allocated buffer size
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • FIFO not open: SFERR_INVALID_STATE
  • size pointer is invalid: SFERR_INVALID_MEMORY

Reference

BREW API IFIFO_GetBufSize | SFBFIFO::SetBufSize


SFBFIFO::GetBufUsed
Returns the current number of bytes available for reading.
[ public ]
SFCError GetBufUsed(
    UInt32Ptr count   // pointer to an uint32 to be filled in with the current number of bytes available for reading
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • FIFO not open: SFERR_INVALID_STATE
  • count pointer is invalid: SFERR_INVALID_MEMORY

Reference

BREW API IFIFO_GetBufUsed | SFBSource::Read


SFBFIFO::NewInstance
Create a new SFBFIFO instance.
[ public, static ]
SFBFIFOSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBFIFOSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBFIFO::OpenEx
Opens a FIFO for reading and/or writing.
[ public ]
SFCError OpenEx(
    ACharConstPtr name   // null-terminated FIFO name
    UInt16 mode          // AEEFIFO_MODE_R or AEEFIFO_MODE_W 
);
[ public ]
SFCError OpenEx(
    SFXAnsiStringConstRef name   // FIFO name
    UInt16 mode                  // AEEFIFO_MODE_R or AEEFIFO_MODE_W 
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • FIFO not open: SFERR_INVALID_STATE
  • name pointer is invalid: SFERR_INVALID_MEMORY
  • If no privilege : EPRIVLEVEL

Reference

BREW API IFIFO_OpenEx | SFBPort::Open | SFBPort::Close


SFBFIFO::ReadableEx
schedules a callback to be called when SFBFIFO::Read()is able to return something other than AEEPORT_WAIT.
[ public ]
Void ReadableEx(
    SFXCallbackPtr callback   // pointer to callback function
    PFNNOTIFY notify          // pinter to user callback function
    VoidPtr data              // user data to use whie call the notify() function
);

Reference

BREW API IFIFO_ReadableEx | PFNNOTIFY | SFBSource::Read | SFBSource::Readable


SFBFIFO::SetBufSize
Sets the allocated buffer size.
[ public ]
SFCError SetBufSize(
    UInt32 size   // the desired buffer size
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • FIFO not open: SFERR_INVALID_STATE
  • FIFO not open for write : EPRIVLEVEL

Reference

BREW API IFIFO_SetBufSize | SFBFIFO::SetBufSize


SFBFIFO::WriteableEx
Schedule a function to be called when SFBFIFO::Write() would return something other than AEEPORT_WAIT.
[ public ]
Void WriteableEx(
    SFXCallbackPtr callback   // pointer to callback function
    PFNNOTIFY notify          // pointer to user callback function
    VoidPtr data              // user data to use while calling the notify() function
);

Reference

BREW API IFIFO_WriteableEx | PFNNOTIFY | SFBPort::Write | SFBPort::Writeable