亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fastdb.htm

?? 嵌入式數據庫軟件 嵌入式數據庫軟件 嵌入式數據庫軟件
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
to enable the compiler to detect the illegal usage of strings.<P>The cursor class provides the <code>get()</code> method for obtaining a pointer to the current record (stored inside the cursor). Also the overloaded '<code>operator-&gt;</code>'can be used to access components of the current record.If a cursor is opened for update,the current record can be changed and stored in the databaseby the <code>update()</code> method or can be removed.If the current record is removed, the next record becomes thecurrent. If there is no next record, then the previous record(if it exists)  becomes the current. The method <code>removeAll()</code>removes all records in the table.Whereas the method <code>removeAllSelected</code> only removes all records selected by the cursor.<P>When records are updated, the size of the database may increase.Thus an extension of the database section in the virtual memory is needed. As a result of such remapping, base addresses of the section can bechanged and all pointers to database fields kept by applications will become invalid. FastDB automatically updates current records in all opened cursors when a database section is remapped. So, when a database is updated, the programmer should access record fields only through the cursor <code>-&gt;</code> method. She/he should  not use pointer variables.<P>Memory used for the current selection can be released by the<code>reset()</code> method.This method is automatically called by the <code>select(), dbDatabase::commit(), dbDatabase::rollback()</code> methodsand the cursor destructor, so in most cases there is no need tocall the <code>reset()</code> method explicitly.<P>Cursors can also be used to access records by reference. The method<code>at(dbReference&lt;T&gt; const& ref)</code> sets the cursor to the recordpointed to by the reference. In this case, the selection consists exactly ofone record and the <code>next(), prev()</code> methods will always return <code>NULL</code>. Since cursors and references in FastDB are strictly typed, all necessary checking can be done statically by the compiler and no dynamic type checking is needed. The only kind of checking,which is done at runtime, is checking for null references.The object identifier of the current record in the cursor can be obtained bythe <code>currentId()</code> method.<P> It is possible to restrict the number of records returned by a select statement.The cursor class has the two methods<code>setSelectionLimit(size_t lim)</code> and<code>unsetSelectionLimit()</code>,which can be used to set/unset the limitof numbers of records returned by the query. In some situations,a  programmer may want to receiveonly one record or only few first records;  so the query executiontime and size of consumed memory can be reduced by limiting the size of selection. But if you specify an order for selected records, the query with the restriction to <I>k</I> records will not return the first <I>k</I> recordswith the smallest value of the key. Instead of this, arbitrary <I>k</I>records will be taken and then sorted.<P>So all operations with database data can be performed by means ofcursors. The only exception is the insert operation, for which FastDB provides an overloaded insert function:<PRE>        template&lt;class T&gt;        dbReference&lt;T&gt; insert(T const& record);</PRE>This function will insert a record at the end of the table and returna reference of the created object.The order of insertion is strictly specified in FastDBand applications can use this assumption about the record order in thetable. For applications widely using references for navigation betweenobjects, it is necessary to have some <I>root</I> object, from which atraversal by references can be made. A good candidate for such root objectis the first record in the table (it is also the oldest record in the table). This record can be accessed by execution of the <code>select()</code>method without parameter. The current record in the cursor willbe the first record in the table.<P>The C++ API of FastDB defines a special <code>null</code> variableof reference type.It is possible to compare the <code>null</code> variable with references or assign it to the reference:<P><PRE>        void update(dbReference&lt;Contract&gt; c) {            if (c != null) { 	        dbCursor&lt;Contract&gt; contract(dbCursorForUpdate);		contract.at(c);		contract-&gt;supplier = null;            }        }</PRE><A NAME="relative-parameter-binding">Query parameters usually are bound to C++ variables. In most cases in is convenient and flexible mechanism. But in multithreaded application, there is no warranty that the same query will not be executed at the same moment of time by another thread with different valuesof parameters. One solution is to use synchronization primitives (critical sections or mutexes)to prevent concurrent execution of the query. But this will lead to performance degradation.FastDB is able to perform read requests in parallel, increasing total system throughput.The other solution is to use delayed parameter binding. This approach is illustrated by the following example:<P>  <PRE>dbQuery q;struct QueryParams {     int         salary;    int         age;    int         rank;};void open(){    QueryParams* params = (QueryParams*)NULL;    q = "salary > ", params->salary, "and age < ", params->age, "and rank =", params->rank;}void find(int salary, int age, int rank) {     QueryParams params;    params.salary = salary;    params.age = age;    params.rank = rank;    dbCursor&lt;Person&gt; cusor;    if (cursor.select(q, &params) &gt; 0) {         do { 	    cout &lt;&lt; cursor->name &lt;&lt; NL;        } while (cursor.next());    }}</PRE>So in this example function <code>open</code> binds query parameters just to offsets of fields in structure. Later in <code>find</code> functions, actual pointer to the structurewith parameters is passed to the <code>select</code> structure. Function <code>find</code>can be concurrently executed by several threads and only one compiled version of the queryis used by all these threads. This mechanism is available since version 2.25.<P></A><H3><A NAME = "database">Database</A></H3>The class <code>dbDatabase</code> controls the application interactionswith the database. It performs synchronization of concurrent accesses to thedatabase, transaction management, memory allocation, error handling,...<P>The constructor of <code>dbDatabase</code> objects allows programmers to specifysome database parameters:<PRE>    dbDatabase(dbAccessType type = dbAllAccess,	       size_t dbInitSize = dbDefaultInitDatabaseSize,	       size_t dbExtensionQuantum = dbDefaultExtensionQuantum,	       size_t dbInitIndexSize = dbDefaultInitIndexSize,	       int nThreads = 1);</PRE>The following database access type are supported:<P><TABLE BORDER><TR><TH>Access type</TH><TH>Description</TH></TR><TR><TD><code>dbDatabase::dbReadOnly</code></TD><TD>Read only mode</TD></TR><TR><TD><code>dbDatabase::dbAllAccess</code></TD><TD>Normal mode</TD></TR><TR><TD><code>dbDatabase::dbConcurrentRead</code></TD><TD>Read only mode in which application can access the database concurrently with application updating the same database in <code>dbConcurrentUpdate</code> mode</TD></TR><TR><TD><code>dbDatabase::dbConcurrentUpdate</code></TD><TD>Mode to be used in conjunction with<code>dbConcurrentRead</code> to perform updates in the database without blocking read applications for a long time</TD></TR></TABLE><P>When the database is opened in readonly  mode, no new class definitions can be added to the database and definitionsof existing classes and indices can not be altered.<P><code>dbConcurrentUpdate</code> and <code>dbConcurrentRead</code> modes should be used together when database is mostly accessed in readonly mode and updates should not block readers for a long time. In this mode update of the database can be performed concurrently with read accesses (readers will not see changed data until transaction is committed). Only at update transaction commit time, exclusive lock is setbut immediately released after incremental change of the current object index.<P>So you can start one or more  applications using <code>dbConcurrentRead</code> mode and all their read-onlytransactions will be executed concurrently. You can also start one or more applications using  <code>dbConcurrentUpdate</code> mode. All transactions of such applications will be synchronized using additionalglobal mutex. So all these transactions (even read-only) will be executed exclusively. But transactions of the applicationrunning in <code>dbConcurrentUpdate</code> mode can run concurrently with transaction of applicationsrunning in <code>dbConcurrentRead</code> mode! Please look at <code>testconc.cpp</code> example, illustrating usage of these modes<P><B>Attension!</B> Do not mix <code>dbConcurrentUpdate</code> and <code>dbConcurrentRead</code> mode with other modes and do not use them together in one process (so it isnot possible to start two threads in one of which open database indbConcurrentUpdate mode and in other - in dbConcurrentRead). Do not use <code>dbDatabase::precommit</code> method in <code>dbConcurrentUpdate</code> mode.<P>The parameter <code>dbInitSize</code> specifies the initial size of the database file.The database file increases on demand; setting the initial size can only reduce the number of reallocations (which can take a lot of time).In the current implementation of the FastDB databasethe size is at least doubled at each extension.The default value of this parameter is 4 megabytes.<P>The parameter <code>dbExtensionQuantum</code>specifies the quantum of extension of thememory allocation bitmap. Briefly speaking, the value of this parameter specifies how much memorywill be allocated sequentially without attempt to reuse space ofdeallocated objects. The default value of this parameter is 4 Mb.See section <A HREF="#memory">Memory allocation</A> for more details.<P> The parameter <code>dbInitIndexSize</code> specifies the initial index size. All objects in FastDB are accessed through an object index.There are two copies of this object index:current and committed. Object indices are reallocated on demand; setting an initial index size can only reduce (or increase)the number of reallocations. The default value of this parameter is 64K object identifiers.<P>And the last parameter <code>nThreads</code> controls the level of queryparallelization. If it is greater than 1, then FastDB can start the parallelexecution of some queries (including sorting the result). The specified number of parallel threads willbe spawned by the FastDB engine in this case. Usually it does not makesense to specify the value of this parameter to be greater than thenumber of online CPUs in the system. It is also possible to pass zeroas the value of this parameter. In this case, FastDB will automatically detectthe number of online CPUs in the system. The number of threads also can be set by the <code>dbDatabase::setConcurrency</code> method at any moment of time.<P>The class <code>dbDatabase</code> contains a static field <code>dbParallelScanThreshold</code>, which specifies a threshold for thenumber of records in the table after which query parallelizationis used. The default value of this parameter is 1000.<P>The database can be opened by the<code>open(char const* databaseName, char const* fileName = NULL, unsigned waitLockTimeout = INFINITE)</code> method.If the file name parameter is omitted, it is constructed fromthe database name by appending the ".fdb" suffix. The database name shouldbe an arbitrary identifier consisting of any symbols except '\'.The last parameter <code>waitLockTimeout</code> can be set to prevent locking of allactive processes working with the database when some of them is crashed.If the crashed process had locked the database, then no other process can continue execution. To prevent it, you can specify maximal delay for waiting for the lock, after expiration of which system will try to perform recovery and continue executionof active processes.The method&nbsp;<code>open</code> returns <code>true</code> if the database wassuccessfully opened; or <code>false</code> if the open operation failed. In the last case, the database <code>handleError</code> method is called with a<code>DatabaseOpenError</code> error code. A database session can be terminatedby the <code>close</code> method, which implicitly commits current transactions.<P>In a multithreaded application each thread, which wants to access the database,should first be attached to it. The method <code>dbDatabase::attach()</code>allocates thread specific data and attaches the thread to the database.This method is automatically called by the <code>open()</code> method, sothere is no reason to call the <code>attach()</code> method for the thread,which opens the database. When the thread finishes work with the database, it shouldcall the <code>dbDatabase::detach()</code> method. The method <code>close</code> automatically invokes the <code>detach()</code> method. The method <code>detach()</code> implicitly commits current transactions.An attempt to access a database by a detached thread causes an assertion failure.<P>FastDB is able to perform compilation and execution of queries in parallel, providing significant increase of performance in multiprocessor systems.But concurrent updates of the database are not possible (this is the pricefor the efficient log-less transaction mechanism and zero time recovery).When an application wants to modify the database (open a cursor for update orinsert a new record in the table), it first locks the database in exclusive mode, prohibiting accesses to the database by other applications, even forread-only queries. So to avoid blocking of database applications for a long time, the modification transaction should be as short as possible. No blocking operations (like waiting for input from the user) should bedone within this transaction.<P>Using only shared and exclusive locks on the databaselevel, allows FastDB to almost eliminate overhead of locking and to optimize the speed of execution of non-conflicting operations. But if many applications simultaneously update different parts of the database, then theapproach used in FastDB will be very inefficient. That is why FastDB is mostsuitable for a single-application database access model or formultiple applications with a read-dominated access pattern model.<P> Cursor objects should be used only by one thread in amultithreaded application. If there are more than one threads in y

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草成人在线观看| 日韩一卡二卡三卡四卡| 一区视频在线播放| 亚洲精品成人精品456| 亚洲福利视频一区二区| 精品在线免费视频| 色综合久久久久| 日韩欧美国产综合在线一区二区三区| 欧美精品一区二区三区四区| 久久久影院官网| 久久久精品综合| 色哟哟国产精品免费观看| 日韩电影在线免费观看| 日产国产欧美视频一区精品| 一区二区三区在线影院| 国产suv精品一区二区6| 男女视频一区二区| 91精品国产手机| 欧美肥妇毛茸茸| 欧美福利视频导航| 韩国v欧美v日本v亚洲v| 久久精品国产精品青草| 亚洲午夜羞羞片| 欧美日韩卡一卡二| 成人精品亚洲人成在线| av一区二区三区在线| 日韩1区2区日韩1区2区| 亚洲欧美国产三级| 亚洲免费在线播放| 福利一区二区在线观看| 国产女同性恋一区二区| 欧美精品少妇一区二区三区| 91在线视频免费观看| 欧美又粗又大又爽| 亚洲成人中文在线| 精彩视频一区二区三区| 中文字幕成人在线观看| 亚洲国产精品尤物yw在线观看| 欧美一区二区性放荡片| 日本韩国一区二区三区视频| 综合激情网...| av不卡免费电影| 在线视频综合导航| 欧美性受xxxx| 91麻豆精品久久久久蜜臀| 91视频在线观看| 国产一区二区三区免费观看| 夜夜精品浪潮av一区二区三区| 综合婷婷亚洲小说| 亚洲国产精品久久人人爱| 美国欧美日韩国产在线播放| 综合久久久久久| 日本一区中文字幕| 色噜噜偷拍精品综合在线| 日韩欧美一区二区三区在线| 精品成人佐山爱一区二区| 视频一区二区三区中文字幕| 亚洲福利国产精品| 日本黄色一区二区| 欧美高清一级片在线| 日韩精品一区二区三区在线| 国产精品成人免费在线| 在线播放亚洲一区| 亚洲最新视频在线观看| 国产精品亚洲第一区在线暖暖韩国 | 日韩三级视频在线看| 26uuu亚洲| 久久亚洲二区三区| 奇米精品一区二区三区四区| 日本久久一区二区| 最新欧美精品一区二区三区| 国产福利不卡视频| 99视频有精品| 一区二区三区在线免费播放| 99re这里只有精品视频首页| 成人免费在线视频| 在线一区二区三区四区| 亚洲成a天堂v人片| 欧美一区二区在线不卡| 久久99精品久久久| 久久综合av免费| 高清在线成人网| 18欧美亚洲精品| 欧日韩精品视频| 精东粉嫩av免费一区二区三区| 日韩欧美久久久| av日韩在线网站| 亚洲国产日韩a在线播放性色| 日韩欧美高清dvd碟片| 国产成人精品综合在线观看| 亚洲精品免费在线观看| 欧美不卡激情三级在线观看| 精品国产亚洲一区二区三区在线观看| 日韩激情中文字幕| 一色屋精品亚洲香蕉网站| 91精品一区二区三区在线观看| 久草中文综合在线| 亚洲欧美日韩精品久久久久| 日韩午夜精品电影| 成人av动漫在线| 国产精品久久久久三级| 日韩一区二区影院| 欧美日韩一区视频| 午夜伦欧美伦电影理论片| 欧美日韩一区视频| 成人av综合一区| 韩国三级电影一区二区| 日本一不卡视频| 亚洲国产aⅴ成人精品无吗| 中文字幕乱码一区二区免费| 亚洲精品一区二区三区精华液 | 亚洲欧洲99久久| 久久精品一区二区| 日韩欧美国产电影| av中文字幕一区| 樱桃视频在线观看一区| 国产精品毛片高清在线完整版| 国产精品系列在线播放| 韩国三级电影一区二区| 久久精品国产精品亚洲精品| 久久99久久99| 国产真实乱子伦精品视频| 国产综合久久久久影院| 久久国产视频网| 国产精品一区二区黑丝| 激情综合色综合久久综合| 狠狠色丁香九九婷婷综合五月| 国模一区二区三区白浆| 99久久婷婷国产精品综合| 在线免费精品视频| 精品伦理精品一区| 亚洲日本在线视频观看| 亚洲成人免费av| 国产精品自在在线| 欧美色窝79yyyycom| www日韩大片| 五月婷婷综合激情| 97精品视频在线观看自产线路二| 欧美日韩一区二区三区在线看| 日韩视频在线一区二区| 亚洲男人的天堂在线观看| 精品无人码麻豆乱码1区2区| 欧美天天综合网| 国产精品久久久久久久久免费桃花| 亚洲福利一区二区三区| 成人动漫一区二区在线| 日韩欧美在线网站| 亚洲午夜久久久久久久久电影院| 精品一区二区免费在线观看| 色婷婷av一区二区三区gif| 日本一区二区三区四区| 青青草原综合久久大伊人精品优势| 色先锋资源久久综合| 国产清纯白嫩初高生在线观看91 | 91精品国产一区二区人妖| 亚洲人xxxx| 91麻豆swag| 亚洲国产精品视频| 欧美久久高跟鞋激| 亚洲成av人**亚洲成av**| 精品视频在线免费观看| 亚洲精品免费电影| 欧美日韩一区视频| 亚洲国产精品一区二区久久| 欧美日韩电影一区| 免费精品视频最新在线| 久久久久久免费| 不卡av在线网| 丝袜美腿亚洲一区二区图片| 欧美成人一级视频| 国内外精品视频| 亚洲美女淫视频| 欧美一区二区视频免费观看| 久久精品国产精品青草| 国产精品电影一区二区| 在线播放一区二区三区| 丁香啪啪综合成人亚洲小说| 亚洲精品菠萝久久久久久久| 欧美日韩黄色一区二区| 国产91在线|亚洲| 日日骚欧美日韩| 亚洲色图欧美激情| 精品国产乱码久久久久久1区2区 | 精品一区二区在线免费观看| 国产午夜亚洲精品羞羞网站| 欧美精品久久99久久在免费线| 高清久久久久久| 国内精品不卡在线| 亚洲电影激情视频网站| 亚洲三级久久久| 久久九九久久九九| 欧美一区二区不卡视频| 91丨porny丨中文| 色诱视频网站一区| 欧美少妇一区二区| 精品视频资源站| 欧洲亚洲精品在线| 日本二三区不卡| 一本色道久久综合亚洲91| 91在线视频播放|