/*! 
* 
* Copyright(c) 2010 Apogee Instruments, Inc. 
* \class ApgEthernet 
* \brief Wrapper that hides the switch between linux and windows ethernet io. 
* 
*/ 

#include "ApgEthernet.h" 
#include "IEthernetIO.h" 

#ifdef WIN32
#include "WinEthernetIO.h" 
#else
#include "LinuxEthernetIO.h" 
#endif

//////////////////////////// 
// CTOR 
ApgEthernet::ApgEthernet() : m_IoObj( NULL )
{ 

#ifdef WIN32
     m_IoObj = new WinEthernetIO();
#else
    m_IoObj = new LinuxEthernetIO();
#endif

} 

//////////////////////////// 
// DTOR 
ApgEthernet::~ApgEthernet() 
{ 
    delete m_IoObj;
    m_IoObj = NULL;
} 


//////////////////////////// 
//      HTTP   GET
void ApgEthernet::HttpGet( const std::string & Url, std::string & data) const
{
    m_IoObj->HttpGet(Url, data);
}

//////////////////////////// 
//      HTTP   GET
void ApgEthernet::HttpGet( const std::string & Url, std::vector<unsigned short> & data, 
                          const int numBytesExpected) const
{
    m_IoObj->HttpGet(Url, data, numBytesExpected);
} 
