Modesto Execution

#include "globals.h"
#include <iostream>

int main()
{
	Modesto *modesto = new  Modesto('config.xml');

	modesto->loadModules();

	if (modesto->connect())
	{
		// Starts the thread that will start listening to the sockets.
		// When the socket receives a message, it will place the RawCmd into a std::vector<RawCmd>
		// which wille be defined as a MessageQueue
		modesto->startListening();
	}

	while (modesto->isRunning())
	{
		MessageQueue queue = this->retrieveMessages();
		for (MessageQueueIter cmd = queue.begin(); it != queue.end(); ++it)
		{
			modesto->executeCommand((*cmd));
		}
	}

	modesto->unloadModules();

	return 0;
}

Last edited Sep 11, 2013 at 12:13 AM by cbutcher, version 1

Comments

No comments yet.