ITS
LocationTableEntry.h
Go to the documentation of this file.
1 
7 #ifndef LocationTableEntry_H
8 #define LocationTableEntry_H
9 
10 #include <QObject>
11 #include <stdlib.h>
12 #include <LongPositionVector.h>
13 
15 {
16 public:
32  LocationTableEntry(LongPositionVector lpv, quint8 version, quint8 stationType, uchar* llAddr, bool* isNeighbour, bool lsPending, quint32 lastTimestamp, quint16 sequenceNumber);
37 
38 
39  /* Getters */
44  bool* isNeighbour() const {return m_isNeighbour;}
49  quint32 lastTimestamp() const {return m_lastTimestamp;}
54  quint8 version() const {return m_version;}
59  quint8 stationType() const {return m_stationType;}
64  uchar* llAddr() {return m_llAddr;}
70  uchar llAddr(int i) const {if(i < 0 || i > 6)return m_llAddr[0];return m_llAddr[i];}
80  bool isPending() const {return m_lsPending;}
85  quint16 sequenceNumber() const {return m_sequenceNumber;}
90  bool neverReceived() const {return m_neverReceived;}
91 
92  /* Setters */
97  void setLastTimestamp(quint32 lastReceivedTimestamp){m_lastTimestamp = lastReceivedTimestamp;}
112  void setLlAddr(uchar* llAddr) {for(int i=0;i < 6;i++) m_llAddr[i] = llAddr[i];}
122  void setIsNeighbour(bool isNeighbour) {if(m_isNeighbour != 0) *m_isNeighbour = isNeighbour; else {m_isNeighbour = (bool*) calloc(1, sizeof 1); *m_isNeighbour = isNeighbour;}}
127  void setLsPending(bool lsPending) {m_lsPending = lsPending;}
138 
142  void print();
143 
144 private:
146  quint8 m_version;
149  uchar m_llAddr[6];
157 };
158 
159 #endif // LocationTableEntry_H
LongPositionVector m_lpv
uchar m_llAddr[6]
bool * isNeighbour() const
isNeighbour Is the ITS-S my neighbour?
bool m_lsPending
quint16 m_sequenceNumber
bool neverReceived() const
neverReceived Have I received the entry before?
LocationTableEntry()
LocationTableEntry LocationTableEntry constructor.
quint8 m_stationType
bool isPending() const
isPending Is the entry LS pending?
uchar * llAddr()
llAddr LL address getter.
void setSequenceNumber(quint16 sequenceNumber)
setSequenceNumber Entry sequence number setter.
quint8 m_version
void setNeverReceived(bool neverReceived)
setNeverReceived neverReceived setter.
void setIsNeighbour(bool isNeighbour)
setIsNeighbour isNeighbour setter.
void setLongPositionVector(LongPositionVector lpv)
setLongPositionVector LPV setter.
quint8 version() const
version Version getter.
quint8 stationType() const
stationType Station type getter.
void setLlAddr(uchar *llAddr)
setLlAddr LL address setter.
void setStationType(quint8 stationType)
setStationType Station type setter.
LongPositionVector longPositionVector() const
longPositionVector LPV getter.
uchar llAddr(int i) const
llAddr LL address specific byte getter.
void setLastTimestamp(quint32 lastReceivedTimestamp)
setLastTimestamp Entry last timestamp setter.
quint32 lastTimestamp() const
lastTimestamp Last entry timestamp getter.
LPV definition.
void print()
print Prints the entry informations.
bool * m_isNeighbour
~LocationTableEntry()
~LocationTableEntry LocationTableEntry destructor.
void setVersion(quint8 version)
setVersion Version setter.
quint16 sequenceNumber() const
sequenceNumber Entry sequence number getter.
quint32 m_lastTimestamp
void setLsPending(bool lsPending)
setLsPending lsPending setter.
bool m_neverReceived