YARP  2.3.68+228-20170410.2+git7d0b2e0
Yet Another Robot Platform
yarp::os::QosStyle Class Reference

Preferences for the port's Quality of Service. More...

#include <yarp/os/QosStyle.h>

Public Types

enum  PacketPriorityLevel {
  PacketPriorityInvalid = -1,
  PacketPriorityNormal = 0,
  PacketPriorityLow = 10,
  PacketPriorityHigh = 36,
  PacketPriorityCritical = 44,
  PacketPriorityUndefined = 0x7FFF
}
 The PacketPriorityLevel defines the packets quality of service (priority) levels. More...
 
enum  PacketPriorityDSCP {
  DSCP_Invalid = -1,
  DSCP_CS0 = 0,
  DSCP_CS1 = 8,
  DSCP_CS2 = 16,
  DSCP_CS3 = 24,
  DSCP_CS4 = 32,
  DSCP_CS5 = 40,
  DSCP_CS6 = 48,
  DSCP_CS7 = 56,
  DSCP_AF11 = 10,
  DSCP_AF12 = 12,
  DSCP_AF13 = 14,
  DSCP_AF21 = 18,
  DSCP_AF22 = 20,
  DSCP_AF23 = 22,
  DSCP_AF31 = 26,
  DSCP_AF32 = 28,
  DSCP_AF33 = 30,
  DSCP_AF41 = 34,
  DSCP_AF42 = 36,
  DSCP_AF43 = 38,
  DSCP_VA = 44,
  DSCP_EF = 46,
  DSCP_Undefined = 0x7FFF
}
 The PacketPriorityDSCP defines the packets quality of service (priority) using DSCP. More...
 

Public Member Functions

 QosStyle ()
 Constructor. More...
 
void setPacketPriorityByDscp (PacketPriorityDSCP dscp)
 sets the packet priority given as DSCP class More...
 
void setPacketPriorityByLevel (PacketPriorityLevel level)
 sets the packet priority given as PacketPriorityLevel More...
 
void setPacketPrioritybyTOS (int tos)
 sets the packet priority given as TOS value More...
 
bool setPacketPriority (const ConstString &priority)
 sets the packet priority from a string. More...
 
void setThreadPriority (int priority)
 sets the communication thread priority level More...
 
void setThreadPolicy (int policy)
 sets the communication thread scheduling policy More...
 
int getPacketPriorityAsTOS () const
 returns the packet TOS value More...
 
PacketPriorityDSCP getPacketPriorityAsDSCP () const
 returns the packet DSCP class More...
 
PacketPriorityLevel getPacketPriorityAsLevel () const
 returns the packet TOS value More...
 
int getThreadPriority () const
 returns the communication thread priority level More...
 
int getThreadPolicy () const
 returns the communication thread scheduling policy More...
 

Static Public Member Functions

static PacketPriorityDSCP getDSCPByVocab (int vocab)
 returns the IPV4/6 DSCP value given as DSCP code More...
 
static PacketPriorityLevel getLevelByVocab (int vocab)
 returns the priority level More...
 

Private Attributes

int threadPriority
 
int threadPolicy
 
int packetPriority
 

Detailed Description

Preferences for the port's Quality of Service.

All fields have sensible defaults.

Definition at line 26 of file QosStyle.h.

Member Enumeration Documentation

◆ PacketPriorityDSCP

The PacketPriorityDSCP defines the packets quality of service (priority) using DSCP.

Enumerator
DSCP_Invalid 
DSCP_CS0 
DSCP_CS1 
DSCP_CS2 
DSCP_CS3 
DSCP_CS4 
DSCP_CS5 
DSCP_CS6 
DSCP_CS7 
DSCP_AF11 
DSCP_AF12 
DSCP_AF13 
DSCP_AF21 
DSCP_AF22 
DSCP_AF23 
DSCP_AF31 
DSCP_AF32 
DSCP_AF33 
DSCP_AF41 
DSCP_AF42 
DSCP_AF43 
DSCP_VA 
DSCP_EF 
DSCP_Undefined 

Definition at line 47 of file QosStyle.h.

◆ PacketPriorityLevel

The PacketPriorityLevel defines the packets quality of service (priority) levels.

Enumerator
PacketPriorityInvalid 
PacketPriorityNormal 
PacketPriorityLow 
PacketPriorityHigh 
PacketPriorityCritical 
PacketPriorityUndefined 

Definition at line 33 of file QosStyle.h.

