Click here to Skip to main content
15,894,539 members
Articles / Programming Languages / C#

SOF - An OSGI-like modularization framework for C++

Rate me:
Please Sign up or sign in to vote.
4.75/5 (22 votes)
24 Sep 2008BSD8 min read 88K   653   39  
The article describes the usage of a modularization framework called SOF.
#ifndef SERVICE_EVENT_H
#define SERVICE_EVENT_H

#include "ServiceReference.h"

namespace sof { namespace framework {

using namespace sof::framework;

/**
 * The <code>ServiceEvent</code> class describes
 * a change in the lifecycle of a service.<br>
 * Currently there are two events defined:<br>
 * <ul>
 *		<li>REGISTER: Service is registered with the 
 *						framework.
 *		<li>UNREGISTER: Service is unregistered with the 
 *						framework.
 * </ul>
 */
class ServiceEvent
{
	private:		
		
		/**
		 * The type of the event.
		 */
		int type;

		/**
		 * The service reference which represents
		 * the service whose lifecycle changed.
		 */
		ServiceReference reference;

	public:

		/**
		 * Definition of the events.
		 */
		enum EventType { REGISTER, UNREGISTER };

	public:

		/**
		 * Creates instances of class <code>ServiceEvent</code>.
		 *
		 * @param type
		 *				The type of the event.
		 *
		 * @param reference
		 *				Describes the service.
		 */
		ServiceEvent( const int &type, const ServiceReference &reference );

		/**
		 * Returns the type of the event.
		 *
		 * @return
		 *			The event type.
		 */
		int getType() const;

		/**
		 * Returns the service reference.
		 *
		 * @return
		 *			The <code>ServiceReference</code> object.
		 */
		ServiceReference getReference() const;

};

}}
#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 BSD License


Written By
Software Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions