Back to index

im-sdk  12.3.91
Public Member Functions | Private Member Functions | Private Attributes | Friends
IIIMPTrans Class Reference

#include <IIIMPTrans.hh>

Collaboration diagram for IIIMPTrans:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IIIMPTrans (IMSocketTrans *pimst)
 ~IIIMPTrans ()
bool send (IIIMP_message *pmes)
IIIMP_messagereceive ()
bool open_p ()
IIIMP_data_s * get_data_s ()
int get_fd () const

Private Member Functions

 IIIMPTrans (const IIIMPTrans &)
IIIMPTransoperator= (const IIIMPTrans &a)

Private Attributes

bool open
IMSocketTranspimst
IIIMP_data_s * pimplibstate
IIIMF_streampstream

Friends

IIIMF_status IIIMPTrans_read (IIIMF_stream_private, void *, size_t)
IIIMF_status IIIMPTrans_write (IIIMF_stream_private, const void *, size_t)

Detailed Description

Definition at line 18 of file IIIMPTrans.hh.


Constructor & Destructor Documentation

IIIMPTrans::IIIMPTrans ( const IIIMPTrans ) [private]

Definition at line 40 of file IIIMPTrans.cpp.

Here is the call graph for this function:

Definition at line 50 of file IIIMPTrans.cpp.

Here is the call graph for this function:


Member Function Documentation

IIIMP_data_s* IIIMPTrans::get_data_s ( ) [inline]

Definition at line 38 of file IIIMPTrans.hh.

    { return pimplibstate; }
int IIIMPTrans::get_fd ( ) const [inline]

Definition at line 40 of file IIIMPTrans.hh.

    { return pimst->get_fd(); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool IIIMPTrans::open_p ( ) [inline]

Definition at line 35 of file IIIMPTrans.hh.

    { return open; }

Here is the caller graph for this function:

IIIMPTrans& IIIMPTrans::operator= ( const IIIMPTrans a) [private]

Definition at line 25 of file IIIMPTrans.cpp.

{
    IIIMF_status st;
    IIIMP_message *pmes;
 
    st = iiimf_stream_receive(pstream, pimplibstate, &pmes);
    if (st != IIIMF_STATUS_SUCCESS) return NULL;
#ifdef DEBUG
    fputs("C->S", stdout);
    iiimp_message_print(pimplibstate, pmes);
#endif

    return pmes;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool IIIMPTrans::send ( IIIMP_message pmes)

Definition at line 9 of file IIIMPTrans.cpp.

{
#ifdef DEBUG
    fputs("S->C", stdout);
    iiimp_message_print(pimplibstate, pmes);
#endif
    if (iiimf_stream_send(pstream, pimplibstate, pmes)
       != IIIMF_STATUS_SUCCESS)
       return false;

    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

IIIMF_status IIIMPTrans_read ( IIIMF_stream_private  ,
void *  ,
size_t   
) [friend]

Definition at line 58 of file IIIMPTrans.cpp.

{
    int st;
    int n = nbyte;
    unsigned char *p = (unsigned char*) buf;
    IIIMPTrans *pimt = (IIIMPTrans*) ptrans;
    while (n > 0) {
       // TODO!! (NOWAIT support)
       st = pimt->pimst->recv(p, n);
       if (st == -1) {
           if (errno = EINTR) continue;
           return IIIMF_STATUS_STREAM_RECEIVE;
       } else if (st == 0) {
           // socket is closed.
           pimt->open = false;
           return IIIMF_STATUS_STREAM_RECEIVE;
       }
       n -= st;
       p += st;
    }

    return IIIMF_STATUS_SUCCESS;
}
IIIMF_status IIIMPTrans_write ( IIIMF_stream_private  ,
const void *  ,
size_t   
) [friend]

Definition at line 87 of file IIIMPTrans.cpp.

{
    int st;
    int n = nbyte;
    const unsigned char *p = (const unsigned char*) buf;
    IIIMPTrans *pimt = (IIIMPTrans*) ptrans;

    while (n > 0) {
       // TODO!!
       st = pimt->pimst->send(p, n);
       if (st == -1) {
           if (errno = EINTR) continue;
           return IIIMF_STATUS_STREAM_RECEIVE;
       }
       n -= st;
       p += st;
    }

    return IIIMF_STATUS_SUCCESS;
}

Member Data Documentation

bool IIIMPTrans::open [private]

Definition at line 19 of file IIIMPTrans.hh.

IIIMP_data_s* IIIMPTrans::pimplibstate [private]

Definition at line 21 of file IIIMPTrans.hh.

Definition at line 20 of file IIIMPTrans.hh.

Definition at line 22 of file IIIMPTrans.hh.


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