Constructor & Destructor Documentation

◆ QosStyle()

yarp::os::QosStyle::QosStyle ( )
explicit

Constructor.

Sets all options to reasonable defaults.

Definition at line 14 of file QosStyle.cpp.

Member Function Documentation

◆ getDSCPByVocab()

yarp::os::QosStyle::PacketPriorityDSCP yarp::os::QosStyle::getDSCPByVocab ( int  vocab)
static

returns the IPV4/6 DSCP value given as DSCP code

Parameters
vocaba DSCP code (e.g., CS0)
Returns
the actual DSCP value

Definition at line 122 of file QosStyle.cpp.

◆ getLevelByVocab()

yarp::os::QosStyle::PacketPriorityLevel yarp::os::QosStyle::getLevelByVocab ( int  vocab)
static

returns the priority level

Parameters
vocaba level code (e.g., HIGH)
Returns
the priority level

Definition at line 151 of file QosStyle.cpp.

◆ getPacketPriorityAsDSCP()

yarp::os::QosStyle::PacketPriorityDSCP yarp::os::QosStyle::getPacketPriorityAsDSCP ( ) const

returns the packet DSCP class

Returns
the DSCP class

Definition at line 74 of file QosStyle.cpp.

◆ getPacketPriorityAsLevel()

yarp::os::QosStyle::PacketPriorityLevel yarp::os::QosStyle::getPacketPriorityAsLevel ( ) const

returns the packet TOS value

Returns
the TOS

Definition at line 104 of file QosStyle.cpp.

◆ getPacketPriorityAsTOS()

int yarp::os::QosStyle::getPacketPriorityAsTOS ( ) const
inline

returns the packet TOS value

Returns
the TOS

Definition at line 146 of file QosStyle.h.

◆ getThreadPolicy()

int yarp::os::QosStyle::getThreadPolicy ( ) const
inline

returns the communication thread scheduling policy

Returns
the thread scheduling policy

Definition at line 178 of file QosStyle.h.

◆ getThreadPriority()

int yarp::os::QosStyle::getThreadPriority ( ) const
inline

returns the communication thread priority level

Returns
the thread priority

Definition at line 169 of file QosStyle.h.

◆ setPacketPriority()

bool yarp::os::QosStyle::setPacketPriority ( const ConstString priority)

sets the packet priority from a string.

The string has this syntax:

  • LEVEL:[NORM|LOW|HIGH|CRIT]
  • DSCP:[CS0|AF11|...]
  • TOS:[value]

For example the following call

setPacketPriority("LEVEL:HIGH");

is equivalent to

Parameters
prioritythe string to be interpreted as priority
Returns
true if correctly set, false otherwise

Definition at line 37 of file QosStyle.cpp.

◆ setPacketPriorityByDscp()

void yarp::os::QosStyle::setPacketPriorityByDscp ( PacketPriorityDSCP  dscp)

sets the packet priority given as DSCP class

Parameters
dscpthe packet DSCP class

Definition at line 20 of file QosStyle.cpp.

◆ setPacketPriorityByLevel()

void yarp::os::QosStyle::setPacketPriorityByLevel ( PacketPriorityLevel  level)

sets the packet priority given as PacketPriorityLevel

Parameters
levelthe packet priority

Definition at line 29 of file QosStyle.cpp.

◆ setPacketPrioritybyTOS()

void yarp::os::QosStyle::setPacketPrioritybyTOS ( int  tos)
inline

sets the packet priority given as TOS value

Parameters
tosthe packet TOS

Definition at line 99 of file QosStyle.h.

◆ setThreadPolicy()

void yarp::os::QosStyle::setThreadPolicy ( int  policy)
inline

sets the communication thread scheduling policy

Parameters
policythe thread's real-time scheduling policy

Definition at line 137 of file QosStyle.h.

◆ setThreadPriority()

void yarp::os::QosStyle::setThreadPriority ( int  priority)
inline

sets the communication thread priority level

Parameters
prioritythe thread's priority

Definition at line 128 of file QosStyle.h.

Member Data Documentation

◆ packetPriority

int yarp::os::QosStyle::packetPriority
private

Definition at line 202 of file QosStyle.h.

◆ threadPolicy

int yarp::os::QosStyle::threadPolicy
private

Definition at line 201 of file QosStyle.h.

◆ threadPriority

int yarp::os::QosStyle::threadPriority
private

Definition at line 200 of file QosStyle.h.


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