Click here to Skip to main content
15,894,017 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.4K   15  
The article describes the usage of a modularization framework called Remote SOF supporting distributed software modules.
#ifndef CONSOLE_COMMAND_H
#define CONSOLE_COMMAND_H

#include <string>
#include <vector>

#include "IAdministrationService.h"

namespace sof { namespace services { namespace admin {

using namespace std;

using namespace sof::services::admin;

/**
 * The <code>ConsoleCommand</code> is the base class for all
 * commands which are executed within the administration console.
 *
 * @author magr74
 */
class ConsoleCommand
{
	public:		

		/**
		 * Returns the name of the command which must be typed
		 * in administration console for executing.
		 *
		 * @return 
		 *		The name of the command.
		 */
		virtual string getName() = 0;

		/**
		 * Returns the description of the command. Can be called
		 * in the administration console.
		 *
		 * @return
		 *		The description (what the command does) of the command.
		 */
		virtual string getDescription() = 0;

		/**
		 * Returns the number parameters the command expects.
		 *
		 * @return
		 *		The number of parameters.
		 *
		 */
		virtual int getParameterNum() = 0;

		/**
		 * Executes the commmand.
		 *
		 * @param adminService
		 *				The <code>IAdministrationService</code> interface providing
		 *				the administration functionality which are executed by the commands.
		 *
		 * @param params
		 *				A vector of strings containing the parameter values.
		 *
		 * @return
		 *				The result string of the command which is displayed in the console.
		 */		
		virtual string execute( IAdministrationService* const adminService, vector<string> params ) = 0;
};

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