/usr/include/sipxtapi/os/OsMsg.h is in libsipxtapi-dev 3.3.0~test17-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | //
// Copyright (C) 2007 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// Copyright (C) 2004-2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////
#ifndef _OsMsg_h_
#define _OsMsg_h_
// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include "os/OsDefs.h"
#include "utl/UtlContainable.h"
#include "os/OsAtomics.h"
// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS
//:Base class for message queue buffers
class OsMsg : public UtlContainable
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:
enum MsgTypes
{
UNSPECIFIED = 0,
OS_SHUTDOWN, // Task shutdown request message
OS_TIMER, // Timer request messages
OS_EVENT, // Event notification messages
PS_MSG, // Phone set messages
PHONE_APP, // Phone application messages
MP_TASK_MSG, // Media processing task messages
MP_FLOWGRAPH_MSG, // Media processing flowgraph messages
MP_RESOURCE_MSG, // Media resource messages
MP_RES_NOTF_MSG, // Media resource notification messages
MP_BUFFER_MSG, // Media processing buffer queue messages
MI_NOTF_MSG, // Media Interface notification messages
SIP_PROXY_STATE, // SIP proxy call state message
TAO_MSG, // Tao messages
TAO_EVENT, // Tao listener event messages
TAO_LISTENER_EVENT_MSG,// Tao listener event message (call backs)
PINGER_MSG, // Pinger messages
REFRESH_MSG,
LINE_MGR_MSG,
OS_SYSLOG, // OS SysLog events
STREAMING_MSG, // Streaming related messages
USER_START = 128
};
//!enumcode: OS_SHUTDOWN - Task shutdown request message
//!enumcode: OS_TIMER - Timer request messages
//!enumcode: OS_EVENT - Event notification messages
//!enumcode: PS_MSG - Phone set messages
//!enumcode: PHONE_APP - Phone application class of messages
//!enumcode: MP_TASK_MSG - Media processing task class of messages
//!enumcode: MP_FLOWGRAPH_MSG - Media processing flowgraph class of messages
//!enumcode: MP_RESOURCE_MSG - Media processing resource class of messages for new (2007-03) resource framework
//!enumcode: MP_BUFFER_MSG - Media processing buffer queue messages
//!enumcode: SIP_PROXY_STATE - SIP proxy call state message
//!enumcode: OS_SYSLOG - OS SysLog Messages
//!enumcode: USER_START - User defined message type categories start at USER_START
static const UtlContainableType TYPE ; /** < Class type used for runtime checking */
/* ============================ CREATORS ================================== */
OsMsg(const unsigned char msgType, const unsigned char msgSubType);
//:Constructor
OsMsg(const OsMsg& rOsMsg);
//:Copy constructor
virtual OsMsg* createCopy(void) const;
//:Create a copy of this msg object (which may be of a derived type)
virtual void releaseMsg(void);
//:Done with message, delete it or mark it unused
virtual
~OsMsg();
//:Destructor
/* ============================ MANIPULATORS ============================== */
OsMsg& operator=(const OsMsg& rhs);
//:Assignment operator
virtual void setMsgSubType(unsigned char subType);
//:Set the message subtype
virtual void setSentFromISR(UtlBoolean sentFromISR);
//:Set the SentFromISR (interrupt service routine) flag
virtual void setReusable(UtlBoolean isReusable);
//:Set the Is Reusable (from permanent pool) flag
virtual void setInUse(UtlBoolean isInUse);
//:Set the Is In Use flag
/* ============================ ACCESSORS ================================= */
virtual unsigned char getMsgType(void) const;
//:Return the message type
virtual unsigned char getMsgSubType(void) const;
//:Return the message subtype
virtual int getMsgSize(void) const;
//:Return the size of the message in bytes
// This is a virtual method so that it will return the accurate size for
// the message object even if that object has been upcast to the type of
// an ancestor class.
virtual UtlBoolean getSentFromISR(void) const;
//:Return TRUE if msg was sent from an interrupt svc routine, else FALSE
virtual UtlBoolean isMsgReusable(void) const;
//:Return TRUE if msg is from a permanent pool, else FALSE
virtual UtlBoolean isMsgInUse(void) const;
//:Return TRUE if msg is currently in use, else FALSE
//! Implements the interface for a UtlContainable
virtual unsigned hash() const;
virtual UtlContainableType getContainableType() const;
virtual int compareTo(UtlContainable const *) const;
/* ============================ INQUIRY =================================== */
/* //////////////////////////// PROTECTED ///////////////////////////////// */
protected:
/* //////////////////////////// PRIVATE /////////////////////////////////// */
private:
unsigned char mMsgType;
unsigned char mMsgSubType;
UtlBoolean mSentFromISR;
UtlBoolean mReusable;
OsAtomicLightBool mInUse; ///< Access to mInUse should be synchronized,
///< because it can be accessed from different
///< threads - e.g. one thread can call setInUse()
///< freeing message, while other will call
///< isMsgInUse() seeking for free OsMsg.
};
/* ============================ INLINE METHODS ============================ */
#endif // _OsMsg_h_
|