qtms/src/qtmsmicsourceimpl.cpp
changeset 50 762d760dcfdf
parent 27 cbb1bfb7ebfb
equal deleted inserted replaced
48:b7b49303d0c0 50:762d760dcfdf
    21 
    21 
    22 using namespace QTMS;
    22 using namespace QTMS;
    23 using namespace TMS;
    23 using namespace TMS;
    24 
    24 
    25 QTMSMicSourceImpl::QTMSMicSourceImpl()
    25 QTMSMicSourceImpl::QTMSMicSourceImpl()
    26     {
    26 {
    27     }
    27 }
    28 
    28 
    29 QTMSMicSourceImpl::~QTMSMicSourceImpl()
    29 QTMSMicSourceImpl::~QTMSMicSourceImpl()
    30     {
    30 {
    31     }
    31 }
    32 
    32 
    33 gint QTMSMicSourceImpl::Create(QTMSSource*& qsource, TMS::TMSSource*& tmssource)
    33 gint QTMSMicSourceImpl::Create(QTMSSource*& qsource, TMS::TMSSource*& tmssource)
    34     {
    34 {
    35     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    35     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    36     QTMSMicSourceImpl* self = new QTMSMicSourceImpl();
    36     QTMSMicSourceImpl* self = new QTMSMicSourceImpl();
    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->iSource = tmssource;
    43         self->iSource = tmssource;
    46         }
    44     }
    47     qsource = self;
    45     qsource = self;
    48     return ret;
    46     return ret;
    49     }
    47 }
    50 
    48 
    51 gint QTMSMicSourceImpl::PostConstruct()
    49 gint QTMSMicSourceImpl::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 QTMSMicSourceImpl::GetSource(TMS::TMSSource*& tmssource)
    55 gint QTMSMicSourceImpl::GetSource(TMS::TMSSource*& tmssource)
    58     {
    56 {
    59     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    57     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    60     if (iSource)
    58     if (iSource) {
    61         {
       
    62         tmssource = iSource;
    59         tmssource = iSource;
    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