Scippy

UG

Ubiquity Generator framework

MessageQueueElement Class Reference

Class for message queue element. More...

#include <paraCommCPP11.h>

Public Member Functions

 MessageQueueElement ()
 default constructor of MessageQueueElement More...
 
 MessageQueueElement (int inSource, int inCount, int inDataTypeId, int inTag, void *inData)
 constructor of MessageQueueElement More...
 
 ~MessageQueueElement ()
 destructor of MessageQueueElement More...
 
int getSource ()
 getter of source rank More...
 
int getCount ()
 getter of the number of the data type elements More...
 
int getDataTypeId ()
 getter of the data type id More...
 
int getTag ()
 getter of the message tag More...
 
void * getData ()
 getter of data More...
 
MessageQueueElementgetNext ()
 getter of the pointer to the next MessageQueueElement More...
 
void link (MessageQueueElement *nextElement)
 link to the next MessageQueueElement More...
 
 MessageQueueElement ()
 default constructor of MessageQueueElement More...
 
 MessageQueueElement (int inSource, int inCount, int inDataTypeId, int inTag, void *inData)
 constructor of MessageQueueElement More...
 
 ~MessageQueueElement ()
 destructor of MessageQueueElement More...
 
int getSource ()
 getter of source rank More...
 
int getCount ()
 getter of the number of the data type elements More...
 
int getDataTypeId ()
 getter of the data type id More...
 
int getTag ()
 getter of the message tag More...
 
void * getData ()
 getter of data More...
 
MessageQueueElementgetNext ()
 getter of the pointer to the next MessageQueueElement More...
 
void link (MessageQueueElement *nextElement)
 link to the next MessageQueueElement More...
 

Private Attributes

int source
 source thread rank of this message More...
 
int count
 number of the data type elements More...
 
int dataTypeId
 data type id More...
 
int tag
 tag of the message, -1 : in case of broadcast message More...
 
void * data
 data of the message More...
 
MessageQueueElementnext
 point to next message queue element More...
 

Detailed Description

Class for message queue element.

NOTE : For basic data types, this is copy of sender side memory. When the memory is copied at receive function, the memory have to be freed. For user defined data type, this is the receiver side memory, because it is better to allocate memory in the sender side for mutex locking. Sender side functions have to allocate memory. In this case, memory do not have to be freed. The memory is for receiver side.

Definition at line 122 of file paraCommCPP11.h.

Constructor & Destructor Documentation

◆ MessageQueueElement() [1/4]

default constructor of MessageQueueElement

Definition at line 137 of file paraCommCPP11.h.

◆ MessageQueueElement() [2/4]

MessageQueueElement ( int  inSource,
int  inCount,
int  inDataTypeId,
int  inTag,
void *  inData 
)

constructor of MessageQueueElement

Parameters
inSourcesource thread rank of this message
inCountnumber of the data type elements
inDataTypeIddata type id
inTagtag of the message, -1 : in case of broadcast message
inDatadata of the message

Definition at line 151 of file paraCommCPP11.h.

◆ ~MessageQueueElement() [1/2]

destructor of MessageQueueElement

Definition at line 164 of file paraCommCPP11.h.

◆ MessageQueueElement() [3/4]

default constructor of MessageQueueElement

Definition at line 130 of file paraCommPth.h.

◆ MessageQueueElement() [4/4]

MessageQueueElement ( int  inSource,
int  inCount,
int  inDataTypeId,
int  inTag,
void *  inData 
)

constructor of MessageQueueElement

Parameters
inSourcesource thread rank of this message
inCountnumber of the data type elements
inDataTypeIddata type id
inTagtag of the message, -1 : in case of broadcast message
inDatadata of the message

Definition at line 138 of file paraCommPth.h.

◆ ~MessageQueueElement() [2/2]

destructor of MessageQueueElement

Definition at line 151 of file paraCommPth.h.

Member Function Documentation

◆ getCount() [1/2]

int getCount ( )

getter of the number of the data type elements

Returns
the number of the data type elements

Definition at line 183 of file paraCommCPP11.h.

References MessageQueueElement::count.

Referenced by ParaCommCPP11::freeStandardTypes(), and ParaCommPth::freeStandardTypes().

◆ getCount() [2/2]

int getCount ( )

getter of the number of the data type elements

Returns
the number of the data type elements

Definition at line 170 of file paraCommPth.h.

References MessageQueueElement::count.

◆ getData() [1/2]

◆ getData() [2/2]

void * getData ( )

getter of data

Returns
pointer to the data

Definition at line 200 of file paraCommPth.h.

References MessageQueueElement::data.

◆ getDataTypeId() [1/2]

◆ getDataTypeId() [2/2]

int getDataTypeId ( )

getter of the data type id

Returns
data type id

Definition at line 180 of file paraCommPth.h.

References MessageQueueElement::dataTypeId.

◆ getNext() [1/2]

◆ getNext() [2/2]

MessageQueueElement * getNext ( )

getter of the pointer to the next MessageQueueElement

Returns
pointer to MessageQueueElement

Definition at line 210 of file paraCommPth.h.

References MessageQueueElement::next.

◆ getSource() [1/2]

◆ getSource() [2/2]

int getSource ( )

getter of source rank

Returns
rank of the source

Definition at line 160 of file paraCommPth.h.

References MessageQueueElement::source.

◆ getTag() [1/2]

int getTag ( )

◆ getTag() [2/2]

int getTag ( )

getter of the message tag

Returns
tag of the message

Definition at line 190 of file paraCommPth.h.

References MessageQueueElement::tag.

◆ link() [1/2]

void link ( MessageQueueElement nextElement)

link to the next MessageQueueElement

Parameters
nextElementpointer to MessageQueueElement

Definition at line 232 of file paraCommCPP11.h.

References MessageQueueElement::next.

Referenced by MessageQueueTableElement::enqueue(), and MessageQueueTableElement::extarctElement().

◆ link() [2/2]

void link ( MessageQueueElement nextElement)

link to the next MessageQueueElement

Parameters
nextElementpointer to MessageQueueElement

Definition at line 219 of file paraCommPth.h.

References MessageQueueElement::next.

Member Data Documentation

◆ count

int count
private

number of the data type elements

number of elements of the data type

Definition at line 126 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getCount().

◆ data

void * data
private

data of the message

NOTE : For basic data types, this is copy of sender side memory. When the memory is copied at receive function, the memory have to be freed. For user defined data type, this is the receiver side memory, because it is better to allocate memory in the sender side for mutex locking. Sender side functions have to allocate memory. In this case, memory do not hvae to freed. The memory is for receiver side.

Definition at line 129 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getData().

◆ dataTypeId

int dataTypeId
private

data type id

Definition at line 127 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getDataTypeId().

◆ next

MessageQueueElement * next
private

point to next message queue element

Definition at line 130 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getNext(), and MessageQueueElement::link().

◆ source

int source
private

source thread rank of this message

Definition at line 125 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getSource().

◆ tag

int tag
private

tag of the message, -1 : in case of broadcast message

-1 : in case of broadcast message

Definition at line 128 of file paraCommCPP11.h.

Referenced by MessageQueueElement::getTag().