Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __JAUS_CORE_LARGE_DATA_SET__H
00041 #define __JAUS_CORE_LARGE_DATA_SET__H
00042
00043 #include "jaus/core/header.h"
00044 #include "jaus/core/time.h"
00045 #include <map>
00046
00047 namespace JAUS
00048 {
00056 class JAUS_CORE_DLL LargeDataSet
00057 {
00058 public:
00065 class JAUS_CORE_DLL Key
00066 {
00067 public:
00068 Key(const Address& src = Address(),
00069 const UShort code = 0,
00070 const UInt pv = 0);
00071 Key(const Key& key);
00072 ~Key();
00073 void Update() const;
00074 bool operator<(const Key& key) const;
00075 bool operator<=(const Key& key) const;
00076 Key& operator=(const Key& key);
00077 Address mSourceID;
00078 UShort mMessageCode;
00079 ULong mPresenceVector;
00080 Byte mIdentifier;
00081 Packet mKey;
00082 };
00083 typedef std::map<UShort, Packet> Stream;
00084 typedef std::map<LargeDataSet::Key, LargeDataSet*> Map;
00085 LargeDataSet();
00086 ~LargeDataSet();
00087 void Clear();
00088 bool AddPacket(const Packet& message);
00089 bool AddPacket(const Header& header,
00090 const UShort messageCode,
00091 const Packet& packet);
00092 static void CreateLargeDataSet(const Header& header,
00093 const UShort messageCode,
00094 const Packet& payload,
00095 Packet::List& stream,
00096 Header::List& streamHeaders,
00097 const Packet* transportHeader = NULL,
00098 const UShort maxPayloadSize = 1437,
00099 const UShort startingSequenceNumber = 0);
00100 static bool MergeLargeDataSet(Header& header,
00101 UShort& messageCode,
00102 Packet& payload,
00103 const Packet::List& stream,
00104 const Packet* transportHeader = NULL);
00105 static bool MergeLargeDataSet(Header& header,
00106 UShort& messageCode,
00107 Packet& payload,
00108 const Stream& stream,
00109 const Packet* transportHeader = NULL);
00110 Header mHeader;
00111 UShort mMessageCode;
00112 bool mHaveLastFlag;
00113 bool mCompleteFlag;
00114 Stream mStream;
00115 std::set<UShort> mMissing;
00116 Time::Stamp mUpdateTimeMs;
00117 };
00118 }
00119
00120 #endif
00121
00122