hmbdc
simplify-high-performance-messaging-programming
Public Member Functions | List of all members
hmbdc::app::hasMemoryAttachment Class Reference

if a specific hmbdc network transport (for example tcpcast, rmcast, and rnetmap) supports message with memory attachment, the message needs to be derived from this base - as the FIRST base, so it can be handled properly by the hmbdc network transport when sending and receiving it More...

#include <Message.hpp>

Inheritance diagram for hmbdc::app::hasMemoryAttachment:
hmbdc::app::utils::netperf_detail::MessageAtt

Public Member Functions

 hasMemoryAttachment ()
 default ctor More...
 
 hasMemoryAttachment (char const *fileName)
 file mapped memory More...
 
size_t map (char const *fileName)
 map this object's attached memory to a file More...
 
void unmap ()
 does the reverse of map More...
 

Detailed Description

if a specific hmbdc network transport (for example tcpcast, rmcast, and rnetmap) supports message with memory attachment, the message needs to be derived from this base - as the FIRST base, so it can be handled properly by the hmbdc network transport when sending and receiving it

user on the sending side cannot directly free the attachment, instead the user can provide a callback func and hmbdc will call it - the default callback function is to call free on the attachment

Examples:
rmcast-cp.cpp.

Constructor & Destructor Documentation

hmbdc::app::hasMemoryAttachment::hasMemoryAttachment ( )
inline

default ctor

allocate and release thru heap

hmbdc::app::hasMemoryAttachment::hasMemoryAttachment ( char const *  fileName)
inline

file mapped memory

Parameters
fileNamefile name to map

Member Function Documentation

size_t hmbdc::app::hasMemoryAttachment::map ( char const *  fileName)

map this object's attached memory to a file

the afterConsumedCleanupFunc is automatically set to do the unmap

Parameters
fileNamefile to map into memory
Returns
size of the file mapped
void hmbdc::app::hasMemoryAttachment::unmap ( )
inline

does the reverse of map

pointing to a func that handles cleaning up the attachment it is automatically set, but user can change it as desire when the sending side is done with this message, this is called by hmbdc automatically. however, this is not called on the recv side since only the user code knows when to call it


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