Click here to Skip to main content
15,897,093 members
Articles / Programming Languages / Visual C++ 10.0

SIP Stack (1 of 3)

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
20 Aug 2012CPOL3 min read 30.1K   1.7K   4  
SIP Stack Implementation on the basis of RFC SIP 3261 Specification
#pragma once

#ifndef CMessage_h
	#define CMessage_h

	#include "FWOS.h"
	#include "AMessage.h"
	#include "AMessageSource.h"
		
	namespace CoreFW 
	{
		template< typename ClassType >
		class CPoolObject ;

		class CORE_DLL_DECLARATION_SPECIFIER CMessage : public AMessage
		{
			friend class CPoolObject<CMessage> ;

		protected:
			CMessage() ;
			virtual ~CMessage() ;

		public:
			MESSAGE_ID_TYPE GetMessageID() const ;
			void SetMessageID( MESSAGE_ID_TYPE MessageID ) ;

			AMessageSource* GetMessageSource() const ;
			void SetMessageSource( AMessageSource *pMessageSource ) ;

			static CMessage* GetAvailable( MESSAGE_ID_TYPE MessageID, EnumMessageType eMessageType, AMessageHandler *pMessageTarget, 
											AMessageData *pMessageData = NULL, AMessageSource *pMessageSource = NULL ) ;
			FW_RETURN_TYPE Execute() ;

			void Release() ;

		protected:
			static CMessage* GetAvailable() ;

		private:
			void ReleaseParameters() ;

			void ReleaseCMessageData() ;

		private:
			long			m_MessageID ;
			AMessageSource	*m_pMessageSource ;
		} ;

		inline MESSAGE_ID_TYPE CMessage::GetMessageID() const
		{
			return m_MessageID ;
		}

		inline void CMessage::SetMessageID( MESSAGE_ID_TYPE MessageID )
		{
			m_MessageID = MessageID ;
		}

		inline AMessageSource* CMessage::GetMessageSource() const
		{
			return m_pMessageSource ;
		}

		inline void CMessage::SetMessageSource( AMessageSource *pMessageSource )
		{
			m_pMessageSource = pMessageSource ;
		}
	} // End namespace

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Hatim Haidry

VC++, Technical Architect

India

haidryhatim@gmail.com

Comments and Discussions