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

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

?? fastdb.htm

?? FastDb是高效的內存數據庫系統
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
  public:     int year() { 	return localtime((time_t*)&stamp)-&gt;tm_year + 1900;    }    ...    CLASS_DESCRIPTOR(dbDateTime, 		     (KEY(stamp,INDEXED|HASHED), 		      METHOD(year), METHOD(month), METHOD(day),		      METHOD(dayOfYear), METHOD(dayOfWeek),		      METHOD(hour), METHOD(minute), METHOD(second)));};    class Detail {   public:    char const* name;    char const* material;    char const* color;    real4       weight;    dbArray&lt; dbReference&lt;Contract&gt; &gt; contracts;    TYPE_DESCRIPTOR((KEY(name, INDEXED|HASHED), 		     KEY(material, HASHED), 		     KEY(color, HASHED),		     KEY(weight, INDEXED),		     RELATION(contracts, detail)));};class Contract {   public:    dbDateTime            delivery;    int4                  quantity;    int8                  price;    dbReference&lt;Detail&gt;   detail;    dbReference&lt;Supplier&gt; supplier;    TYPE_DESCRIPTOR((KEY(delivery, HASHED|INDEXED), 		     KEY(quantity, INDEXED), 		     KEY(price, INDEXED),		     RELATION(detail, contracts),		     RELATION(supplier, contracts)));};</PRE>Type descriptors should be defined for all classes used in the database.In addition to defining type descriptors, it is necessary to establisha mapping between C++ classes and database tables. The macro <code>REGISTER(</code>name<code>)</code> will do it. Unlike the<code>TYPE_DESCRIPTOR</code> macro, the <code>REGISTER</code> macro shouldbe used in the implementation file and not in the header file. It constructsa descriptor of the table associated with the class. If you are going to workwith multiple databases from one application, it is possible to registera table in a concrete database by means of the<code>REGISTER_IN(</code>name,database</code<code>)</code> macro. The parameter <code>database</code> of this macro should be a pointer to the<code>dbDatabase</code> object. You can register tablesin the database as follows:<P><PRE>REGISTER(Detail);REGISTER(Supplier);REGISTER(Contract);</PRE>The table (and correspondent class) can be used only with one database at each moment of time. When you open a database, FastDB imports intothe database all classes defined in the application.If a class with the same name already exists in the database, its descriptor stored in the database is compared with thedescriptor of this class in the application. If the class definitionsdiffer, FastDB tries to convert records from the table to the new format. Any kind of conversion between numeric types (integer toreal, real to integer, with extension or truncation) is allowed. Also,addition of new fields can be easily handled. But removal of fieldsis only possible for empty tables (to avoid accidental data destruction).<P>After loading all class descriptors, FastDB checks if all indices specified in the application class descriptor are already present in the database, constructs new indices andremoves indices, which are no more used. Reformatting the table and adding/removing indices is only possible when no more than oneapplication accesses the database. So when the first application is attachedto the database, it can perform table conversion. All other applicationscan only add new classes to the database.<P>There is one special internal database  <code>Metatable</code>, whichcontains information about other tables in the database. C++ programmersneed not access this table, because the format of database tables is specifiedby C++ classes. But in an interactive SQL program, it may be necessary toexamine this table to get information about record fields.<P>Starting from version 2.30 FastDB supports autoincrement fields(fields unique value to which are assigned automaticaly by database).To be able to use them you should:<P><OL><LI>Recompile FastDB and your application with <code>-DAUTOINCREMENT_SUPPROT</code> flags (add this flag to <code>DEFS</code> variables in FastDB makefile).<BR><B>Attention</B>: database files created by FastDB compiled without this option will be incompatible with FastDB compiled with <code>DAUTOINCREMENT_SUPPORT</code>.<LI>If you want to use other than 0 initial counter value, you shouldasssign value to <code>dbTableDescriptor::initialAutoincrementCount</code>.It will be shared between all tables, so all table will have the same initial value of autoincrement counter.<LI>Autoincrement fields should be of int4 type and should be declaredwith <code>AUTOINCREMENT</code> flag:<PRE>        class Record {             int4 rid;             char const* name;             ...                    TYPE_DESCRIPTOR((KEY(rid, AUTOINCREMENT|INDEXED), FIELD(name), ...));       }</PRE>              <LI>When record with autoincrement field is inserted in the databasethere is no need to specify value of autoincremented field (it will beignored). After successful insertion of record this field will beassigned unique value (which is guaranteed to be not used before thistable):<PRE>       Record rec;       // no rec.rid should be specified       rec.name = "John Smith";       insert(rec);       // rec.rid now assigned unique value       int newRecordId  = rec.rid; // and can be used to reference this record</PRE><LI>When record is removed the value will not be reused.When transaction is aborted, table autoincrement counter is also rolled back.</OL><P><H3><A NAME = "query">Query</A></H3>The class query is used to serve two purposes: <OL><LI>to construct a query and bind query parameters<LI>to cache compiled queries</OL>FastDB provides overloaded '<code>=</code>' and '<code>,</code>' C++ operatorsto construct query statements with parameters. Parameters can be specified  directly in places where they are used, eliminating any mapping betweenparameter placeholders and C variables. In the following sample query,pointers to the parameters <code>price</code> and <code>quantity</code> are stored in the query, so that the query can be executed several timeswith different parameter values. C++ overloaded functions make it possibleto automatically determine the type of the parameter, requiring no extra informationto be supplied by the programmer (such reducing the possibility of a bug). <PRE>        dbQuery q;        int price, quantity;        q = "price >=",price,"or quantity >=",quantity;</PRE> Since the  <code>char*</code> type can be used both for specifying a fractionof a query (such as "price >=") and for a parameter of string type,FastDB uses a special rule to resolve this ambiguity. This rule is based on theassumption that there is no reason for splitting a query text into two stringslike ("price ",">=") or specifying more than one parameter sequentially("color=",color,color). So FastDB assumes the first string to be a fractionof the query text and switches to <I>operand mode</I>after it. In <I>operand mode</I>, FastDB treats the <code>char*</code> argumentas a query parameter and switches back to query <I>text mode</I>, and so on...It is also possible not to use this "syntax sugar" and constructquery elements explicitly by the <code>dbQuery::append(dbQueryElement::ElementType type, void const* ptr)</code>method. Before appending elements to the query,it is necessary to reset the query by the <code>dbQuery::reset()</code> method('<code>operator=</code>' does it automatically).<P>It is not possible to use C++ numeric constants as query parameters, becauseparameters are accessed by reference. But it is possible to use stringconstants, because strings are passed by value. There two possible ways of specifying string parameters in a query: using a string buffer or apointer to pointer to string:<P><PRE>     dbQuery q;     char* type;     char name[256];     q = "name=",name,"and type=",&type;     scanf("%s", name);     type = "A";          cursor.select(q);     ...     scanf("%s", name);     type = "B";          cursor.select(q);     ...</PRE><P>Query variables can neither be passed to a function as a parameternor be assigned to another variable.When FastDB compiles the query, it saves the compiled tree in this object. The next time the query will be used, no compilation is needed and the already compiledtree can be used. It saves some time needed for query compilation.<P>FastDB provides two approaches to integrate user-defined types in databases.The first - the definition of class methods - was already mentioned. The other approach deals only with query construction. Programmers shoulddefine methods, which will not do actual calculations, but insteadreturn an expression (in terms of predefined database types), whichperforms the necessary calculation. It is better to describe it by example.FastDB has no builtin datetime type. Instead of this, a normal C++class <code>dbDateTime</code> can be used by the programmer. This class definesmethods allowing to specify datetime fields in ordered lists andto compare two dates using normal relational operators:<P><PRE>class dbDateTime {     int4 stamp;  public:    ...    dbQueryExpression operator == (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),"=",stamp;	return expr;    }    dbQueryExpression operator != (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),"<>",stamp;	return expr;    }    dbQueryExpression operator &lt; (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),">",stamp;	return expr;    }    dbQueryExpression operator &lt;= (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),">=",stamp;	return expr;    }    dbQueryExpression operator &gt; (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),"<",stamp;	return expr;    }    dbQueryExpression operator &gt;= (char const* field) { 	dbQueryExpression expr;	expr = dbComponent(field,"stamp"),"<=",stamp;	return expr;    }    friend dbQueryExpression between(char const* field, dbDateTime& from,				     dbDateTime& till)    { 	dbQueryExpression expr;	expr=dbComponent(field,"stamp"),"between",from.stamp,"and",till.stamp;	return expr;    }    friend dbQueryExpression ascent(char const* field) { 	dbQueryExpression expr;	expr=dbComponent(field,"stamp");	return expr;    }	    friend dbQueryExpression descent(char const* field) { 	dbQueryExpression expr;	expr=dbComponent(field,"stamp"),"desc";	return expr;    }	};</PRE>All these methods receive as their parameter a name of a field in the record.This name is used to contract the full name of the record's component.This  can be done by class <code>dbComponent</code>, which constructor takesthe name of the structure field and the name of the component of the structureand returns a compound name separated by a '.' symbol.The class <code>dbQueryExpression</code> is used to collect expression items.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费观看高清完整版在线观看| 精品一区二区三区不卡| 欧美乱妇一区二区三区不卡视频| 亚洲r级在线视频| 91精品国产丝袜白色高跟鞋| 玖玖九九国产精品| 欧美国产一区二区在线观看| 99久免费精品视频在线观看| 亚洲综合清纯丝袜自拍| 91精品蜜臀在线一区尤物| 老司机精品视频线观看86 | 精品噜噜噜噜久久久久久久久试看 | 国产亚洲午夜高清国产拍精品| 从欧美一区二区三区| 亚洲理论在线观看| 日韩视频在线永久播放| 国产成人av福利| 一区二区三区欧美日韩| 欧美sm极限捆绑bd| 波多野结衣视频一区| 亚洲大尺度视频在线观看| 欧美一级日韩免费不卡| 东方欧美亚洲色图在线| 夜夜精品视频一区二区| 日韩精品一区二区三区中文不卡| 大胆亚洲人体视频| 亚洲五月六月丁香激情| 久久影院午夜论| 一本久道久久综合中文字幕| 免费高清在线视频一区·| 国产区在线观看成人精品| 欧美日韩中文字幕精品| 国产精品一区二区视频| 一区二区三区国产精华| 精品国产乱码久久久久久久久| 91免费国产在线观看| 免费成人性网站| 中文字幕亚洲电影| 91精品国产麻豆国产自产在线 | av电影在线不卡| 免费国产亚洲视频| 亚洲狼人国产精品| 国产日韩欧美不卡| 91精品国产欧美一区二区18| 97aⅴ精品视频一二三区| 美腿丝袜亚洲三区| 亚洲免费观看高清| 久久久久99精品一区| 欧美日韩国产在线观看| 粉嫩一区二区三区在线看| 五月婷婷另类国产| 国产精品美日韩| 欧美成人一区二区三区在线观看| 一本色道久久综合精品竹菊| 国产福利精品一区二区| 三级欧美韩日大片在线看| 最新中文字幕一区二区三区| 精品动漫一区二区三区在线观看| 欧美自拍偷拍午夜视频| 国产高清精品在线| 美女网站视频久久| 亚洲成av人片www| 亚洲精品国产一区二区精华液 | 亚洲一二三四久久| 国产精品家庭影院| 久久一日本道色综合| 这里只有精品视频在线观看| 91日韩精品一区| 成人性生交大片免费看中文网站| 日本sm残虐另类| 亚洲第四色夜色| 亚洲乱码国产乱码精品精小说| 国产调教视频一区| 欧美电视剧在线看免费| 欧美蜜桃一区二区三区| 色婷婷国产精品| 99久久婷婷国产综合精品电影| 国产精品一级黄| 久久精品国产秦先生| 日韩精品五月天| 亚洲国产精品影院| 亚洲精品第1页| 亚洲欧美区自拍先锋| 中文字幕一区在线观看视频| 欧美激情自拍偷拍| 久久精品综合网| 久久久久久久久免费| 精品国产伦一区二区三区观看方式| 欧美精品久久99久久在免费线 | 欧美一区二区三区白人 | 欧美吻胸吃奶大尺度电影| 91免费观看视频| 不卡一区二区中文字幕| 国产成人久久精品77777最新版本| 国产综合色精品一区二区三区| 久久不见久久见免费视频7| 男女视频一区二区| 久久精品国产99| 久久国产精品99久久久久久老狼| 免费的成人av| 另类小说视频一区二区| 精品无人码麻豆乱码1区2区| 久久97超碰国产精品超碰| 精品一区二区三区视频| 韩国女主播一区| 国产精品影视网| 国产福利91精品一区二区三区| 国产aⅴ综合色| 99久久精品国产精品久久 | 91麻豆精品一区二区三区| 91香蕉视频污在线| 色香色香欲天天天影视综合网| 色综合天天做天天爱| 欧洲精品视频在线观看| 欧美色欧美亚洲另类二区| 欧美日韩国产另类不卡| 日韩一区二区在线免费观看| 日韩女优av电影在线观看| 精品国产一区a| 国产日韩欧美精品在线| 国产精品欧美极品| 亚洲三级久久久| 亚洲一区二区黄色| 日韩和欧美一区二区| 激情文学综合插| 国产成人福利片| 色婷婷综合久久久| 欧美性色综合网| 91精品国产免费| 国产三级精品三级在线专区| 18成人在线观看| 亚洲国产日日夜夜| 免费观看久久久4p| 国产激情91久久精品导航| 97久久人人超碰| 欧美日韩国产一二三| 日韩一级片网站| 国产欧美久久久精品影院| 亚洲人xxxx| 青青青爽久久午夜综合久久午夜| 精品影视av免费| 波多野结衣欧美| 欧美日韩国产电影| www久久久久| 亚洲欧美福利一区二区| 天堂成人免费av电影一区| 国产综合久久久久久鬼色 | 亚洲欧洲成人自拍| 香蕉久久一区二区不卡无毒影院| 久久99国产精品尤物| 99久免费精品视频在线观看 | 中文字幕不卡在线观看| 亚洲黄色片在线观看| 蜜桃av一区二区| 91视频com| 欧美mv和日韩mv国产网站| 成人欧美一区二区三区1314| 日韩成人免费电影| 成人高清视频免费观看| 欧美日高清视频| 国产午夜一区二区三区| 亚洲综合丝袜美腿| 国产九色精品成人porny | 精品人在线二区三区| 国产精品电影一区二区| 日本大胆欧美人术艺术动态| 丁香五精品蜜臀久久久久99网站 | 日韩欧美国产电影| 国产精品电影一区二区| 蜜臀av一区二区在线观看| 91亚洲永久精品| 精品福利一区二区三区免费视频| 亚洲色图清纯唯美| 久久精品国产精品亚洲红杏| 色综合久久综合网欧美综合网 | 精品欧美乱码久久久久久| 亚洲柠檬福利资源导航| 国产制服丝袜一区| 欧美另类videos死尸| 国产精品久久久久7777按摩| 久久精品国产亚洲5555| 欧洲日韩一区二区三区| 国产丝袜欧美中文另类| 日韩成人dvd| 色94色欧美sute亚洲线路一ni | 欧美日韩综合色| 国产精品久久久久aaaa| 九一九一国产精品| 欧洲av在线精品| 欧美韩国日本综合| 激情av综合网| 欧美男同性恋视频网站| 中文字幕日韩av资源站| 国产一区高清在线| 欧美精品第1页| 一区二区久久久久久| 高清国产一区二区三区| 日韩你懂的在线观看| 亚洲国产sm捆绑调教视频 | 欧美亚洲综合一区|