#include <IPCamera.h>
Inheritance diagram for prip::IPCamera:
This class provides functionality for communication via HTTP. HTTP Basic Authentication is implemented for this class.
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. | |
IPCamera & | operator= (const IPCamera &other) |
Assignment operator. | |
virtual | ~IPCamera (void) |
destructor | |
void | post (std::string site, const std::vector< std::string > ¶meters, 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 |
prip::IPCamera::IPCamera | ( | std::string | address, | |
int | port, | |||
std::string | username = "" , |
|||
std::string | password = "" | |||
) | [inline] |
Constructor.
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.
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] |
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
)
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.
Implemented in prip::ViscaIP.
pt::ipstream& prip::IPCamera::getResult | ( | void | ) | [inline] |
Assignment operator.
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
)
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
)
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
password | new password |
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
username | new username; if username == "", HTTP Basic Authentication is turned off |
Definition at line 289 of file IPCamera.h.
std::string prip::IPCamera::mAddress [private] |
Definition at line 321 of file IPCamera.h.
pt::ipstream prip::IPCamera::mClient [protected] |
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.