RSB
0.7.0
|
Instances of this class store fragments of partially received, fragmented notifications for later assembly. More...
#include <Assembly.h>
Public Member Functions | |
Assembly (rsb::protocol::FragmentedNotificationPtr n) | |
~Assembly () | |
rsb::protocol::NotificationPtr | getCompleteNotification () const |
Returns the completed notification built from all fragments. | |
bool | add (rsb::protocol::FragmentedNotificationPtr n) |
Adds a newly received fragment to this Assembly and tells whether this completed the assembly. | |
bool | isComplete () const |
unsigned int | age () const |
Age of the assembly as seconds. |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
unsigned int | receivedParts |
std::vector < rsb::protocol::FragmentedNotificationPtr > | store |
boost::posix_time::ptime | birthTime |
Instances of this class store fragments of partially received, fragmented notifications for later assembly.
Definition at line 54 of file Assembly.h.
rsb::spread::Assembly::Assembly | ( | rsb::protocol::FragmentedNotificationPtr | n | ) |
rsb::spread::Assembly::~Assembly | ( | ) |
Definition at line 58 of file Assembly.cpp.
bool rsb::spread::Assembly::add | ( | rsb::protocol::FragmentedNotificationPtr | n | ) |
Adds a newly received fragment to this Assembly and tells whether this completed the assembly.
n | fragment to add |
true
if the assembly is now completed, else false
protocol::ProtocolException | if there is already a fragment in this Assembly with the same fragment number |
Definition at line 78 of file Assembly.cpp.
References isComplete(), logger, receivedParts, and store.
Referenced by Assembly().
unsigned int rsb::spread::Assembly::age | ( | ) | const |
Age of the assembly as seconds.
The age is the elapsed time since this instance was created.
Definition at line 102 of file Assembly.cpp.
References birthTime.
NotificationPtr rsb::spread::Assembly::getCompleteNotification | ( | ) | const |
Returns the completed notification built from all fragments.
Definition at line 61 of file Assembly.cpp.
References isComplete(), logger, and store.
bool rsb::spread::Assembly::isComplete | ( | ) | const |
Definition at line 98 of file Assembly.cpp.
References receivedParts, and store.
Referenced by add(), and getCompleteNotification().
|
private |
Definition at line 92 of file Assembly.h.
Referenced by age().
|
private |
Definition at line 89 of file Assembly.h.
Referenced by add(), and getCompleteNotification().
|
private |
Definition at line 90 of file Assembly.h.
Referenced by add(), and isComplete().
|
private |
Definition at line 91 of file Assembly.h.
Referenced by add(), Assembly(), getCompleteNotification(), and isComplete().