AAO DRAMA/DRAMA2 C++ Interface
Public Member Functions | List of all members
drama::BulkDataArg Class Reference

Detailed Description

A class used to manage a bulk data argument to an action.

This class is used internally by DRAMA2 and can be used by actions to access SDS items in bulk data arguments.

A non-threaded action (or kick message) can create one of these to access bulk data.

#include "bulkdata.hh"

Inheritance diagram for drama::BulkDataArg:
drama::BulkData drama::BulkDataArgSds

Public Member Functions

 BulkDataArg ()
 Default constructor. More...
 BulkDataArg (std::weak_ptr< Task > theTask)
 Constructor - creates a BulkDataArg item by calling DitsBulkArgInfo(). More...
 BulkDataArg (BulkDataArg &&source) noexcept
 Move copy constructor. More...
unsigned long GetNotifyBytes () const
 Returns the notification size. More...
BulkDataArgoperator= (BulkDataArg &&rhs) noexcept
 Move assignment operator. More...
void Report (unsigned bytes)
 Notify DRAMA of the number of bulk data bytes used/processed. More...
- Public Member Functions inherited from drama::BulkData
 BulkData ()
 Default constructor. More...
 BulkData (std::weak_ptr< Task > theTask, long Size, ShareType type=ShareType::Create, bool Create=true, bool DeleteOnDestruct=true, void *Address=nullptr, const std::string &Name="", int Key=0)
 Define a bulk data shared memory segment of the specified type for use with DRAMA 2 methods which can send bulk data. More...
 BulkData (std::weak_ptr< Task > theTask, const DitsBulkReportInfoType &info)
 Define a bulk data shared memory segment based on a DitsBulkReportInfoType item. More...
 BulkData (const BulkData &source)=delete
 Copy constructor - deleted. More...
 BulkData (BulkData &&source) noexcept
 Move copy constructor. More...
virtual ~BulkData ()
 Destructor. More...
template<typename T >
T * Data (unsigned long *nitems=nullptr)
 Return a pointer to the actual data. More...
DitsSharedMemInfoType & GetDitsSharedMemInfo ()
 Return a reference to the DitsSharedMemInfoType object managed by this. More...
BulkDataoperator= (const BulkData &rhs)=delete
 Assignment operator - deleted. More...
BulkDataoperator= (BulkData &&rhs) noexcept
 Move assignment operator. More...

Additional Inherited Members

- Protected Member Functions inherited from drama::BulkData
void * RawDataAddr () const
 Returns the raw address of the data. More...
unsigned long SizeBytes () const
 Return the size of the data in bytes. More...

Constructor & Destructor Documentation

drama::BulkDataArg::BulkDataArg ( )

Default constructor.

Items created this way are only suitable as a target for Move Assignment and Move Copy operations. Attempts to access the memory item will throw an exception.

drama::BulkDataArg::BulkDataArg ( std::weak_ptr< Task theTask)

Constructor - creates a BulkDataArg item by calling DitsBulkArgInfo().

Note, must be invoked only within the DRAMA message thread, in particular, as part of an action handler. This cannot be invoked in other threads.

theTaskThe DRAMA Task we are part of. This is passed by pointer, but BulkDataArg is not taking ownership of the subject object, which must continue to exist until the BulkDataArg object is destroyed.
drama::BulkDataArg::BulkDataArg ( BulkDataArg &&  source)

Move copy constructor.

Often optimized out using the "copy elision" rule.

Member Function Documentation

unsigned long drama::BulkDataArg::GetNotifyBytes ( ) const

Returns the notification size.

If non-zero, you are requested to notify the sender after processing each increment of this number of bytes

BulkDataArg& drama::BulkDataArg::operator= ( BulkDataArg &&  rhs)

Move assignment operator.

Often optimized out using the "copy elision" rule.

References drama::BulkData::operator=().

void drama::BulkDataArg::Report ( unsigned  bytes)

Notify DRAMA of the number of bulk data bytes used/processed.

This method allows you to notify the sender of bulk data of the progress of your use of the bulk data. The sender receives an DITS_REA_BULK_TRANSFERRED entry indicates the number of bytes has been used and can fetch details using DitsGetEntBulkInfo(3).

Note, if is not considered a failure if the task which sent the bulk data has disappeared and this is report will then be quietly ignored.

bytesThe number of bytes which have been processed.

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

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aao.gov.au 

Generated on Mon Feb 22 2016 15:57:52 for AAO DRAMA/DRAMA2 C++ Interface by doxygen 1.8.10