#ifndef LOCATION_TABLE_H
#define LOCATION_TABLE_H

#include <map>
#include <memory>

class OCTETSTRING;

namespace LibItsGeoNetworking__TypesAndValues {
  class LongPosVector;
}

class LocationTable {
  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:
  LocationTable() : _entries_by_times(), _entries_by_mids() { };
  virtual ~LocationTable() { }; // 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(); };
};

#endif
