0023065: This is desirable to add general DRAW command to estimate visualization...
[occt.git] / src / OSD / OSD_SharedMemory.cdl
1 -- Created on: 2021-03-15
2 -- Created by: Stephan GARNAUD (ARM)
3 -- Copyright (c) 1998-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
21
22
23
24
25
26 class SharedMemory from OSD 
27
28    ---Purpose: IPC Tools -Shared Memory
29    --          This is a low level interface for communications.
30    --          Using shared memory, processes can use a common area to
31    --          communicate.
32    --          You can create and delete a shared memory.
33
34 uses Error, AsciiString from TCollection
35 raises ConstructionError, NullObject, OSDError, ProgramError
36    
37
38 is
39   Create returns SharedMemory;
40     ---Purpose: Allocates room for shared memory name.
41     --          This is to be used with 'Open'.
42     --          In this case, the process is a client of shared memory.
43     ---Level: Advanced
44
45   Create (Name : AsciiString ; size : Integer) returns SharedMemory
46     ---Purpose: Instantiates SharedMemory object with parameters.
47     --          A name to make sure shared memory is unique and a size in
48     --          bytes for the size of shared memory.
49     --
50     --          Raises ConstructionError when the name contains characters 
51     --          not in range of ' '...'~'.
52     --          Raises ProgramError when the size given is negative or null.
53     --          This is for a server process.
54     --          
55     ---Level: Advanced
56     raises ConstructionError, ProgramError;
57
58   Build (me : in out)  is static;
59     ---Purpose: Creates a shared memory in the system
60     --          This is for a server process.
61     ---Level: Advanced
62
63   Open (me : in out ; Name : AsciiString ; size : Integer)
64     ---Purpose: Opens a shared memory
65     --          Raises ConstructionError when the name contains characters 
66     --          not in range of ' '...'~'.
67     --          Raises ProgramError when the size given is negative or null.
68     --          This is for a server process.
69     --          
70     ---Level: Advanced
71     raises ConstructionError, ProgramError is static;
72
73   Delete (me : in out)
74     ---Purpose: Removes a shared memory access.
75     --          This is used only by a server process !
76     ---Level: Advanced
77     raises ProgramError is static;
78
79   GiveAddress (me) returns Address
80     ---Purpose: Returns address of shared memory.
81     --          Raises NullObject when the Shared Memory is not created.
82     ---Level: Advanced
83     raises NullObject is static;
84
85   Failed (me) returns Boolean is static;
86     ---Purpose: Returns TRUE if an error occurs
87     ---Level: Advanced
88
89   Reset (me : in out) is static;
90     ---Purpose: Resets error counter to zero
91     ---Level: Advanced
92       
93   Perror (me : in out)
94     ---Purpose: Raises OSD_Error
95     ---Level: Advanced
96     raises OSDError is static;
97
98  Error (me) returns Integer is static;
99    ---Purpose: Returns error number if 'Failed' is TRUE.
100     ---Level: Advanced
101
102 fields
103    myId : Integer;     -- Shared memory ID
104    myAddress    : Address;
105    myName : AsciiString;   
106    mySize : Integer;
107    myError : Error;
108 end SharedMemory from OSD;
109