AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
Defines and optionally creates a shared memory section.
Shared memory sections are used by DRAMA in the handling of bulk data transfers.
If Type is set to ShareType::Create, then this class's main constructor creates a temporary shared memory section of the size specified in some suitable form for the system it is running on. The caller has no control over the details of the shared memory section. In this case, the Name and Key arguments, and any preset value at the location specified by the Address argument are all ignored. A new section will be created and mapped.
VxWorks: The mapped section is just a section of memory, starting at a specified address. Type should be ShareType::Global. Name should be an empty string, and Key is ignored. If Create is specified, Address is ignored, and a suitably sized area of memory is allocated. If Create is passed as false, then Address should contain the address of the memory section in question. Under VxWorks, this is what is generated by ShareType::Default.
UNIX: The mapped section can be created as System V shared memory, in which case Type should be ShareType::SHMem , or as a file accessed through mmap(), in which case Type should be ShareType::MMap. If Type is ShareType::SHMem, Key specifies the identifier for the shared memory and Name should be an empty string. If Type is ShareType::MMap, Name should be the full name of the file, and Key is ignored. Address is ignored in both cases. On UNIX, one of these types will be what is provided by ShareType::Default.
#include "bulkdata.hh"
Public Member Functions | |
BulkData () | |
Default constructor. | |
BulkData (BulkData &&source) noexcept | |
Move copy constructor. | |
BulkData (const BulkData &source)=delete | |
Copy constructor - deleted. | |
BulkData (std::weak_ptr< Task > theTask, const DitsBulkReportInfoType &info) | |
Define a bulk data shared memory segment based on a DitsBulkReportInfoType item. | |
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. | |
virtual | ~BulkData () |
Destructor. | |
template<typename T > | |
T * | Data (unsigned long *nitems=nullptr) |
Return a pointer to the actual data. | |
DitsSharedMemInfoType & | GetDitsSharedMemInfo () |
Return a reference to the DitsSharedMemInfoType object managed by this. | |
BulkData & | operator= (BulkData &&rhs) noexcept |
Move assignment operator. | |
BulkData & | operator= (const BulkData &rhs)=delete |
Assignment operator - deleted. | |
Protected Member Functions | |
void * | RawDataAddr () const |
Returns the raw address of the data. | |
unsigned long | SizeBytes () const |
Return the size of the data in bytes. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:35 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8