qtms/src/qtmsmodemsinkimpl.cpp
changeset 51 e61a04404bdf
parent 27 cbb1bfb7ebfb
equal deleted inserted replaced
44:d141fc1ad77b 51:e61a04404bdf
    21 
    21 
    22 using namespace QTMS;
    22 using namespace QTMS;
    23 using namespace TMS;
    23 using namespace TMS;
    24 
    24 
    25 QTMSModemSinkImpl::QTMSModemSinkImpl()
    25 QTMSModemSinkImpl::QTMSModemSinkImpl()
    26     {
    26 {
    27     }
    27 }
    28 
    28 
    29 QTMSModemSinkImpl::~QTMSModemSinkImpl()
    29 QTMSModemSinkImpl::~QTMSModemSinkImpl()
    30     {
    30 {
    31     }
    31 }
    32 
    32 
    33 gint QTMSModemSinkImpl::Create(QTMSSink*& qsink,TMS::TMSSink*& tmssink)
    33 gint QTMSModemSinkImpl::Create(QTMSSink*& qsink, TMS::TMSSink*& tmssink)
    34     {
    34 {
    35     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    35     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    36     QTMSModemSinkImpl* self = new QTMSModemSinkImpl();
    36     QTMSModemSinkImpl* self = new QTMSModemSinkImpl();
    37     if (self)
    37     if (self) {
    38         {
       
    39         ret = self->PostConstruct();
    38         ret = self->PostConstruct();
    40         if (ret != QTMS_RESULT_SUCCESS)
    39         if (ret != QTMS_RESULT_SUCCESS) {
    41             {
       
    42             delete self;
    40             delete self;
    43             self = NULL;
    41             self = NULL;
    44             }
    42         }
    45         self->iSink = tmssink;
    43         self->iSink = tmssink;
    46         }
    44     }
    47     qsink = self;
    45     qsink = self;
    48     return ret;
    46     return ret;
    49     }
    47 }
    50 
    48 
    51 gint QTMSModemSinkImpl::PostConstruct()
    49 gint QTMSModemSinkImpl::PostConstruct()
    52     {
    50 {
    53     gint ret(QTMS_RESULT_SUCCESS);
    51     gint ret(QTMS_RESULT_SUCCESS);
    54     return ret;
    52     return ret;
    55     }
    53 }
    56 
    54 
    57 gint QTMSModemSinkImpl::GetSink(TMS::TMSSink*& tmssink)
    55 gint QTMSModemSinkImpl::GetSink(TMS::TMSSink*& tmssink)
    58     {
    56 {
    59     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    57     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    60     if (iSink)
    58     if (iSink) {
    61         {
       
    62         tmssink = iSink;
    59         tmssink = iSink;
    63         ret = QTMS_RESULT_SUCCESS;
    60         ret = QTMS_RESULT_SUCCESS;
    64         }
    61     }
    65     return ret;
    62     return ret;
    66     }
    63 }
    67 
    64 
    68 // End of file
    65 // End of file