/*
Header BitStreamQueue : Manage message received
Copyright (C) 2019 AleaJactaEst
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#ifndef BIT_STREAM_QUEUE_H
#define BIT_STREAM_QUEUE_H
#define SIZE_QUEUE_MESSAGE 6
#include "core/reference.h"
#include "modules/bitstream/bitstream.h"
class BitStreamField : public Reference
{
GDCLASS(BitStreamField, Reference)
protected:
static void _bind_methods();
private:
uint32_t _id;
Ref _msgin;
public:
uint32_t get_id() const { return this->_id; }
Ref get_msgin() { return this->_msgin; }
void put_id(uint32_t id) { this->_id = id; }
void put_msgin(const Ref & msgin) { this->_msgin = msgin; }
};
class BitStreamQueue : public Reference
{
GDCLASS(BitStreamQueue, Reference)
protected:
static void _bind_methods();
private:
Vector[ > _msg;
public:
BitStreamQueue();
~BitStreamQueue();
void clear();
int length();
bool is_index(uint32_t id);
int get_index(uint32_t id);
int put_bitstreamfield(Ref data);
Ref get_msg(int index);
Ref get_msg_withid(uint32_t id);
void erase_index(int index);
void erase_id(uint32_t id);
};
#endif // BIT_STREAM_QUEUE_H
]