42 explicit Layer() : upperLayers(), lowerLayers(), type(
std::string(
"")) { };
51 explicit Layer(
const std::string& p_type) : upperLayers(), lowerLayers(), type(
std::string(p_type.begin(), p_type.end())) { };
59 std::for_each(lowerLayers.rbegin(), lowerLayers.rend(), [](
Layer* it) {
delete it; } );
80 if (p_layer != NULL) {
81 upperLayers.push_back(p_layer);
126 for (std::vector<Layer*>::const_iterator it = layers.cbegin(); it != layers.cend(); ++it) {
133 for (std::vector<Layer*>::const_iterator it = upperLayers.cbegin(); it != upperLayers.cend(); ++it) {
140 for (std::vector<Layer*>::const_iterator it = lowerLayers.cbegin(); it != lowerLayers.cend(); ++it) {
void toAllLayers(std::vector< Layer *> &layers, OCTETSTRING &data, Params ¶ms)
Definition: Layer.hh:125
Forward declaration of TITAN class.
Definition: Layer.hh:29
Layer()
Type description, it indicates the protocol type (e.g. CAM, DENM, GN, ETH, PCAP...)
Definition: Layer.hh:42
void deleteLayer()
Delete this layer.
Definition: Layer.hh:69
virtual void sendData(OCTETSTRING &p_data, Params &p_params)
Send bytes formated data to the lower layers.
Definition: Layer.hh:103
Header file for the parameter dictionary.
void receiveToAllLayers(OCTETSTRING &data, Params ¶ms)
Definition: Layer.hh:132
Layer(const std::string &p_type)
Specialized constructor Create a new instance of the Layer class with its type description.
Definition: Layer.hh:51
void removeUpperLayer(Layer *p_layer)
Remove the specified upper layer protocol from the list of the upper layer.
Definition: Layer.hh:92
void sendToAllLayers(OCTETSTRING &data, Params ¶ms)
Definition: Layer.hh:139
This class provides basic functionalities for an ITS dictionary.
Definition: Params.hh:21
const std::string & to_string() const
Remove the specified upper layer protocol from the list of the upper layer.
Definition: Layer.hh:122
std::string type
List of the lower protocol layers.
Definition: Layer.hh:34
std::vector< Layer * > lowerLayers
List of the upper protocol layers.
Definition: Layer.hh:31
std::vector< Layer * > upperLayers
Definition: Layer.hh:30
virtual void receiveData(OCTETSTRING &p_data, Params &p_params)
Receive bytes formated data from the lower layers.
Definition: Layer.hh:114
void addUpperLayer(Layer *p_layer)
Add a new layer in the list of the upper layer.
Definition: Layer.hh:79
virtual ~Layer()
Default destructor.
Definition: Layer.hh:57