location_table.hh
Go to the documentation of this file.
#pragma once
#include <map>
#include <memory>
class OCTETSTRING;
namespace LibItsGeoNetworking__TypesAndValues {
class LongPosVector;
}
class location_table {
std::map<const unsigned long, std::shared_ptr<LibItsGeoNetworking__TypesAndValues::LongPosVector> > _entries_by_times;
std::map<const std::string, std::shared_ptr<LibItsGeoNetworking__TypesAndValues::LongPosVector> > _entries_by_mids;
public:
explicit location_table() : _entries_by_times(), _entries_by_mids() { };
virtual ~location_table() { }; // std::shared_ptr provides memory free process
const bool has_entry(const OCTETSTRING& p_mid) const;
void add_entry(const LibItsGeoNetworking__TypesAndValues::LongPosVector& p_long_pos_vector);
const LibItsGeoNetworking__TypesAndValues::LongPosVector* get_entry(const OCTETSTRING & p_mid) const;
inline const bool empty() const { return _entries_by_mids.empty(); };
inline void reset() { _entries_by_mids.clear(); _entries_by_times.clear(); };
}; // End of class location_table
location_table::reset
void reset()
Purge the location table.
Definition: location_table.hh:74
location_table::location_table
location_table()
Default constructor.
Definition: location_table.hh:36
LibItsGeoNetworking__TypesAndValues
Definition: geonetworking_layer.hh:32
location_table
This class provides description of GeoNetworking table.
Definition: location_table.hh:28
location_table::empty
const bool empty() const
Indicates if the table is empty.
Definition: location_table.hh:68
location_table::_entries_by_mids
std::map< const std::string, std::shared_ptr< LibItsGeoNetworking__TypesAndValues::LongPosVector > > _entries_by_mids
Definition: location_table.hh:30
location_table::_entries_by_times
std::map< const unsigned long, std::shared_ptr< LibItsGeoNetworking__TypesAndValues::LongPosVector > > _entries_by_times
Definition: location_table.hh:29
location_table::~location_table
virtual ~location_table()
Default destructor.
Definition: location_table.hh:40