Пример #1
0
 /**
  * Returns priority of outgoing transfers.
  * TODO: Make const.
  */
 TransferPriority getPriority()
 {
     // TODO probably TransferSender must be transformed into regular field?
     TransferSender* const ts = getTransferSender();
     if (ts != NULL)
     {
         return ts->getPriority();
     }
     else
     {
         return TransferPriorityNormal;  // This is default
     }
 }
Пример #2
0
 /**
  * Allows to change the priority of outgoing transfers.
  * Note that only High, Normal and Low priorities can be used; Service priority is not available for messages.
  * Returns negative error code if priority cannot be set, non-negative on success.
  */
 int setPriority(const TransferPriority prio)
 {
     if (prio < NumTransferPriorities && prio != TransferPriorityService)
     {
         TransferSender* const ts = getTransferSender();  // TODO: Static TransferSender?
         if (ts != NULL)
         {
             ts->setPriority(prio);
             return 0;
         }
         else
         {
             return -ErrLogic;
         }
     }
     else
     {
         return -ErrInvalidParam;
     }
 }