⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rvpriority.h

📁 h.248协议源码
💻 H
字号:
#if (0)
******************************************************************************
Filename    :
Description :
******************************************************************************
                Copyright (c) 1999 RADVision Inc.
************************************************************************
NOTICE:
This document contains information that is proprietary to RADVision LTD.
No part of this publication may be reproduced in any form whatsoever 
without written prior approval by RADVision LTD..

RADVision LTD. reserves the right to revise this publication and make 
changes without obligation to notify any person of such revisions or 
changes.
******************************************************************************
$Revision:$
$Date:$
$Author: S. Cipolli$
******************************************************************************
#endif
#ifndef RV_PRIORITY_H
#define RV_PRIORITY_H

#include "rvplatform.h"
#include "rvtypes.h"

/* Deprecated */
/*$
{type deprecated="yes":
	{name: RvPriorityClass}
	{superpackage: Kernel}
	{include: rvpriority.h}
	{description:	
		{p: This is an enumeration of priority classes.}
    }
    {enumeration:
		{value: {n:RV_PRIORITYCLASS_HIGH}   {d:High priority class.}}
		{value: {n:RV_PRIORITYCLASS_MEDIUM} {d:Medium priority class.}}
		{value: {n:RV_PRIORITYCLASS_LOW}    {d:Low priority class. }}
	}
	{notes:
		{note: This enumeration has been deprecated.  The values are
		       ignored when used to construct a priority.}
	}
}
$*/
typedef enum { 
	RV_PRIORITYCLASS_HIGH, 
	RV_PRIORITYCLASS_MEDIUM, 
	RV_PRIORITYCLASS_LOW 
} RvPriorityClass;

/*$
{type:
	{name: RvPriority}
	{superpackage: Kernel}
	{include: rvpriority.h}
	{description:	
		{p: Describes an OS dependent priority.}
	}
	{methods:
		{method: RvPriority* rvPriorityConstruct(RvPriority* p, RvPriorityClass pc, int value);}
		{method: void rvPriorityDestruct(RvPriority* p);}
		{method: RvBool rvPriorityLess(const RvPriority* a, const RvPriority* b);}
		{method: RvBool rvPriorityEqual(const RvPriority* a, const RvPriority* b);}
		{method: int rvPriorityGetValue(RvPriority* p);}
		{method: void rvPrioritySetValue(RvPriority* p, int v);}
	}
	{notes:
		{note: The constants: RV_PRIORITYVALUE_MAX, RV_PRIORITYVALUE_NORMAL, RV_PRIORITYVALUE_MIN
		are provided to help express priority values in an OS independent way. }
		{note: The constant RV_PRIORITYVALUE_INCREMENT is provided to further assist in specifying 
		priority values in an OS independent way.  RV_PRIORITYVALUE_INCREMENT specifies the distance
		to the next higher priority level, regardless of whether the OS's priority values range from 
		high to low or low to high.}
		{note: For example, the expression (RV_PRIORITYVALUE_MAX - (2 * RV_PRIORITYVALUE_INCREMENT)) 
		will generate a priority value 2 priority levels "lower" than the maximum priority.}
	}
}
$*/
typedef int RvPriority;

#if defined(__cplusplus)
extern "C" {
#endif 

/*$
{function:
	{name: rvPriorityConstruct}	
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Construct a priority object.}
	}
	{proto: RvPriority* rvPriorityConstruct(RvPriority* p, RvPriorityClass pc, int value);}
	{params:
		{param: {n: p} {d: A pointer to the priority.}}
		{param: {n: pc} {d: A priority class (deprecated).}}
		{param: {n: value} {d: An OS dependent priority value.}}
	}
	{returns: None. }
	{notes:
		{note: The priority class parameter has been deprecated and therefore
		has no effect on the resulting priority.}
	}
}
$*/
#define rvPriorityConstruct(p, pc, v)			(*(p) = (v))

/*$
{function:
	{name: rvPriorityDestruct}
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Destruct a priority object. }
	}
	{proto: void rvPriorityDestruct(RvPriority* p);}
	{params:
		{param: {n: p} {d: A pointer to the priority.}}
	}
}
$*/
#define rvPriorityDestruct(p)

/*$
{function:
	{name: rvPriorityLess}	
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Compare two priorities for less-than. On Operating Systems where 
		high priority values are considered low priority, the comparision 
		considers a low priority (high priority value) less than a high priority 
		(low priority value). }
	}
	{proto: RvBool rvPriorityLess(const RvPriority* a, const RvPriority* b);}
	{params:
		{param: {n: a} {d: A pointer to the first priority.}}
		{param: {n: b} {d: A pointer to the second priority.}}
	}
	{returns: rvTrue if priority a is "lower" than priority b or rvFalse otherwise.}
}
$*/
#if (RV_PRIORITYVALUE_INCREMENT > 0)
#define rvPriorityLess(a, b)			(*(a) < *(b))
#else
#define rvPriorityLess(a, b)			(*(a) > *(b))
#endif

/*$
{function:
	{name: rvPriorityEqual}	
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Compare two priorities for equality. }
	}
	{proto: RvBool rvPriorityEqual(const RvPriority* a, const RvPriority* b);}
	{params:
		{param: {n: a} {d: A pointer to the first priority.}}
		{param: {n: b} {d: A pointer to the second priority.}}
	}
	{returns: rvTrue if priority a is equal to priority b or rvFalse otherwise.}
}
$*/
#define rvPriorityEqual(a, b)				((a) == (b))

/*$
{function:
	{name: rvPriorityGetValue}	
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Get a priority's value.}
	}
	{proto: int rvPriorityGetValue(RvPriority* p);}
	{params:
		{param: {n:p} {d:A pointer to the priority.}}
	}
	{returns: The priority's value.}
}
$*/
#define rvPriorityGetValue(p)				(*(p))

/*$
{function:
	{name: rvPrioritySetValue}	
	{class: RvPriority}	
	{include: rvpriority.h}
	{description:
		{p: Set a priority's value.}
	}
	{proto: void rvPrioritySetValue(RvPriority* p, int v);}
	{params:
		{param: {n:p} {d:A pointer to the priority.}}
		{param: {n:v} {d:A pointer to the priority's value.}}
	}
}
$*/
#define rvPrioritySetValue(p, v)			(*(p) = (v))

#if defined(__cplusplus)
}
#endif 

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -