b311480e |
1 | -- Created on: 1993-03-17 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | deferred generic class ProtocolTemplate from LibCtl |
24 | (TheObject as any) |
25 | inherits Transient |
26 | |
27 | ---Purpose : This class is a Template class for Library : there is no |
28 | -- obligation to inherit it for instantiate a Library class. |
29 | -- |
30 | -- A Protocol class defines a data scheme by gathering a set of |
31 | -- Object Classes. This set is made of : |
32 | -- - As necessary, other sets already defined by other Protocols. |
33 | -- These Protocols are the Resources of <myclass> |
34 | -- This definition can be recurrent : each Protocol class |
35 | -- defines its Resources at immediate level |
36 | -- - The list of Object Classes it identifies DIRECTLY (itself), |
37 | -- i.e. not through its Resources. |
38 | -- |
39 | -- A classic Selection criterium is DynamicType (for a Transient |
40 | -- or Persistent Object), this gives a Case Number per Class. If |
41 | -- another criterium is taken, it must assume unique and non- |
42 | -- ambiguous binding between an object state and a Cse Number. |
43 | -- |
44 | -- For each Object Class (or recognized state) it identifies |
45 | -- directly, it provides a unique positive Number, which can be |
46 | -- used as Case Number. |
47 | -- |
48 | -- A Module bound with a Protocol class is assumed to accept any |
49 | -- Object of a Class it defines DIRECTLY (not its Resources). |
50 | |
51 | uses Type |
52 | |
53 | is |
54 | |
55 | NbResources (me) returns Integer is deferred; |
56 | ---Purpose : Gives the count of Protocols used as Resource (can be zero) |
57 | |
58 | Resource (me; num : Integer) returns ProtocolTemplate is deferred; |
59 | ---Purpose : Returns a Resource, given a rank. |
60 | |
61 | CaseNumber (me; obj : any TheObject) returns Integer is deferred; |
62 | ---Purpose : Returns a Case Number, specific of each recognized Object |
63 | -- This is a positive number. Zero means "<obj> not recognized" |
64 | |
65 | end ProtocolTemplate; |