Click here to Skip to main content
15,886,578 members
Articles / Programming Languages / C++

Remote SOF - An OSGI-like modularization framework for C++ supporting distributed software modules

Rate me:
Please Sign up or sign in to vote.
4.58/5 (8 votes)
13 Jul 2009BSD10 min read 31.3K   15  
The article describes the usage of a modularization framework called Remote SOF supporting distributed software modules.
#ifndef REMOTE_SERVICE_REFERENCE_H
#define REMOTE_SERVICE_REFERENCE_H

#include <string>

#include "sof/framework/ServiceReference.h"
#include "sof/framework/SOFException.h"

#include "./generated/CORBAObjects.h"

namespace sof { namespace framework { namespace remote { namespace corba {

using namespace std;

using namespace sof::framework;
using namespace sof::framework::remote::corba::generated;

/**
 * The <code>RemoteServiceReference</code> class extends the
 * <code>ServiceReference</code> class by remote related features.
 *
 * @author magr74
 */
class RemoteServiceReference : public ServiceReference
{
	private:

		/**
		 * The object identifier of the remote service.
		 */
		string remoteObjectID;

		/**
		 * The remote service object represented by a CORBA object.
		 */
		CORBAService_var remoteService;

	public:

		/**
		 * Creates instances of type <code>RemoteServiceReference</code>.
		 *
		 * @param name
		 *			The name of the remote service.
		 *
		 * @param properties
		 *			The properties of the remote service.
		 *
		 * @param serviceObj
		 *			The remote service object which is represented by a CORBA object.
		 *
		 * @param objID
		 *			The object identifier of the remote service object.
		 */
		RemoteServiceReference( const string &name, const Properties &properties, CORBAService_var serviceObj, const string& objID );

		/**
		 * Copy constructor.
		 *
		 * @param serviceRef
		 *				The remote service reference object which is copied.
		 */
		RemoteServiceReference( const RemoteServiceReference& serviceRef );

		/**
		 * The assignment operator.
		 *
		 * @param serviceRef
		 *				The remote service reference object which is assigned to this object.
		 *
		 * @return
		 *				This remote service reference object.
		 */
		virtual RemoteServiceReference &operator=( const RemoteServiceReference &serviceRef );

		/**
		 * Destroys objects of type <code>RemoteServiceReference</code>.
		 */
		virtual ~RemoteServiceReference();

		/**
		 * Returns the identifier of the remote service.
		 *
		 * @return
		 *		The object identifier of the remote service.
		 */
		virtual string getRemoteServiceID() const;

		/**
		 * The remote service object represented by a CORBA object.
		 *
		 * @return
		 *			The CORBA object.
		 */
		virtual CORBAService_var getRemoteService() const;

		/**
		 * Compares the passed <code>RemoteServiceReference</code> object with this object.
		 *
		 * @param serviceReference
		 *				The service reference object which is compared with this object.
		 *
		 * @return
		 *				True, if both objects are equal, otherwise false.
		 */
		virtual bool operator==( const RemoteServiceReference& serviceReference );

		/**
		 * Returns the string representation of this object.
		 *
		 * @return
		 *			The string representation.
		 */
		virtual string toString() const;

		/**
		 * Returns the local service.
		 *
		 * @return
		 *			The local service object.
		 */
		virtual IService::ConstPtr getService() 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