|
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER
// REMAINS UNCHANGED.
//
// Email: gustavo_franco@hotmail.com
//
// Copyright (C) 2005 Franco, Gustavo
//
#pragma once
#include "windows.h"
#include "stdio.h"
#include <iostream>
#include <process.h>
#include <oracl.h>
#include "AQException.h"
#include "AQTools.h"
using namespace System;
using namespace System::Threading;
using namespace System::Diagnostics;
namespace AQLib
{
#ifndef __AQConsumer__
#define __AQConsumer__
public __gc __abstract class AQConsumer
{
private:
static bool mTracingEnabled;
bool mExit;
protected:
Object* mPayload;
Thread* mRunningThread;
AutoResetEvent* mResetEvent;
bool mItemProcessed;
~AQConsumer();
private public:
static int ERROR_UNKNOW = -9999;
static String* SERROR_UNKNOW = "Unknow Error, Check for inner exception";
protected public:
AQConsumer();
__property bool get_ItemProcessed();
__property Thread* get_RunningThread();
__property void set_RunningThread(Thread* runningThread);
__property Object* get_Payload();
__property void set_Payload(Object* payload);
void Start();
bool Stop(bool softStop);
public:
__property static bool get_TracingEnabled();
__property static void set_TracingEnabled(bool enabled);
//This method will be called when a payload is received
virtual void ProcessPayload(Object *payload) = 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.
I started with programming about 19 years ago as a teenager, from my old Commodore moving to PC/Server environment Windows/UNIX SQLServer/Oracle doing gwBasic, QBasic, Turbo Pascal, Assembler, Turbo C, BC, Summer87, Clipper, Fox, SQL, C/C++, Pro*C, VB3/5/6, Java, and today loving C#.
Currently working as SDE on Failover Clustering team for Microsoft.
Passion for most programming languages and my kids Aidan&Nadia.