src/app/dvb/streamer/station.cpp
bool Station::isInUse() throw()
{
    bool res = false;

    try
    {
        // `klk_app_dvb_station_getlock` (
        // IN station VARCHAR(40),
        // OUT return_value INT

        db::Parameters params;
        params.add("@station", getUUID());
        params.add("@return_value");
        db::DB db(m_factory);
        db.connect();
        db::Result db_result = db.callSimple(
            "klk_app_dvb_station_getlock",
            params);

        res = (db_result["@return_value"].toInt() == 1);
    }
    catch (...)
    {
        klk_log(KLKLOG_ERROR, "Got an error while determine "
                "dvb-streamer station in use info");
        return false; // not in use
    }

    return res;
}
// Tests if the info is used by somebody
// Checks DB to retrive the state
Tests if the info is used by somebody
Checks DB to retrive the state
Tests if the info is used by somebody Checks DB to retrive the state
bool Station::isInUse() throw()
{
    bool res = false;
    try
    {
        db::Parameters params;
        params.add("@station", getUUID());
        params.add("@return_value");
        db::DB db(m_factory);
        db.connect();
        db::Result db_result = db.callSimple(
            "klk_app_dvb_station_getlock",
            params);
        res = (db_result["@return_value"].toInt() == 1);
    }
    catch (...)
    {
        klk_log(KLKLOG_ERROR, "Got an error while determine "
                "dvb-streamer station in use info");
        return false; 
    }
    return res;
}
bool Station :: isInUse ( ) throw ( ) { bool res = false ; try { db :: Parameters params ; params . add ( " " , getUUID ( ) ) ; params . add ( " " ) ; db :: DB db ( m_factory ) ; db . connect ( ) ; db :: Result db_result = db . callSimple ( " " , params ) ; res = ( db_result [ " " ] . toInt ( ) == 1 ) ; } catch ( ... ) { klk_log ( KLKLOG_ERROR , " " " " ) ; return false ; } return res ; }
Tests if the info is used by somebody
Checks DB to retrive the state
Tests if the info is used by somebody Checks DB to retrive the state
// `klk_app_dvb_station_getlock` ( // IN station VARCHAR(40), // OUT return_value INT // not in use