The Original CHomP Software
Public Member Functions | Public Attributes | Private Member Functions | Friends | List of all members
chomp::multiwork::mwWorkerData Class Reference

A helper class for storing data on a single worker. More...

#include <mwcoord.h>

Public Member Functions

 mwWorkerData ()
 The default constructor. More...
 
 ~mwWorkerData ()
 The destructor. More...
 

Public Attributes

mwData data
 The data which was sent do the worker and is being processed. More...
 
int fd
 The file descriptor number of the socket for the communication with the given worker. More...
 
std::string name
 The computer name of the worker. More...
 
int port
 The port number at which the worker is going to listen next time. More...
 
int status
 The status of the worker: 0 = ok, -1 = failed, 1 = data acquired from a working one or data sent to a waiting one. More...
 

Private Member Functions

 mwWorkerData (const mwWorkerData &)
 The copy constructor is not allowed. More...
 
mwWorkerDataoperator= (const mwWorkerData &)
 The assignment operator is not allowed. More...
 

Friends

void swap (mwWorkerData &data1, mwWorkerData &data2)
 Swaps data between two objects of this type. More...
 

Detailed Description

A helper class for storing data on a single worker.

This data structure is used internally by the coordinator.

Definition at line 58 of file mwcoord.h.

Constructor & Destructor Documentation

◆ mwWorkerData() [1/2]

chomp::multiwork::mwWorkerData::mwWorkerData ( )
inline

The default constructor.

Definition at line 97 of file mwcoord.h.

97 :
98 fd (-1), name (""), port (0), status (0)
99{
100 return;
101} /* mwWorkerData::mwWorkerData */
std::string name
The computer name of the worker.
Definition: mwcoord.h:76
int status
The status of the worker: 0 = ok, -1 = failed, 1 = data acquired from a working one or data sent to a...
Definition: mwcoord.h:83
int fd
The file descriptor number of the socket for the communication with the given worker.
Definition: mwcoord.h:73
int port
The port number at which the worker is going to listen next time.
Definition: mwcoord.h:79

◆ ~mwWorkerData()

chomp::multiwork::mwWorkerData::~mwWorkerData ( )
inline

The destructor.

Definition at line 103 of file mwcoord.h.

104{
105 return;
106} /* mwWorkerData::~mwWorkerData */

◆ mwWorkerData() [2/2]

chomp::multiwork::mwWorkerData::mwWorkerData ( const mwWorkerData )
inlineprivate

The copy constructor is not allowed.

Definition at line 90 of file mwcoord.h.

90{return;};

Member Function Documentation

◆ operator=()

mwWorkerData & chomp::multiwork::mwWorkerData::operator= ( const mwWorkerData )
inlineprivate

The assignment operator is not allowed.

Definition at line 93 of file mwcoord.h.

93{return *this;};

Friends And Related Function Documentation

◆ swap

void swap ( mwWorkerData data1,
mwWorkerData data2 
)
friend

Swaps data between two objects of this type.

Definition at line 108 of file mwcoord.h.

109{
110 swap (data1. data, data2. data);
111 std::swap (data1. fd, data2. fd);
112 std::swap (data1. name, data2. name);
113 std::swap (data1. port, data2. port);
114 std::swap (data1. status, data2. status);
115 return;
116} /* swap */
friend void swap(mwWorkerData &data1, mwWorkerData &data2)
Swaps data between two objects of this type.
Definition: mwcoord.h:108
mwData data
The data which was sent do the worker and is being processed.
Definition: mwcoord.h:68
void swap(mwWorkerData &data1, mwWorkerData &data2)
Definition: mwcoord.h:108

Member Data Documentation

◆ data

mwData chomp::multiwork::mwWorkerData::data

The data which was sent do the worker and is being processed.

Definition at line 68 of file mwcoord.h.

◆ fd

int chomp::multiwork::mwWorkerData::fd

The file descriptor number of the socket for the communication with the given worker.

Negative if the worker is not connected.

Definition at line 73 of file mwcoord.h.

◆ name

std::string chomp::multiwork::mwWorkerData::name

The computer name of the worker.

Definition at line 76 of file mwcoord.h.

◆ port

int chomp::multiwork::mwWorkerData::port

The port number at which the worker is going to listen next time.

Definition at line 79 of file mwcoord.h.

◆ status

int chomp::multiwork::mwWorkerData::status

The status of the worker: 0 = ok, -1 = failed, 1 = data acquired from a working one or data sent to a waiting one.

Definition at line 83 of file mwcoord.h.


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