⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clsparportdev.cpp

📁 set of classes for parallel port device access
💻 CPP
字号:
#include "clsparportdev.h"std::map<std::string,clsEpp19*> clsParportDev::m_mapDevices;clsEpp19*                       clsParportDev::m_pDefaultDevice = 0;//#############################################################################clsEpp19*   clsParportDev::Instance    ( const std::string& rDeviceName ){    if ( !rDeviceName.size() )        return m_pDefaultDevice;    std::map<std::string,clsEpp19*>::iterator oIt = m_mapDevices.find ( rDeviceName );    if ( oIt != m_mapDevices.end() )        return oIt->second;    clsEpp19* pDev = new clsEpp19 ( rDeviceName.c_str() );    if ( pDev )        m_mapDevices[rDeviceName] = pDev;    return pDev;}//#############################################################################void        clsParportDev::Destroy     ( const std::string& rDeviceName ){    if ( ! rDeviceName.size() )    {        for ( std::map<std::string,clsEpp19*>::iterator oIt = m_mapDevices.begin();              oIt != m_mapDevices.end(); ++oIt )        {            delete oIt->second;        }        m_mapDevices.clear();        m_pDefaultDevice = 0;    }    else    {        std::map<std::string,clsEpp19*>::iterator oIt = m_mapDevices.find ( rDeviceName );        if ( oIt != m_mapDevices.end() )        {            if ( m_pDefaultDevice == oIt->second )                m_pDefaultDevice = 0;            delete oIt->second;            m_mapDevices.erase ( oIt );        }    }}//#############################################################################int         clsParportDev::SetDefault  ( const std::string& rDeviceName ){    int iRet = 1;    if ( ! rDeviceName.size() )    {        std::map<std::string,clsEpp19*>::iterator oIt = m_mapDevices.find ( rDeviceName );        if ( oIt != m_mapDevices.end() )        {            m_pDefaultDevice = oIt->second;            iRet = 0;        }    }    return iRet;}//#############################################################################

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -