Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*!
* \file http_layer.hh
* \brief Header file for ITS HTTP protocol layer.
* \author ETSI STF549
* \copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
* \version 0.1
*/
#pragma once
#include <memory>
#include "TLayer.hh"
#include "HttpCodec.hh"
namespace LibItsHttp__TypesAndValues {
class HeaderLines; //! Forward declaration of TITAN class
}
class OCTETSTRING; //! Forward declaration of TITAN class
/*!
* \class http_layer
* \brief This class provides a factory class to create an udp_layer class instance
*/
class http_layer : public Layer {
Params _params;
HttpCodec _codec;
std::unique_ptr<LibItsHttp__TypesAndValues::HeaderLines> _headers;
public: //! \publicsection
/*!
* \brief Specialised constructor
* Create a new instance of the http_layer class
* \param[in] p_type \todo
* \param[in] p_param \todo
*/
http_layer() : Layer(), _params(), _headers(nullptr) {};
/*!
* \brief Specialised constructor
* Create a new instance of the http_layer class
* \param[in] p_type \todo
* \param[in] p_param \todo
*/
http_layer(const std::string& p_type, const std::string& p_param);
/*!
* \brief Default destructor
*/
virtual ~http_layer() { _headers.reset(nullptr); };
/*!
* \virtual
* \fn void sendData(OCTETSTRING& data, Params& params);
* \brief Send bytes formated data to the lower layers
* \param[in] p_data The data to be sent
* \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
*/
virtual void sendData(OCTETSTRING& data, Params& params);
/*!
* \virtual
* \fn void receiveData(OCTETSTRING& data, Params& params);
* \brief Receive bytes formated data from the lower layers
* \param[in] p_data The bytes formated data received
* \param[in] p_params Some lower layers parameters values when data was received
*/
virtual void receiveData(OCTETSTRING& data, Params& info);
}; // End of class http_layer