DRAMA C++ Intro   Class Hierarchy   Alphabetical List of types   List of Classes   File List   Class Member Index   File Members Index   Related Pages  

Public Types | Public Member Functions | List of all members
DcppShared Class Reference

This is used to create and represent a shared memory segment. More...

#include <dcpp.h>

Public Types

enum  SharedType {
  Create = DITS_SHARE_CREATE, Gblsec = DITS_SHARE_GBLSEC, Global = DITS_SHARE_GLOBAL, ShMem = DITS_SHARE_SHMEM,
  MMap = DITS_SHARE_MMAP
}
 This enum gives the various shared memory types. More...
 

Public Member Functions

 DcppShared (long Size, StatusType *const status, const SharedType Type=Create, const int CreateIt=true, const char *const Name="", const int Key=0, void *const Address=0)
 Basic Shared memory segment constructor. More...
 
 DcppShared (const SdsId &Template, StatusType *const status, const SharedType Type=Create, const int CreateIt=true, const char *const Name="", const int Key=0, void *const Address=0)
 Shared memory segment constructor - for an SDS structure. More...
 
 DcppShared (DitsSharedMemInfoType *Info, void *Address=0, SdsIdType ID=0, bool Free=false)
 Shared memory segment constructor - using existing segment. More...
 
void GetInfo (const DitsSharedMemInfoType **const Info, StatusType *const status) const
 Get share memory details - const version. More...
 
void GetInfo (DitsSharedMemInfoType **const Info, StatusType *const status)
 Get share memory details - non-const version. More...
 
SdsIdGetSds ()
 Return Sds structure id. More...
 
const SdsIdGetSds () const
 Return Sds structure id - const version. More...
 
void GetAddress (const void **Address, StatusType *status) const
 Return the shared memory address - const version. More...
 
void GetAddress (void **Address, StatusType *status)
 Return the shared memory address - non-const version. More...
 
virtual ~DcppShared ()
 Destructor - free shared memory and SDS ID. More...
 

Detailed Description

This is used to create and represent a shared memory segment.

When sending bulk data DRAMA messages, it is necessary to describe the bulk data shared memory segment. This type does this.

Member Enumeration Documentation

This enum gives the various shared memory types.

This enum type is used with the DcppShared constructor to select the type of shared memory segment. The value of the argument of this type determines how some of the other arguments are used.

See DitsDefineShared() for full details on this, refering to the enum value constants.

Enumerator
Create 

Default type, most suitable for the current machine.

The Name, Key and Address arguments to the constructor are ignored as it CreateIt, which is assumed to be true

Gblsec 

Appropiate for VMS only.

Creates a VME global page section with name specified by the Name field. Key and Address are ignored

Global 

Appropriate for VxWorks.

The mapped section is just and area of memory, starting at a specified address. If CreateIt is true, Address is ignored and the memory allocated. If CreateIt is false, then Address specifies the address of the memory

ShMem 

Create Unix System V shared memory.

Key specifies the shared memory key and Name should be the Null string, and Address is ignored.

MMap 

Create a unix mapped section.

Name should be the full name of the file. Key and Address are ignored.

Constructor & Destructor Documentation

DcppShared::DcppShared ( long  Size,
StatusType *const  status,
const SharedType  Type = Create,
const int  CreateIt = true,
const char *const  Name = "",
const int  Key = 0,
void *const  Address = 0 
)
inline

Basic Shared memory segment constructor.

See also
DitsDefineShared()
Parameters
SizeThe size in bytes of the shared memory segment
statusInherited status.
TypeThe type of the shared memory segement.
CreateItIf set true, the segement is created.
NameThe name of the shared memory segement, if required.
KeyThe Key for the shared memory segement, if required.
AddressThe address of the shared memory segment, if required.
DcppShared::DcppShared ( const SdsId Template,
StatusType *const  status,
const SharedType  Type = Create,
const int  CreateIt = true,
const char *const  Name = "",
const int  Key = 0,
void *const  Address = 0 
)
inline

Shared memory segment constructor - for an SDS structure.

This version takes an SDS ID, which represents the structure to be stored in the shared memory segment.

See also
DitsDefineSdsShared()
Parameters
TemplateThe SdsId which contains the template structure. This is often a structure which has been created but does not contain data as yet - it has not been defined, which when large arrays are involved, means is does not take up much space as yet. It will be exported into the shared memory segment with this data defined.
statusInherited status.
TypeThe type of the shared memory segement.
CreateItIf set true, the segement is created.
NameThe name of the shared memory segement, if required.
KeyThe Key for the shared memory segement, if required.
AddressThe address of the shared memory segment, if required.

References SdsId::ShallowCopy().

DcppShared::DcppShared ( DitsSharedMemInfoType *  Info,
void *  Address = 0,
SdsIdType  ID = 0,
bool  Free = false 
)
inline

Shared memory segment constructor - using existing segment.

This constructor initializes the object from an existing DitsSharedMemInfoType structure. Note, Address will only be known if passed in. Similary for the Sds ID. The SdsdD (if any) and shared memory segement are only released when by this object's destructure if the Free flag is set true.

See also
DitsDefineShared()
DitsDefineSdsShared()
Parameters
InfoThe shared memory details.
AddressThe address of the shared memory segment.
IDThe SDS ID of any structure in the segment.
FreeIf set true, then the shared memory segment and SDS ID are freeed when the object destructor is invoked.

References SdsId::ShallowCopy().

virtual DcppShared::~DcppShared ( )
inlinevirtual

Destructor - free shared memory and SDS ID.

Member Function Documentation

void DcppShared::GetAddress ( const void **  Address,
StatusType *  status 
) const
inline

Return the shared memory address - const version.

Parameters
AddressThe addesss of the shared memory is written here.
statusInherited status.
void DcppShared::GetAddress ( void **  Address,
StatusType *  status 
)
inline

Return the shared memory address - non-const version.

Parameters
AddressThe addesss of the shared memory is written here.
statusInherited status.
void DcppShared::GetInfo ( const DitsSharedMemInfoType **const  Info,
StatusType *const  status 
) const
inline

Get share memory details - const version.

This function returns the shared memory details appropiate for use by DITS functions, const version.

Parameters
InfoThe shared memory details are written here.
statusInherited status.
void DcppShared::GetInfo ( DitsSharedMemInfoType **const  Info,
StatusType *const  status 
)
inline

Get share memory details - non-const version.

This function returns the shared memory details appropiate for use by DITS functions, non-const version.

Parameters
InfoThe shared memory details are written here.
statusInherited status.
SdsId& DcppShared::GetSds ( )
inline

Return Sds structure id.

Just returns the SDS id assoicated with this shared memory segment. If none is assoicated, this will be a null SDS id

Returns
The SDS id of the structure in shared memory.
const SdsId& DcppShared::GetSds ( ) const
inline

Return Sds structure id - const version.

Just returns the SDS id assoicated with this shared memory segment. If none is assoicated, this will be a null SDS id

Returns
The SDS id of the structure in shared memory.

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 13:58:31 for AAO DRAMA C++ Interfaces by doxygen 1.8.10