Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

ctreadertrader.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: ctreadertrader.h,v $
00003                              -------------------
00004     cvs         : $Id: ctreadertrader.h,v 1.3 2003/05/08 21:47:36 aquamaniac Exp $
00005     begin       : Wed Apr 23 2003
00006     copyright   : (C) 2003 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef CTREADERTRADER_H
00030 #define CTREADERTRADER_H
00031 
00032 #include <chipcard/cterror.h>
00033 #include <chipcard/ctreadercontext.h>
00034 
00035 
00039 class CTReaderTrader {
00040 public:
00041   typedef enum {
00042     CallBackContinue=0,
00043     CallBackAbort
00044   } CallBackResult;
00045 
00046 private:
00047   bool _next;
00048   unsigned int _readerFlags;
00049   unsigned int _readerFlagsMask;
00050   unsigned int _status;
00051   unsigned int _statusMask;
00052   unsigned int _statusDelta;
00053   int _requestid;
00054 
00055   int _responseLoop(int reqid, int maxloop);
00056 
00057 protected:
00058   virtual CallBackResult callback(bool first);
00059 
00060 public:
00061   CTReaderTrader(bool next=false,
00062                  unsigned int readerFlags=0,
00063                  unsigned int readerFlagsMask=0,
00064                  unsigned int status=0,
00065                  unsigned int statusMask=CHIPCARD_STATUS_LOCKED_BY_OTHER,
00066                  unsigned int statusDelta=0);
00067   virtual ~CTReaderTrader();
00068 
00069   virtual CTError start();
00070   virtual CTError stop();
00071 
00075   CTError getNext(CTReaderContext &tctx, int timeout);
00076 
00084   CTError peekNext(int timeout=0);
00085 
00086 };
00087 
00088 
00089 
00090 #endif
00091 
00092 

Generated on Fri Dec 3 23:10:24 2004 for libchipcard by  doxygen 1.3.9.1