class PvmStructSet

A set of structs to be received.

Inheritance:

PvmStructSet


Public Methods

[more]FDSet& ExceptFDs ()
returns a reference to the set of file descriptors, that you're expecting to get into an exceptional condition.
[more]const FDSet& ExceptFDs () const
returns the set of file descriptors, that you're expecting to get into an exceptional condition.
[more]bool FDsReady () const
returns true if any file descriptor is ready.
[more]const FDSet& ReadFDs () const
returns the set of file descriptors, you want to read from.
[more]FDSet& ReadFDs ()
returns a reference to the set of file descriptors, you want to read from.
[more]const FDSet& ReadyExceptFDs () const
returns the set of file descriptors, that have an exceptional condition pending.
[more]const FDSet& ReadyReadFDs () const
returns the set of file descriptors, that are ready to read from.
[more]const FDSet& ReadyWriteFDs () const
returns the set of file descriptors, that are ready to write to.
[more]PvmStructId Receive (PvmTask &From = IgnoreTask)
receives a message of one of the types in the set and returns the id of that message and the id of the sender in From.
[more]PvmStructId ReceiveFrom (const PvmTaskSet &FromSet, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set, but only from one of the tasks given by FromSet, and returns the id of that message and the id of the sender in From.
[more]PvmStructId ReceiveFrom (PvmTask From)
receives a message of one of the types in the set, but only from the task From.
[more]PvmStructId TimedReceive (unsigned long int &Time, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set and returns the the id of the sender in From.
[more]PvmStructId TimedReceiveFrom (const PvmTaskSet &FromSet, unsigned long int &Time, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set, but only from one of the tasks given by FromSet, and returns the id of the sender in From.
[more]PvmStructId TimedReceiveFrom (PvmTask From, unsigned long int &Time)
receives a message of one of the types in the set, but only from the task From.
[more]FDSet& WriteFDs ()
returns a reference to the set of file descriptors, you want to write to.
[more]const FDSet& WriteFDs () const
returns the set of file descriptors, you want to write to.
[more]int count (PvmStructId What) const
returns 1, if an instance with the PvmStructId` is in the set and 0 otherwise.
[more]int count (const PvmStruct &What) const
returns 1, if What (not just any instance with the same PvmStructId as What) is in the set and 0 otherwise.
[more]void erase (PvmStructId What)
erases the potentially contained instance with the PvmStructId What.
[more]void erase (const PvmStruct &What)
erases the potentially contained instance with the same PvmStructId as What.
[more]void insert (PvmStruct &What)
inserts a reference to the instance What into the set.

Public

[more]typedef set< int, less< int > > FDSet
the type representing a set of file descriptors.


Documentation

A set of structs to be received.

A PvmStructSet is of course a set of PvmStruct derivations. But in contrast to the classes PvmTaskSet and PvmHostSet it is not derived from the STL-class set. Yet some of the methods are available with the same name as in the STL. You can add a PvmStruct to the PvmStructSet and can remove one from there. If you want to receive messages of, let's say, three different types, then you simply add instances of all those three PvmStruct-derivations to a PvmStructSet and do a Receive*() (syntax and semantic are analogous to those in PvmStruct.Receive*()). Then you get a return value with the id of the received message (as given with PvmSetStructId()) or 0, in case no message has been received (e.g. if it is a timed receive). Now you find the received information in the previously added instance of the corresponding type. So a code-fragment looks like this:

      StructA A; // derived from PvmStruct; Id = A_Id;
      StructB B; // derived from PvmStruct; Id = B_Id;
      PvmStructSet Awaited;
      Awaited.insert (A);
      Awaited.insert (B);
      while (1)
        {
          PvmStructId Id = Awaited.ReceiveFrom (SendingTask);
          if (Id == A_Id)
          {
            cout << A.what_ever_data_is_in_A << endl;
          }
          else // now Id must be equal B_Id
          {
            cout << B.what_ever_data_is_in_B << endl;
          }
        }
    
ovoid insert(PvmStruct &What)
inserts a reference to the instance What into the set. There can inly be one instance of every type (determined by the corresponding PvmStructId) inside such a set. So an instance overrides potentially contained ones of the same type.

ovoid erase(const PvmStruct &What)
erases the potentially contained instance with the same PvmStructId as What.

ovoid erase(PvmStructId What)
erases the potentially contained instance with the PvmStructId What.

oint count(const PvmStruct &What) const
returns 1, if What (not just any instance with the same PvmStructId as What) is in the set and 0 otherwise.

oint count(PvmStructId What) const
returns 1, if an instance with the PvmStructId` is in the set and 0 otherwise.

oPvmStructId Receive(PvmTask &From = IgnoreTask)
receives a message of one of the types in the set and returns the id of that message and the id of the sender in From. The parameter can be omitted, if you're not interested in who was sending. The message is unpacked into the instance that was added to set at. The call blocks until a message is received. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

oPvmStructId ReceiveFrom(const PvmTaskSet &FromSet, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set, but only from one of the tasks given by FromSet, and returns the id of that message and the id of the sender in From. This parameter can be omitted. The message is unpacked into the instance that was added to set at.The call blocks until a message is received. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

oPvmStructId ReceiveFrom(PvmTask From)
receives a message of one of the types in the set, but only from the task From. It returns the id of the message. The message is unpacked into the instance that was added to set at.The call blocks until a message is received. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

oPvmStructId TimedReceive(unsigned long int &Time, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set and returns the the id of the sender in From. This parameter can be omitted. The parameter Time specifies the maximal blocking time in microseconds. If after this time no message is received, than the function returns 0, otherwise it returns the id of the message and the remaining time in Time immediately after receiving the message. If received, the message is unpacked into the instance that was added to set at. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

oPvmStructId TimedReceiveFrom(const PvmTaskSet &FromSet, unsigned long int &Time, PvmTask &From = IgnoreTask)
receives a message of one of the types in the set, but only from one of the tasks given by FromSet, and returns the id of the sender in From. This parameter can be omitted. The parameter Time specifies the maximal blocking time in microseconds. If after this time no message is received, than the function returns 0, otherwise it returns the id of the message and the remaining time in Time immediately after receiving the message. If received, the message is unpacked into the instance that was added to set at. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

oPvmStructId TimedReceiveFrom(PvmTask From, unsigned long int &Time)
receives a message of one of the types in the set, but only from the task From. The parameter Time specifies the maximal blocking time in microseconds. If after this time no message is received, than the function returns 0,otherwise it returns the id of the message and the remaining time in Time immediately after receiving the message. If received, the message is unpacked into the instance that was added to set at. If one of the file descriptor sets is not empty, the function returns immediatly 0, if the corresponding action on the file desriptor is possible. Subsequent calls to the Ready*FDs()-methods return the ready file descriptors. The input sets are not changed.

otypedef set< int, less< int > > FDSet
the type representing a set of file descriptors.

oFDSet& ReadFDs()
returns a reference to the set of file descriptors, you want to read from.

oconst FDSet& ReadFDs() const
returns the set of file descriptors, you want to read from.

oconst FDSet& ReadyReadFDs() const
returns the set of file descriptors, that are ready to read from.

oFDSet& WriteFDs()
returns a reference to the set of file descriptors, you want to write to.

oconst FDSet& WriteFDs() const
returns the set of file descriptors, you want to write to.

oconst FDSet& ReadyWriteFDs() const
returns the set of file descriptors, that are ready to write to.

oFDSet& ExceptFDs()
returns a reference to the set of file descriptors, that you're expecting to get into an exceptional condition.

oconst FDSet& ExceptFDs() const
returns the set of file descriptors, that you're expecting to get into an exceptional condition.

oconst FDSet& ReadyExceptFDs() const
returns the set of file descriptors, that have an exceptional condition pending.

obool FDsReady() const
returns true if any file descriptor is ready.


This class has no child classes.
Friends:
class PvmInternal

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.