RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::spread::Assembly Class Reference

Instances of this class store fragments of partially received, fragmented notifications for later assembly. More...

#include <Assembly.h>

Collaboration diagram for rsb::spread::Assembly:
Collaboration graph

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

Detailed Description

Instances of this class store fragments of partially received, fragmented notifications for later assembly.

Author
swrede

Definition at line 54 of file Assembly.h.

Constructor & Destructor Documentation

rsb::spread::Assembly::Assembly ( rsb::protocol::FragmentedNotificationPtr  n)

Definition at line 47 of file Assembly.cpp.

References add(), and store.

Here is the call graph for this function:

rsb::spread::Assembly::~Assembly ( )

Definition at line 58 of file Assembly.cpp.

Member Function Documentation

bool rsb::spread::Assembly::add ( rsb::protocol::FragmentedNotificationPtr  n)

Adds a newly received fragment to this Assembly and tells whether this completed the assembly.

Parameters
nfragment to add
Returns
true if the assembly is now completed, else false
Exceptions
protocol::ProtocolExceptionif 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().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int rsb::spread::Assembly::age ( ) const

Age of the assembly as seconds.

The age is the elapsed time since this instance was created.

Returns
age in seconds

Definition at line 102 of file Assembly.cpp.

References birthTime.

NotificationPtr rsb::spread::Assembly::getCompleteNotification ( ) const

Returns the completed notification built from all fragments.

Returns
complete notification with all data

Definition at line 61 of file Assembly.cpp.

References isComplete(), logger, and store.

Here is the call graph for this function:

bool rsb::spread::Assembly::isComplete ( ) const

Definition at line 98 of file Assembly.cpp.

References receivedParts, and store.

Referenced by add(), and getCompleteNotification().

Here is the caller graph for this function:

Member Data Documentation

boost::posix_time::ptime rsb::spread::Assembly::birthTime
private

Definition at line 92 of file Assembly.h.

Referenced by age().

rsc::logging::LoggerPtr rsb::spread::Assembly::logger
private

Definition at line 89 of file Assembly.h.

Referenced by add(), and getCompleteNotification().

unsigned int rsb::spread::Assembly::receivedParts
private

Definition at line 90 of file Assembly.h.

Referenced by add(), and isComplete().

std::vector<rsb::protocol::FragmentedNotificationPtr> rsb::spread::Assembly::store
private

Definition at line 91 of file Assembly.h.

Referenced by add(), Assembly(), getCompleteNotification(), and isComplete().


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