COVISE Core
covise_shm.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef EC_SHM_H
9#define EC_SHM_H
10
11#include <covise/covise.h>
12
13#if !defined(_WIN32)
14#define SHARED_MEMORY
15#endif
16
17#ifdef _CRAYT3E
18#define HANDLE unsigned int
19#endif
20
21#include <util/coTypes.h>
22#include <util/coLog.h>
23
24#include <util/covise_list.h>
25//#include <net/covise_msg.h>
26#include <net/message.h>
28#ifdef _WIN32
29#include <windows.h>
30#include <windowsx.h>
31#endif
32
33/***********************************************************************\
34 ** **
35 ** Shared Memory Classes Version: 2.0 **
36 ** **
37 ** **
38 ** Description : All classes that deal with the creation and **
39 ** administration of shared memory. **
40 ** The SharedMemory class handles the operating system **
41 ** part of the shared memory management. **
42 ** is a utility class to organize the used **
43 ** and unused parts of the shared memory. **
44 ** ShmAccess allows only the access to the shared **
45 ** memory areas, not the allocation or return of **
46 ** allocated regions. **
47 ** coShmAlloc does all the administration of the shared **
48 ** memory regions, using trees with nodes which point **
49 ** to used and free parts. Here all allocation of **
50 ** regions in the shared memory takes place. **
51 ** coShmPtr and its subclassses provide an easy **
52 ** access to and initialization of pointers in **
53 ** the shared memory areas. **
54 ** **
55 ** Classes : SharedMemory, ShmAccess, coShmAlloc, **
56 ** coShmPtr, coCharcoShmPtr, coShortcoShmPtr, coIntcoShmPtr, **
57 ** LongcoShmPtr, coFloatcoShmPtr, DoublecoShmPtr **
58 ** **
59 ** Copyright (C) 1993 by University of Stuttgart **
60 ** Computer Center (RUS) **
61 ** Allmandring 30 **
62 ** 7000 Stuttgart 80 **
63 ** **
64 ** **
65 ** Author : A. Wierse (RUS) **
66 ** **
67 ** History : **
68 ** 15.04.93 Ver 1.0 **
69 ** 26.05.93 Ver 2.0 design reworked, basic data **
70 ** types clarified, compound data **
71 ** types added. **
72 ** **
73\***********************************************************************/
74namespace covise
75{
76class SharedMemory;
77class DataManagerProcess;
78
79const int SIZEOF_ALIGNMENT = 8;
80
82{
84 ACC_NONE = 0x1,
90};
91
92// IDs for the data type encoding (for IPC)
93#ifndef YAC
94const int NONE = 0;
95//const int CHAR = 1;
96//const int SHORT = 2;
97//const int INT = 3;
98//const int LONG = 4;
99//const int FLOAT = 5;
100//const int DOUBLE = 6;
101//const int CHARSHMPTR = 7;
102//const int SHORTSHMPTR = 8;
103//const int INTSHMPTR = 9;
104//const int LONGSHMPTR = 10;
105//const int FLOATSHMPTR = 11;
106//const int DOUBLESHMPTR = 12;
107const int CHARSHMARRAY = 13;
108const int SHORTSHMARRAY = 14;
109const int INTSHMARRAY = 15;
110#ifdef __GNUC__
111#undef LONGSHMARRAY
112#endif
113const int LONGSHMARRAY = 16;
114const int FLOATSHMARRAY = 17;
115const int DOUBLESHMARRAY = 18;
116const int EMPTYCHARSHMARRAY = 13 | 0x80;
117const int EMPTYSHORTSHMARRAY = 14 | 0x80;
118const int EMPTYINTSHMARRAY = 15 | 0x80;
119const int EMPTYLONGSHMARRAY = 16 | 0x80;
120const int EMPTYFLOATSHMARRAY = 17 | 0x80;
121const int EMPTYDOUBLESHMARRAY = 18 | 0x80;
122const int SHMPTRARRAY = 19;
123const int CHARSHM = 20;
124const int SHORTSHM = 21;
125const int INTSHM = 22;
126#ifdef __GNUC__
127#undef LONGSHM
128#endif
129const int LONGSHM = 23;
130const int FLOATSHM = 24;
131const int DOUBLESHM = 25;
132const int USERDEFINED = 26;
133const int SHMPTR = 27;
134const int COVISE_OBJECTID = 28;
135const int DISTROBJ = 29;
136const int STRINGSHMARRAY = 30;
137const int STRING = 31; // CHARPTR == STRING
138const int UNKNOWN = 37;
139const int COVISE_NULLPTR = 38;
140const int COVISE_OPTIONAL = 39;
141const int I_SLIDER = 40;
142const int F_SLIDER = 41;
143const int PER_FACE = 42;
144const int PER_VERTEX = 43;
145const int OVERALL = 44;
146const int FLOAT_SLIDER = 45;
147const int FLOAT_VECTOR = 46;
148const int COVISE_BOOLEAN = 47;
149const int BROWSER = 48;
150const int CHOICE = 49;
151const int FLOAT_SCALAR = 50;
152const int COMMAND = 51;
153const int MMPANEL = 52;
154const int TEXT = 53;
155const int TIMER = 54;
156const int PASSWD = 55;
157const int CLI = 56;
158const int ARRAYSET = 57;
159// do not exceed 127 (see EMPTY... = | 0x80)
160const int COLORMAP_MSG = 58;
161const int INT_SLIDER = 59;
162const int INT_SCALAR = 60;
163const int INT_VECTOR = 61;
164const int COLOR_MSG = 62;
165const int COLORMAPCHOICE_MSG = 63;
166const int MATERIAL_MSG = 64;
167
168#endif
169
170const int START_EVEN = 0;
171const int START_ODD = 4;
172
173const int OBJ_OVERWRITE = 0;
174const int OBJ_NO_OVERWRITE = 1;
175
176const int SET_CREATE = 0;
177
179{
180public:
182 {
183 }
185 {
186 }
187 char *ptr;
188 int fd;
189 long size;
190 void print()
191 {
192 }
193};
194
196{
197public:
199 static void *large_new(long size);
200 static void large_delete(void *);
201};
202typedef unsigned int shmSizeType;
203typedef unsigned int ArrayLengthType;
204typedef void(shmCallback)(int shmKey, shmSizeType size, char *address);
205
207
209{
211 friend class DataManagerProcess;
212 static class SharedMemory **shm_array;
214 static int global_seq_no;
216#if defined SHARED_MEMORY
217 int shmfd; // POSIX shared memory
218 int shmid; // SysV shared memory
219#elif defined(_WIN32)
220 HANDLE handle;
221 HANDLE filemap;
222#endif
224 char *data;
225 enum state
226 {
230 valid
231 };
233 int key;
236
237public:
239 SharedMemory(int shm_key, shmSizeType shm_size, int noDelete = 0);
240 SharedMemory(int *shm_key, shmSizeType shm_size);
243#if defined(__hpux) || defined(_SX)
244 void *get_pointer(int no);
245#else
246 void *get_pointer(int no)
247 {
249 {
250 return &(shm_array[no - 1]->data[2 * sizeof(int)]);
251 }
252 print_comment(__LINE__, __FILE__, "getting pointer: 0x0");
253 return NULL;
254 };
255#endif
257 {
258 return &(data[2 * sizeof(int)]);
259 };
261 {
262 return next;
263 }
265 {
266 return seq_no;
267 };
269 {
270 return (shmstate == attached);
271 };
272 int detach();
274 {
275 return key;
276 };
278 {
279 return size;
280 };
281 void get_shmlist(int *);
282 void print(){};
283 static int num_attached()
284 {
285 return global_seq_no;
286 }
287};
288// minimal allocation size for SHM segments - 64 MB
289
291{
292private:
293 ShmConfig();
297
298public:
299 static ShmConfig *the();
300 static covise::shmSizeType getMallocSize();
301};
302
303const int MAX_NO_SHM = 1000;
304
305const int COMPARE_ADDRESS = 1;
306const int COMPARE_SIZE = 2;
307
308class coShmPtr;
309class coShmAlloc;
310
312{
313protected:
315
316public:
317 ShmAccess(int k);
318 ShmAccess(int *k);
319 ShmAccess(char *, int noDelete = 1);
320 ~ShmAccess();
321 void add_new_segment(int k, shmSizeType size);
322 void *get_pointer(int no)
323 {
324 return shm->get_pointer(no);
325 };
327 {
328 return shm->get_pointer();
329 };
331 {
332 return shm->get_key();
333 };
334};
335
336class PackElement;
337class coShmPtrArray;
338class coDistributedObject;
339
341{
344 friend class coShmPtrArray;
345 friend class coDistributedObject; //__alpha
346protected:
349 int type;
350 void *ptr;
351
352public:
354 {
355 shm_seq_no = 0;
356 offset = 0;
357 type = NONE;
358 ptr = NULL;
359 };
361 {
362 return shm_seq_no;
363 };
365 {
366 return offset;
367 };
369 {
370 return type;
371 };
372 void *getPtr()
373 {
374 return ptr;
375 };
376 void print();
377};
378
380{
381protected:
382 friend class ShmMessage;
383 friend class DmgrMessage;
384 friend class coShmAlloc;
386 friend class DataManagerProcess;
388 inline void recalc()
389 {
390 if (shmptr == NULL)
391 shmptr = get_shared_memory();
392 ptr = (void *)((char *)shmptr->get_pointer(shm_seq_no) + offset);
393 type = *(int *)ptr; // the type is an integer at the beginning of the memory area
394 };
395
396public:
398 : coShmItem(){};
400 {
401 shm_seq_no = no;
402 offset = o;
403 if (!(shm_seq_no == 0 && offset == 0))
404 recalc();
405 };
407 {
408 shm_seq_no = *(int *)msg->data.data();
409 offset = *(int *)(&msg->data.data()[sizeof(int)]);
410 recalc();
411 };
412 void setPtr(int no, shmSizeType o)
413 {
414 shm_seq_no = no;
415 offset = o;
416 recalc();
417 };
418 void *getDataPtr() const
419 {
420 return (void *)((char *)ptr + sizeof(int)); // extra int is the type
421 };
422 // first integer holds type
423};
424
425template <typename DataType, int typenum>
426class coDataShm : public coShmPtr
427{
428public:
430 {
431 }
433 : coShmPtr(no, o)
434 {
435 if (type != typenum)
436 {
437 cerr << "wrong type from shared memory in coDataShm constructor: was" << type << ", expected " << typenum << std::endl;
438 print_exit(__LINE__, __FILE__, 1);
439 }
440 };
441 DataType get() const
442 {
443 return *((DataType *)(((char *)ptr) + sizeof(int)));// int is the type
444 }
445 operator DataType() const
446 {
447 return *((DataType *)(((char *)ptr) + sizeof(int)));// extra int is the type
448 }
449 DataType set(DataType val)
450 {
451 return (*((DataType *)(((char *)ptr) + sizeof(int))) = val);// extra int is the type
452 }
453 DataType &operator=(const DataType &c)
454 {
455 return *((DataType *)(((char *)ptr) + sizeof(int))) = c;// extra int is the type
456 }
457 void setPtr(int no, shmSizeType o)
458 {
459 coShmPtr::setPtr(no, o);
460 if (type != typenum)
461 {
462 cerr << "wrong type associated in coDataShm->setPtr: was" << type << ", expected " << typenum << std::endl;
463 print_exit(__LINE__, __FILE__, 1);
464 }
465 };
466};
467
468INST_TEMPLATE2(template class SHMEXPORT coDataShm<char, CHARSHM>)
470INST_TEMPLATE2(template class SHMEXPORT coDataShm<short, SHORTSHM>)
472INST_TEMPLATE2(template class SHMEXPORT coDataShm<int, INTSHM>)
474INST_TEMPLATE2(template class SHMEXPORT coDataShm<long, LONGSHM>)
476INST_TEMPLATE2(template class SHMEXPORT coDataShm<float, FLOATSHM>)
478INST_TEMPLATE2(template class SHMEXPORT coDataShm<double, DOUBLESHM>)
480
482{
483protected:
484 friend class Message;
485 friend class ShmMessage;
486 friend class coShmAlloc;
490 inline void recalc()
491 {
492 if (shmptr == NULL)
493 shmptr = get_shared_memory();
494 if (shm_seq_no != 0)
495 {
496 ptr = (void *)((char *)shmptr->get_pointer(shm_seq_no) + offset);
497 type = *(int *)ptr;
498 length = *(int *)((char *)ptr + sizeof(int)); // int type ArrayLengthType length
499 }
500 else
501 {
502 ptr = NULL;
503 type = *(int *)ptr & 0x7F; // empty array here
504 length = 0; // there is no array yet!!
505 }
506 };
507
508public:
510 : coShmItem()
511 {
512 length = 0;
513 }
514
516 {
517 shm_seq_no = no;
518 offset = o;
519 if (!(shm_seq_no == 0 && offset == 0))
520 recalc();
521 }
522
524 {
525 shm_seq_no = *(int *)msg->data.data();
526 offset = *(int *)(&msg->data.data()[sizeof(int)]);
527 recalc();
528 }
530 {
531 length = l;
532 }
534 {
535 return length;
536 }
537 void setPtr(int no, shmSizeType o)
538 {
539 shm_seq_no = no;
540 offset = o;
541 recalc();
542 }
543 void *getDataPtr() const
544 {
545 if (ptr)
546 return (void *)((char *)ptr + sizeof(int) + sizeof(ArrayLengthType));
547 // first integer holds type, second holds length
548 else
549 {
550 // inform datamanager that array is needed now!!
551 return NULL; // for now!!
552 }
553 }
554};
555
556template <typename DataType, int typenum>
558{
559public:
561 : coShmArray()
562 {
563 }
565 : coShmArray(no, o)
566 {
567 if (type != typenum)
568 {
569 cerr << "wrong type in coDataShmArray constructor from shared memory: expected " << typenum << ", was " << type << std::endl;
570 print_exit(__LINE__, __FILE__, 1);
571 }
572 }
573 void setPtr(int no, shmSizeType o)
574 {
575 coShmArray::setPtr(no, o);
576 if (type != typenum)
577 {
578 cerr << "wrong type in coDataShmArray->setPtr constructor from shared memory: expected " << typenum << ", was " << type << std::endl;
579 print_exit(__LINE__, __FILE__, 1);
580 }
581 if (length < 0)
582 {
583 cerr << "error in array length (< 0)\n";
584 }
585 };
586 DataType &operator[](size_t i)
587 {
588 if (i >= 0 && i < length)
589 return ((DataType *)(((char *)ptr) + sizeof(int)+sizeof(ArrayLengthType)))[i];
590 // else
591 cerr << "Access error for coDataShmArray\n"
592 << i << " not in 0.." << length - 1 << std::endl;
593 assert(i >= 0 && i < length);
594 return null_return;
595 }
596
597 const DataType &operator[](size_t i) const
598 {
599 if (i >= 0 && i < length)
600 return ((DataType *)(((char *)ptr) + 2 * sizeof(int)))[i];
601 // else
602 cerr << "Access error for coDataShmArray\n"
603 << i << " not in 0.." << length - 1 << std::endl;
604 assert(i >= 0 && i < length);
605 return null_return;
606 }
607
608private:
609 static DataType null_return;
610};
611
612template <typename DataType, int typenum>
614
615class SHMEXPORT coCharShmArray : public coDataShmArray<char, CHARSHMARRAY>
616{
617public:
619 {
620 }
622 : coDataShmArray<char, CHARSHMARRAY>(no, o)
623 {
624 }
625 int setString(const char *c)
626 {
627 char *chptr = (char *)getDataPtr();
628 if (chptr == NULL)
629 return 0;
630
631 ArrayLengthType i = 0;
632 while (c[i] != '\0' && i < length)
633 {
634 chptr[i] = c[i];
635 i++;
636 }
637 if (i < length)
638 chptr[i] = '\0';
639 return i;
640 }
641};
642
643INST_TEMPLATE2(template class SHMEXPORT coDataShmArray<short, SHORTSHMARRAY>)
653
655{
656public:
658 {
659 }
661 : coDataShmArray<char *, STRINGSHMARRAY>(no, o)
662 {
663 }
664 char *operator[](unsigned int i);
665 const char *operator[](unsigned int i) const;
666 void stringPtrSet(int no, int sn, shmSizeType of)
667 {
668 char *cptr = (char *)ptr;
669 int pos = 2*sizeof(int)/*(seq_nr+key)*/ + no*(sizeof(int)+sizeof(shmSizeType));
670 *((int *)(cptr+pos)) = sn;
671 *((int *)(cptr+pos+sizeof(int))) = of;
672 }
673 void stringPtrGet(int no, int *sn, shmSizeType *of)
674 {
675 char *cptr = (char *)ptr;
676 int pos = 2*sizeof(int)/*(seq_nr+key)*/ + no*(sizeof(int)+sizeof(shmSizeType));
677 *sn = *((int *)(cptr+pos));
678 *of = *((int *)(cptr+pos+sizeof(int)));
679 }
680};
681}
682#endif
#define INST_TEMPLATE2(x, y)
Definition: coExport.h:37
#define SHMEXPORT
Definition: coExport.h:289
#define NULL
Definition: covise_list.h:22
const GLubyte * c
Definition: khronos-glext.h:9864
GLuint address
Definition: khronos-glext.h:10368
GLsizeiptr size
Definition: khronos-glext.h:6610
GLuint GLfloat * val
Definition: khronos-glext.h:7898
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLintptr offset
Definition: khronos-glext.h:6611
GLenum GLuint GLenum GLsizei length
Definition: khronos-glext.h:6279
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: khronos-glext.h:6354
GLenum type
Definition: khronos-glext.h:6279
list of all chemical elements
Definition: coConfig.h:27
const int LONGSHM
Definition: covise_shm.h:129
const int COLOR_MSG
Definition: covise_shm.h:164
const int OVERALL
Definition: covise_shm.h:145
const int EMPTYSHORTSHMARRAY
Definition: covise_shm.h:117
const int OBJ_OVERWRITE
Definition: covise_shm.h:173
const int START_ODD
Definition: covise_shm.h:171
const int STRINGSHMARRAY
Definition: covise_shm.h:136
const int PASSWD
Definition: covise_shm.h:156
const int SIZEOF_ALIGNMENT
Definition: covise_shm.h:79
const int DOUBLESHM
Definition: covise_shm.h:131
const int EMPTYCHARSHMARRAY
Definition: covise_shm.h:116
const int INTSHMARRAY
Definition: covise_shm.h:109
const int SHORTSHMARRAY
Definition: covise_shm.h:108
const int FLOATSHMARRAY
Definition: covise_shm.h:114
const int COVISE_OPTIONAL
Definition: covise_shm.h:140
const int OBJ_NO_OVERWRITE
Definition: covise_shm.h:174
const int INTSHM
Definition: covise_shm.h:125
const int SHMPTR
Definition: covise_shm.h:133
const int EMPTYFLOATSHMARRAY
Definition: covise_shm.h:120
const int F_SLIDER
Definition: covise_shm.h:142
const int LONGSHMARRAY
Definition: covise_shm.h:113
const int TEXT
Definition: covise_shm.h:154
const int EMPTYINTSHMARRAY
Definition: covise_shm.h:118
const int DISTROBJ
Definition: covise_shm.h:135
const int FLOAT_SCALAR
Definition: covise_shm.h:151
const int INT_SCALAR
Definition: covise_shm.h:162
const int SHORTSHM
Definition: covise_shm.h:124
const int COVISE_BOOLEAN
Definition: covise_shm.h:148
const int NONE
Definition: covise_shm.h:94
const int COLORMAP_MSG
Definition: covise_shm.h:160
SHMEXPORT SharedMemory * get_shared_memory()
Definition: covise_shm.cpp:91
const int COLORMAPCHOICE_MSG
Definition: covise_shm.h:165
const int CHARSHMARRAY
Definition: covise_shm.h:107
const int CHOICE
Definition: covise_shm.h:150
const int ARRAYSET
Definition: covise_shm.h:158
const int PER_VERTEX
Definition: covise_shm.h:144
void() shmCallback(int shmKey, shmSizeType size, char *address)
Definition: covise_shm.h:204
void print_exit(int line, const char *filename, int how)
Definition: coLog.cpp:69
access_type
Definition: covise_shm.h:82
@ ACC_READ_WRITE_DESTROY
Definition: covise_shm.h:88
@ ACC_REMOTE_DATA_MANAGER
Definition: covise_shm.h:89
@ ACC_READ_ONLY
Definition: covise_shm.h:85
@ ACC_DENIED
Definition: covise_shm.h:83
@ ACC_READ_AND_WRITE
Definition: covise_shm.h:87
@ ACC_NONE
Definition: covise_shm.h:84
@ ACC_WRITE_ONLY
Definition: covise_shm.h:86
const int COMPARE_ADDRESS
Definition: covise_shm.h:305
double length(EDGE_VECTOR &vector)
Definition: CuttingSurfaceGPMUtil.h:70
const int EMPTYDOUBLESHMARRAY
Definition: covise_shm.h:121
unsigned int shmSizeType
Definition: covise_shm.h:202
const int CLI
Definition: covise_shm.h:157
const int COVISE_NULLPTR
Definition: covise_shm.h:139
const int MMPANEL
Definition: covise_shm.h:153
const int START_EVEN
Definition: covise_shm.h:170
const int COMMAND
Definition: covise_shm.h:152
const int FLOAT_VECTOR
Definition: covise_shm.h:147
const int TIMER
Definition: covise_shm.h:155
const int COMPARE_SIZE
Definition: covise_shm.h:306
const int SHMPTRARRAY
Definition: covise_shm.h:122
const int INT_SLIDER
Definition: covise_shm.h:161
const int COVISE_OBJECTID
Definition: covise_shm.h:134
const int FLOAT_SLIDER
Definition: covise_shm.h:146
const int EMPTYLONGSHMARRAY
Definition: covise_shm.h:119
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
const int MAX_NO_SHM
Definition: covise_shm.h:303
const int INT_VECTOR
Definition: covise_shm.h:163
const int MATERIAL_MSG
Definition: covise_shm.h:166
const int DOUBLESHMARRAY
Definition: covise_shm.h:115
unsigned int ArrayLengthType
Definition: covise_shm.h:203
const int UNKNOWN
Definition: covise_shm.h:138
const int USERDEFINED
Definition: covise_shm.h:132
const int CHARSHM
Definition: covise_shm.h:123
const int STRING
Definition: covise_shm.h:137
const int SET_CREATE
Definition: covise_shm.h:176
const int I_SLIDER
Definition: covise_shm.h:141
const int BROWSER
Definition: covise_shm.h:149
const int PER_FACE
Definition: covise_shm.h:143
const int FLOATSHM
Definition: covise_shm.h:130
std::enable_if< I==sizeof...(Tp), void >::type print(Stream &s, const std::tuple< Tp... > &t)
Definition: tokenbuffer_util.h:68
Definition: covise_list.h:78
const char * data() const
Definition: dataHandle.cpp:52
DataHandle data
Definition: message.h:67
Definition: message.h:76
Definition: dmgr.h:188
Definition: dmgr.h:216
Definition: dmgr.h:386
Definition: covise_msg.h:88
Definition: covise_shm.h:179
MMapEntry()
Definition: covise_shm.h:181
int fd
Definition: covise_shm.h:188
void print()
Definition: covise_shm.h:190
~MMapEntry()
Definition: covise_shm.h:184
char * ptr
Definition: covise_shm.h:187
long size
Definition: covise_shm.h:189
Definition: covise_shm.h:196
static List< MMapEntry > * mmaplist
Definition: covise_shm.h:198
Definition: covise_shm.h:209
int noDelete
Definition: covise_shm.h:235
void * get_pointer()
Definition: covise_shm.h:256
static List< SharedMemory > * shmlist
Definition: covise_shm.h:213
static int num_attached()
Definition: covise_shm.h:283
int is_attached()
Definition: covise_shm.h:268
void * get_pointer(int no)
Definition: covise_shm.h:246
int shmfd
Definition: covise_shm.h:217
SharedMemory * get_next_shm()
Definition: covise_shm.h:260
static class SharedMemory ** shm_array
Definition: covise_shm.h:212
state shmstate
Definition: covise_shm.h:232
int get_key()
Definition: covise_shm.h:273
SharedMemory()
Definition: covise_shm.h:238
int seq_no
Definition: covise_shm.h:234
int shmid
Definition: covise_shm.h:218
shmSizeType size
Definition: covise_shm.h:223
int get_seq_no()
Definition: covise_shm.h:264
static shmCallback * shmC
Definition: covise_shm.h:242
class SharedMemory * next
Definition: covise_shm.h:215
friend SHMEXPORT SharedMemory * get_shared_memory()
state
Definition: covise_shm.h:226
@ attached
Definition: covise_shm.h:227
@ invalid
Definition: covise_shm.h:229
@ detached
Definition: covise_shm.h:228
char * data
Definition: covise_shm.h:224
shmSizeType get_size()
Definition: covise_shm.h:277
void print()
Definition: covise_shm.h:282
static int global_seq_no
Definition: covise_shm.h:214
int key
Definition: covise_shm.h:233
Definition: covise_shm.h:291
size_t minSegSize
Definition: covise_shm.h:295
static ShmConfig * theShmConfig
Definition: covise_shm.h:296
Definition: covise_shm.h:312
void * get_pointer()
Definition: covise_shm.h:326
static SharedMemory * shm
Definition: covise_shm.h:314
void * get_pointer(int no)
Definition: covise_shm.h:322
int get_key()
Definition: covise_shm.h:330
Definition: covise_shm.h:341
coShmItem()
Definition: covise_shm.h:353
int type
Definition: covise_shm.h:349
friend int covise_decode_list(List< PackElement > *, char *, DataManagerProcess *, char)
int shm_seq_no
Definition: covise_shm.h:347
int get_shm_seq_no()
Definition: covise_shm.h:360
void * ptr
Definition: covise_shm.h:350
shmSizeType get_offset()
Definition: covise_shm.h:364
shmSizeType offset
Definition: covise_shm.h:348
void * getPtr()
Definition: covise_shm.h:372
friend coShmPtr * covise_extract_list(List< PackElement > *pack_list, char)
int get_type()
Definition: covise_shm.h:368
Definition: covise_shm.h:380
coShmPtr()
Definition: covise_shm.h:397
static SharedMemory * shmptr
Definition: covise_shm.h:387
void setPtr(int no, shmSizeType o)
Definition: covise_shm.h:412
coShmPtr(Message *msg)
Definition: covise_shm.h:406
coShmPtr(int no, shmSizeType o)
Definition: covise_shm.h:399
void * getDataPtr() const
Definition: covise_shm.h:418
void recalc()
Definition: covise_shm.h:388
Definition: covise_shm.h:427
coDataShm(int no, shmSizeType o)
Definition: covise_shm.h:432
DataType & operator=(const DataType &c)
Definition: covise_shm.h:453
DataType get() const
Definition: covise_shm.h:441
void setPtr(int no, shmSizeType o)
Definition: covise_shm.h:457
DataType set(DataType val)
Definition: covise_shm.h:449
coDataShm()
Definition: covise_shm.h:429
Definition: covise_shm.h:482
void * getDataPtr() const
Definition: covise_shm.h:543
static SharedMemory * shmptr
Definition: covise_shm.h:489
coShmArray(int no, shmSizeType o)
Definition: covise_shm.h:515
coShmArray(Message *msg)
Definition: covise_shm.h:523
ArrayLengthType length
Definition: covise_shm.h:488
void recalc()
Definition: covise_shm.h:490
ArrayLengthType get_length() const
Definition: covise_shm.h:533
coShmArray()
Definition: covise_shm.h:509
void set_length(ArrayLengthType l)
Definition: covise_shm.h:529
void setPtr(int no, shmSizeType o)
Definition: covise_shm.h:537
Definition: covise_shm.h:558
void setPtr(int no, shmSizeType o)
Definition: covise_shm.h:573
const DataType & operator[](size_t i) const
Definition: covise_shm.h:597
static DataType null_return
Definition: covise_shm.h:609
coDataShmArray(int no, shmSizeType o)
Definition: covise_shm.h:564
coDataShmArray()
Definition: covise_shm.h:560
DataType & operator[](size_t i)
Definition: covise_shm.h:586
Definition: covise_shm.h:616
coCharShmArray()
Definition: covise_shm.h:618
int setString(const char *c)
Definition: covise_shm.h:625
coCharShmArray(int no, shmSizeType o)
Definition: covise_shm.h:621
Definition: covise_shm.h:655
coStringShmArray(int no, shmSizeType o)
Definition: covise_shm.h:660
void stringPtrGet(int no, int *sn, shmSizeType *of)
Definition: covise_shm.h:673
coStringShmArray()
Definition: covise_shm.h:657
void stringPtrSet(int no, int sn, shmSizeType of)
Definition: covise_shm.h:666
Definition: coDistributedObject.h:296
Definition: coShmPtrArray.h:38