Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
kvh::KvhPacketStorage Class Reference

#include <kvh_geo_fog_3d_packet_storage.hpp>

Public Member Functions

int AddPacket (packet_id_e)
 
bool Contains (packet_id_e)
 
template<class T >
int GetPacket (packet_id_e _packetId, T &_packet)
 
int Init (KvhPacketRequest &)
 Correctly sets up a KvhPacketMap for the requested packets. More...
 
 KvhPacketStorage ()
 
bool PacketIsUpdated (packet_id_e)
 
int SetPacketUpdated (packet_id_e, bool)
 
int Size ()
 
template<class T >
int UpdatePacket (packet_id_e _packetId, T &_packetData)
 

Static Public Member Functions

static void PrintPacketSizes ()
 
static void PrintPacketTypes ()
 

Private Attributes

KvhPacketMap packetMap_
 

Detailed Description

Definition at line 67 of file kvh_geo_fog_3d_packet_storage.hpp.

Constructor & Destructor Documentation

◆ KvhPacketStorage()

kvh::KvhPacketStorage::KvhPacketStorage ( )

Definition at line 37 of file packet_storage.cpp.

Member Function Documentation

◆ AddPacket()

int kvh::KvhPacketStorage::AddPacket ( packet_id_e  _packetId)
Parameters
_packetIdthe id of the packet to add to the map
Returns
0 = success, <0 on error

Definition at line 72 of file packet_storage.cpp.

◆ Contains()

bool kvh::KvhPacketStorage::Contains ( packet_id_e  _packetId)
// Create and init packet storage
if (packetStorage.Contains(packetId))
// Do stuff
Parameters
[in]_packetIdThe packet id we are looking
Returns
bool True if in our map, false otherwise

Definition at line 179 of file packet_storage.cpp.

◆ GetPacket()

template<class T >
int kvh::KvhPacketStorage::GetPacket ( packet_id_e  _packetId,
T &  _packet 
)
inline
// Create and init packet storage
int error = packetStorage.GetPacket(packetId, packetStruct)
if (error == 0) // Do stuff

Definition at line 151 of file kvh_geo_fog_3d_packet_storage.hpp.

◆ Init()

int kvh::KvhPacketStorage::Init ( KvhPacketRequest _packRequest)

Correctly sets up a KvhPacketMap for the requested packets.

KvhPacketStorage packetStorage;
packetStorage.Init(initIdsVector);
Parameters
_packRequest[in] List of packets we'd like to request from the sensor
Returns
[int]:

1 = Warning, duplicate id found 0 = Success, -1 = Failure, unsupported id found

Definition at line 37 of file packet_storage.cpp.

◆ PacketIsUpdated()

bool kvh::KvhPacketStorage::PacketIsUpdated ( packet_id_e  _packetId)
if (packetStorage.PacketIsUpdated(packetId))
// Do stuff
Parameters
[in]_packetIdThe id associated with the packet we are checking for updates
Returns
bool True if the packet has updated, false if not updated, or packet not found in map

Definition at line 164 of file packet_storage.cpp.

◆ PrintPacketSizes()

void kvh::KvhPacketStorage::PrintPacketSizes ( )
static
kvh::KvhPacketStorage::PrintPacketSize();

Prints the sizes of all currently supported packets

Todo:
This maybe should be moved to global scope

Definition at line 211 of file packet_storage.cpp.

◆ PrintPacketTypes()

void kvh::KvhPacketStorage::PrintPacketTypes ( )
static

Prints the string types of all supported packets

Todo:
This maybe should be moved to global scope

Definition at line 198 of file packet_storage.cpp.

◆ SetPacketUpdated()

int kvh::KvhPacketStorage::SetPacketUpdated ( packet_id_e  _packetId,
bool  _updateStatus 
)
// Create and init packetStorage
packetStorage.SetPacketUpdated(packetId, true);
Parameters
[in]_packetIdThe packet we are setting the updated status of
[in]_updateStatusThe IsUpdated value for the packet
Returns
int 0 = Success -1 = Packet id not in map

Definition at line 148 of file packet_storage.cpp.

◆ Size()

int kvh::KvhPacketStorage::Size ( )
// Create and init packet storage
int size = packetStorage.Size();
Returns
The number of different packet types currently stored

Definition at line 188 of file packet_storage.cpp.

◆ UpdatePacket()

template<class T >
kvh::KvhPacketStorage::UpdatePacket ( packet_id_e  _packetId,
T &  _packetData 
)
inline
Parameters
_packetIdThe id of the packet we want to update
_packetDataA struct with data we want to update our storage to
Returns
int 0 = Success -1 = Passed in packet type is not same as packet id -2 = Map does not contain this packet type currently
KvhPacketStorage packetStorage;
packetStorage.Init(initIdsVector);
packet_type_t packet;
// Fill in data
packetStorage.updatePacket(packet_id, packet);

Definition at line 111 of file kvh_geo_fog_3d_packet_storage.hpp.

Member Data Documentation

◆ packetMap_

KvhPacketMap kvh::KvhPacketStorage::packetMap_
private

Map this class encapsulates. Maps packet id to a pair with a bool for if the packet is updated, and a pointer to the packet.

Definition at line 71 of file kvh_geo_fog_3d_packet_storage.hpp.


The documentation for this class was generated from the following files:


kvh_geo_fog_3d_driver
Author(s): Trevor Bostic , Zach LaCelle
autogenerated on Mon Feb 28 2022 22:39:54