Mixe for Privacy and Anonymity in the Internet
CAAccountingSettleThread.hpp
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000, The JAP-Team
00003 All rights reserved.
00004 Redistribution and use in source and binary forms, with or without modification,
00005 are permitted provided that the following conditions are met:
00006 
00007   - Redistributions of source code must retain the above copyright notice,
00008     this list of conditions and the following disclaimer.
00009 
00010   - Redistributions in binary form must reproduce the above copyright notice,
00011     this list of conditions and the following disclaimer in the documentation and/or
00012     other materials provided with the distribution.
00013 
00014   - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
00015     may be used to endorse or promote products derived from this software without specific
00016     prior written permission.
00017 
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
00022 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00024 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00025 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00027 */
00028 
00029 #ifndef __CAACCOUNTINGSETTLETHREAD__
00030 #define __CAACCOUNTINGSETTLETHREAD__
00031 
00032 #include "CAThread.hpp"
00033 #include "Hashtable.hpp"
00034 #include "CAConditionVariable.hpp"
00035 
00036 struct t_aiSettleItem
00037   {
00038     XERCES_CPP_NAMESPACE::DOMDocument* doc;
00039   };
00040 
00041 typedef struct t_aiSettleItem aiSettleItem;
00042 
00044 struct t_paymentInstanceListNode
00045 {
00046   t_paymentInstanceListNode* next;
00047   CACertificate* pCertificate;
00048   UINT32 u32Port;
00049   UINT8 arstrPIID[256];
00050   UINT8 arstrHost[256];
00051 };
00052 
00053 typedef struct t_paymentInstanceListNode tPaymentInstanceListEntry; 
00054 
00055 
00062 class CAAccountingSettleThread
00063 {
00064   public:
00065     CAAccountingSettleThread(Hashtable* a_accountingHashtable, UINT8* currentCascade);
00066     ~CAAccountingSettleThread();
00067     
00068     void settle();
00069     
00070         
00071   private:  
00072     CAConditionVariable* m_pCondition;
00073     CAConditionVariable* m_pForcedSettlementCondition;
00074     UINT8* m_settleCascade;
00075     static THREAD_RETURN mainLoop(void * param);
00076     CAThread* m_pThread;
00077     volatile bool m_bRun;
00078     Hashtable* m_accountingHashtable; 
00079     bool m_bSleep;
00080     /*CAAccountingBIInterface *m_pPiInterface;
00081     CAAccountingDBInterface *m_pDbInterface;*/
00082     
00083     
00084 };
00085 #endif