📄 simple.mco
字号:
/******************************************************************
* *
* Copyright (c) 2001-2007 McObject LLC. All Right Reserved. *
* *
******************************************************************/
/* The simplest schema imaginable
*/
#define int1 signed<1>
#define int2 signed<2>
#define int4 signed<4>
#define int8 signed<8>
#define uint8 unsigned<8>
#define uint4 unsigned<4>
#define uint2 unsigned<2>
#define uint1 unsigned<1>
/* Object id is simply an unsigned long
*/
struct Id
{
uint4 seq;
};
declare database simple;
declare oid Id[20000];
struct Dyn
{
string s;
};
struct Fixed
{
uint1 v1;
uint2 v2;
uint4 v4;
uint8 v8;
};
/* The class supports object id and has four elements:
* integers "a", b", string "c", and 4-byte integer h;
* Two tree indexes are defined
* - one is unique, another is non-unique;
* One hash index is defined plus another
* global hash index by objid is supported as well;
* <list> declaration allows sequential cursors for the class
*/
class SimpleClass
{
uint2 a;
uint2 b;
string c;
uint4 h;
vector<uint2> vint;
vector<string> vs;
hash <h> SimpleKey[20000];
unique tree <a, b, c> Iabc;
tree <b,c> Ibc;
list;
oid;
};
/* Blobs
*/
class BlobClass
{
blob blo;
oid;
};
struct DynStruct
{
string s;
};
struct FixedStruct
{
uint1 v1;
uint2 v2;
uint4 v4;
uint8 v8;
};
class Arrays
{
int2 vint2[200]; /* integer array */
FixedStruct fs[200];
DynStruct ds[100];
list;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -