CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_store_Lock_ 00008 #define _lucene_store_Lock_ 00009 00010 #include <limits.h> 00011 00012 CL_NS_DEF(store) 00013 class LocksType; 00014 00015 class LuceneLock: LUCENE_BASE{ 00016 public: 00017 LUCENE_STATIC_CONSTANT(int64_t, LOCK_POLL_INTERVAL = 1000); 00018 LUCENE_STATIC_CONSTANT(int64_t, LOCK_OBTAIN_WAIT_FOREVER = -1); 00019 00024 virtual bool obtain() = 0; 00025 00033 bool obtain(int64_t lockWaitTimeout); 00034 00035 // Release exclusive access. 00036 virtual void release() = 0; 00037 00040 virtual bool isLocked() = 0; 00041 00042 virtual ~LuceneLock(); 00043 00044 virtual TCHAR* toString() = 0; 00045 }; 00046 00047 00048 CL_NS_END 00049 #endif