prip::IPCamera Class Reference

#include <IPCamera.h>

Inheritance diagram for prip::IPCamera:

prip::ViscaIP List of all members.

Detailed Description

Basic class for IP cameras.

This class provides functionality for communication via HTTP. HTTP Basic Authentication is implemented for this class.

Author:
blau

Definition at line 179 of file IPCamera.h.

Public Member Functions

 IPCamera (std::string address, int port, std::string username="", std::string password="")
 Constructor.
 IPCamera (const IPCamera &other)
 Copy Constructor.
IPCameraoperator= (const IPCamera &other)
 Assignment operator.
virtual ~IPCamera (void)
 destructor
void post (std::string site, const std::vector< std::string > &parameters, const std::vector< std::string > &values, bool close=false)
 posts data to the web server.
void post (std::string site, std::string parameter, std::string value, bool close=false)
 posts data to the web server.
void get (const std::string site, bool close=false)
 get data from the web server.
void setUsername (const std::string username)
 set a new username for HTTP Basic Authentication
void setPassword (const std::string password)
 set a new password for HTTP Basic authentication
pt::ipstream & getResult (void)
virtual std::string getImage (void)=0
 This pure virtual function should return the raw JPEG Image from the camera.

Protected Attributes

pt::ipstream mClient
 used for connection to the camera

Private Member Functions

 IPCamera (void)
 standard constructor is forbidden

Private Attributes

std::string mAddress
int mPort
std::string mUsername
std::string mPassword
std::string mCurrentImg


Constructor & Destructor Documentation

prip::IPCamera::IPCamera ( std::string  address,
int  port,
std::string  username = "",
std::string  password = "" 
) [inline]

Constructor.

Parameters:
address Address (IP or URL) of the IP-Camera
port Port of the IP-Camera
username (optional) username for basic authentification
password (optional) password for basic authentification

Definition at line 190 of file IPCamera.h.

prip::IPCamera::IPCamera ( const IPCamera other  )  [inline]

Copy Constructor.

Parameters:
other Instance of IP-Camera to copy

Definition at line 200 of file IPCamera.h.

virtual prip::IPCamera::~IPCamera ( void   )  [virtual]

destructor

prip::IPCamera::IPCamera ( void   )  [inline, private]

standard constructor is forbidden

Definition at line 319 of file IPCamera.h.


Member Function Documentation

void prip::IPCamera::get ( const std::string  site,
bool  close = false 
)

get data from the web server.

open connections are closed, when a site is requested from the IP camera this method only flushes the get command to the IP camera, it does not handle the response of the camera - this has to be done by the programmer (via mClient)

Parameters:
site site on the server (e.g. cgi script)
close if true, the connection is closed immediately after sending the get command

virtual std::string prip::IPCamera::getImage ( void   )  [pure virtual]

This pure virtual function should return the raw JPEG Image from the camera.

Returns:
current image (raw JPEG)
See also:
Util::raw2fipImage

Util::raw2IplImage

Implemented in prip::ViscaIP.

pt::ipstream& prip::IPCamera::getResult ( void   )  [inline]

Returns:
reference to mClient.
See also:
mClient

Definition at line 303 of file IPCamera.h.

IPCamera& prip::IPCamera::operator= ( const IPCamera other  )  [inline]

Assignment operator.

Parameters:
other Instance of IP-Camera to copy

Definition at line 210 of file IPCamera.h.

void prip::IPCamera::post ( std::string  site,
std::string  parameter,
std::string  value,
bool  close = false 
) [inline]

posts data to the web server.

open connections are closed, when data is posted to the IP camera this method only flushes the post command to the IP camera, it does not handle the response of the camera - this has to be done by the programmer (via mClient)

Parameters:
site site on the server (e.g. cgi script)
parameter parameter that should be posted
value values of the posted parameter
close if true, the connection is closed immediately after the post command is sent

Definition at line 261 of file IPCamera.h.

void prip::IPCamera::post ( std::string  site,
const std::vector< std::string > &  parameters,
const std::vector< std::string > &  values,
bool  close = false 
)

posts data to the web server.

open connections are closed, when data is posted to the IP camera this method only flushes the post command to the IP camera, it does not handle the response of the camera - this has to be done by the programmer (via mClient)

Parameters:
site site on the server (e.g. cgi script)
parameters vector of parameters that should be posted
values vector of values of the parameters
close if true, the connection is closed immediately after the post command is sent

void prip::IPCamera::setPassword ( const std::string  password  )  [inline]

set a new password for HTTP Basic authentication

Parameters:
password new password
See also:
setUsername

Definition at line 296 of file IPCamera.h.

void prip::IPCamera::setUsername ( const std::string  username  )  [inline]

set a new username for HTTP Basic Authentication

Parameters:
username new username; if username == "", HTTP Basic Authentication is turned off
See also:
setPassword

Definition at line 289 of file IPCamera.h.


Member Data Documentation

std::string prip::IPCamera::mAddress [private]

Definition at line 321 of file IPCamera.h.

pt::ipstream prip::IPCamera::mClient [protected]

used for connection to the camera

Definition at line 331 of file IPCamera.h.

std::string prip::IPCamera::mCurrentImg [private]

Definition at line 327 of file IPCamera.h.

std::string prip::IPCamera::mPassword [private]

Definition at line 325 of file IPCamera.h.

int prip::IPCamera::mPort [private]

Definition at line 322 of file IPCamera.h.

std::string prip::IPCamera::mUsername [private]

Definition at line 324 of file IPCamera.h.


The documentation for this class was generated from the following file:
Generated on Thu Nov 30 00:34:23 2006 for PRIP by  doxygen 1.4.7