sipxportlib  Version 3.3
OsUtilLinux.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _OsUtilLinux_h_
12 #define _OsUtilLinux_h_
13 
14 // SYSTEM INCLUDES
15 #include <time.h>
16 
17 // APPLICATION INCLUDES
18 #include "os/OsDefs.h"
19 #include "os/OsStatus.h"
20 #include "os/OsTime.h"
21 #include "os/linux/OsLinuxDefs.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 typedef void (*sighandler_t)(int);
31 
32 // FORWARD DECLARATIONS
33 
34 //:Static methods that are useful when running on top of Linux
36 {
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
40 /* ============================ CREATORS ================================== */
41 
42 /* ============================ MANIPULATORS ============================== */
43 
44 /* ============================ ACCESSORS ================================= */
45 
46  static int cvtOsPrioToLinuxPrio(const int osPrio);
47  //:Convert an abstraction layer task priority to a Linux task priority
48 
49  static int cvtOsPrioToLinuxRtPrio(const int osPrio);
50  //:Convert an abstraction layer task priority to a Linux task priority
51 
52  static int cvtLinuxPrioToOsPrio(const int linuxPrio);
53  //:Convert a Linux task priority to an abstraction layer task priority
54 
55  static void cvtOsTimeToTimespec(OsTime time1, struct timespec * time2);
56  //:Convert an OsTime class relative to the current time to a struct
57  // timespec relative to epoch
58 
59  static sighandler_t signal(int signum, sighandler_t handler);
60  //:Replacement for ::signal() that works better
61 
62 /* ============================ INQUIRY =================================== */
63 
64 /* //////////////////////////// PROTECTED ///////////////////////////////// */
65 protected:
66 
67  OsUtilLinux();
68  //:Default constructor (not implemented for this class)
69  // We identify this as a protected method so that gcc doesn't complain
70  // that the class only defines a private constructor and has no friends.
71 
72  virtual
73  ~OsUtilLinux();
74  //:Destructor (not implemented for this class)
75  // We identify this as a protected method so that gcc doesn't complain
76  // that the class only defines a private destructor and has no friends.
77 
78 /* //////////////////////////// PRIVATE /////////////////////////////////// */
79 private:
80 
81  OsUtilLinux(const OsUtilLinux& rOsUtilLinux);
82  //:Copy constructor (not implemented for this class)
83 
84  OsUtilLinux& operator=(const OsUtilLinux& rhs);
85  //:Assignment operator (not implemented for this class)
86 
87 
88 };
89 
90 /* ============================ INLINE METHODS ============================ */
91 
92 #endif // _OsUtilLinux_h_
93 
static int cvtOsPrioToLinuxPrio(const int osPrio)
Definition: OsUtilLinux.cpp:39
static int cvtLinuxPrioToOsPrio(const int linuxPrio)
Definition: OsUtilLinux.cpp:61
static int cvtOsPrioToLinuxRtPrio(const int osPrio)
Definition: OsUtilLinux.cpp:120
virtual ~OsUtilLinux()
void(* sighandler_t)(int)
Definition: OsUtilLinux.h:30
static sighandler_t signal(int signum, sighandler_t handler)
Definition: OsUtilLinux.cpp:181
Definition: OsTime.h:37
static void cvtOsTimeToTimespec(OsTime time1, struct timespec *time2)
Definition: OsUtilLinux.cpp:160
Definition: OsUtilLinux.h:35