blob: 0528d9eaa2b1c6e4c304ae1faee7accbb4078491 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
#pragma once
#include <queue>
#include "CrossfireEvent.h"
#include "CrossfireRequest.h"
#include "CrossfireResponse.h"
#include "JSONParser.h"
#include "Value.h"
#include "Logger.h"
class CrossfireProcessor {
public:
CrossfireProcessor();
~CrossfireProcessor();
virtual bool createEventPacket(CrossfireEvent* eventObj, std::wstring** _value);
virtual bool createResponsePacket(CrossfireResponse* response, std::wstring** _value);
virtual bool parseRequestPacket(std::wstring* msg, CrossfireRequest** _value);
private:
JSONParser* m_jsonParser;
unsigned int m_nextEventSeq;
/* constants */
static const wchar_t* HEADER_CONTENTLENGTH;
static const wchar_t* LINEBREAK;
static const size_t LINEBREAK_LENGTH;
static const wchar_t* NAME_ARGUMENTS;
static const wchar_t* NAME_BODY;
static const wchar_t* NAME_COMMAND;
static const wchar_t* NAME_CONTEXTID;
static const wchar_t* NAME_DATA;
static const wchar_t* NAME_EVENT;
static const wchar_t* NAME_REQUESTSEQ;
static const wchar_t* NAME_RUNNING;
static const wchar_t* NAME_SEQ;
static const wchar_t* NAME_SUCCESS;
static const wchar_t* NAME_TYPE;
static const wchar_t* VALUE_EVENT;
static const wchar_t* VALUE_REQUEST;
static const wchar_t* VALUE_RESPONSE;
};