Class CBlockedBuffer Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: Custom Code in Header After Class DeclarationNext page: Custom Code in Header Private Section    Show member index
Custom Code in Header Public Section Declared in:
BlockedBuffer.h

'Custom Code' icon -- Shortcut to top of page. Custom Code

//The data class
class CBlockedData
{
public:
    //Get number of calls
    int GetNumberOfCalls()const
    {
        return ++m_iCalls;
    }

    //Get the data
    char* GetData()const
    {
        return m_pData;
    }

    //Get the data size
    int GetDataSize()const
    {
        return m_iDataSize;
    }

    //ctor and dtor
    CBlockedData(const char* pData,
                 int iDataSize) : m_pData(NULL),
                                  m_iDataSize(iDataSize),
                                  m_iCalls(1)
    {
        //Do we have data
        if (pData &&
            m_iDataSize)
        {
            //Allocate and copy
            m_pData=new char[m_iDataSize];
            memcpy(m_pData,
                   pData,
                   m_iDataSize);
        }
    }

    CBlockedData(const CBlockedData& rData) : m_pData(NULL),
                                              m_iDataSize(rData.m_iDataSize),
                                              m_iCalls(rData.m_iCalls)
    {
        //Do we have data
        if (m_iDataSize && rData.m_pData)
        {
            //Allocate and copy
            m_pData=new char[m_iDataSize];
            memcpy(m_pData,
                   rData.m_pData,
                   m_iDataSize);
        }
    }

    virtual ~CBlockedData()
    {
        //Delete the data
        delete [] m_pData;
    }
private:
    //Our data
    char* m_pData;

    //Data size
    int m_iDataSize;

    //calls count
    mutable int m_iCalls;
};

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CSpoofBase  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.