8 #ifndef CO_DISTRIBUTED_OBJECT_H
9 #define CO_DISTRIBUTED_OBJECT_H
52 class ApplicationProcess;
139 return getIntHeaderSize() *
sizeof(int);
154 if (number_of_elements_type ==
INTSHM)
155 return number_of_elements;
159 "numberOFElements not found");
166 if (version_type ==
INTSHM)
171 "version number not found");
183 if (refcount_type ==
INTSHM)
188 "reference counter not found");
201 const char *getName()
const;
213 return (
int)((&number_of_elements_type - &object_type) *
sizeof(
int));
217 return (
int)((&version_type - &object_type) *
sizeof(
int));
221 return (
int)((&refcount_type - &object_type) *
sizeof(
int));
240 number_of_elements_type =
INTSHM;
241 number_of_elements = noe;
260 attr_shm_seq_no = sn;
286 cout <<
"Type: " <<
type <<
", " << type_name << std::endl;
288 cout <<
"Description: " << description << std::endl;
290 cout <<
"Object Name: " << obj_name << std::endl;
291 cout <<
"Pointer: " << ptr << std::endl;
298 friend class coShmArrayPtr;
322 return rebuildFromShm();
324 virtual int rebuildFromShm() = 0;
328 "getObjInfo called from coDistributedObject");
333 bool checkObj(
int shmSegNo,
shmSizeType shmOffs,
bool &printed)
const;
341 void addAttribute(
const char *,
const char *);
344 void addAttributes(
int,
const char *
const *,
const char *
const *);
347 const char *getAttribute(
const char *)
const;
350 int getNumAttributes()
const;
353 int getAllAttributes(
const char ***
name,
const char ***content)
const;
373 return (0 == strcmp(reqType, type_name));
413 name =
new char[strlen(n) + 1];
431 strncpy(type_name, t, 7);
433 type_no = calcType(type_name);
437 name =
new char[strlen(n) + 1];
454 strncpy(type_name, t, 7);
456 type_no = calcType(type_name);
461 name =
new char[strlen(n) + 1];
467 if (createFromShm(shmarr) == 0)
485 int *store_header(
int,
int,
int,
int *,
data_type *,
long *,
int **);
486 int restore_header(
int **,
int,
int *,
int *,
shmSizeType *);
487 void init_header(
int *,
int *,
int,
data_type **,
long **);
493 void setType(
const char *,
const char *);
494 static int calcType(
const char *);
495 static char *calcTypeString(
int);
496 int getObjectInfo(
coDoInfo **)
const;
506 char *object_on_hosts()
const;
510 return refcount = refcount + 1;
515 return refcount = refcount - 1;
529 void getObjectFromShm();
532 bool checkObject()
const;
coDistributedObject(const coObjInfo &info)
Definition: coDistributedObject.h:398
coDistributedObject()
Definition: coDistributedObject.h:382
GLsizeiptr size
Definition: khronos-glext.h:6610
char * name
Definition: coDistributedObject.h:313
int decRefCount() const
Definition: coDistributedObject.h:513
coIntShm version
Definition: coDistributedObject.h:306
GLintptr offset
Definition: khronos-glext.h:6611
void set_object_type(int ot)
Definition: coDistributedObject.h:228
int number_of_elements_type
Definition: coDistributedObject.h:113
coDistributedObject(const coObjInfo &info, int shmSeg, shmSizeType offs, char *t)
Definition: coDistributedObject.h:444
const char * getName() const
Definition: coObjID.h:308
int getRefCount() const
Definition: coDistributedObject.h:517
Definition: covise_list.h:53
shmSizeType number_of_bytes
Definition: coDistributedObject.h:109
shmSizeType size
Definition: coDistributedObject.h:62
char * obj_name
Definition: coDistributedObject.h:272
GLuint GLuint GLsizei count
Definition: khronos-glext.h:6343
access_type
Definition: covise_shm.h:81
GLenum GLuint GLenum GLsizei length
Definition: khronos-glext.h:6279
int shm_seq_no
Definition: coDistributedObject.h:59
char * attribs
Definition: coDistributedObject.h:317
shmSizeType name_offset
Definition: coDistributedObject.h:121
int part_curr_number_of_parts_type
Definition: coDistributedObject.h:130
int get_number_of_elements_offset()
Definition: coDistributedObject.h:211
coDoInfo()
Definition: coDistributedObject.h:274
int size
Definition: coDistributedObject.h:316
GLfloat GLfloat GLfloat GLfloat h
Definition: khronos-glext.h:8441
const int NUMBER_OF_SHM_SIZE_HEADER_ELEMENTS
Definition: coDistributedObject.h:97
int part_object_type_type
Definition: coDistributedObject.h:126
~coDoInfo()
Definition: coDistributedObject.h:280
bool new_ok
Definition: coDistributedObject.h:315
long data_type
Definition: message.h:74
unsigned int shmSizeType
Definition: covise_shm.h:202
static int getIntHeaderSize()
Definition: coDistributedObject.h:142
#define DOEXPORT
Definition: coExport.h:319
int get_attr_type()
Definition: coDistributedObject.h:203
int getObjectType()
Definition: coDistributedObject.h:147
static List< VirtualConstructor > * vconstr_list
Definition: coDistributedObject.h:301
Definition: coDistributedObject.h:99
coShmArray * shmarr
Definition: coDistributedObject.h:308
int getObjectType_offset()
Definition: coDistributedObject.h:207
int incRefCount()
Definition: coDistributedObject.h:193
data_type type
Definition: coDistributedObject.h:92
int length
Definition: coDistributedObject.h:63
GLuint const GLchar * name
Definition: khronos-glext.h:6722
const int COVISE_OBJECTID
Definition: covise_shm.h:134
shmSizeType part_address_list_offset
Definition: coDistributedObject.h:134
int part_max_number_of_parts_type
Definition: coDistributedObject.h:128
coDoHeader * header
Definition: coDistributedObject.h:310
int name_type
Definition: coDistributedObject.h:119
const GLint * attribs
Definition: khronos-glext.h:11807
int get_number_of_elements()
Definition: coDistributedObject.h:152
virtual int getObjInfo(int, coDoInfo **) const
Definition: coDistributedObject.h:325
const int INTSHM
Definition: covise_shm.h:125
int type
Definition: coDistributedObject.h:79
int incRefCount() const
Definition: coDistributedObject.h:508
int part_curr_number_of_parts
Definition: coDistributedObject.h:131
void * ptr
Definition: coDistributedObject.h:273
const int NUMBER_OF_INT_HEADER_ELEMENTS
Definition: coDistributedObject.h:96
Definition: coObjID.h:230
shmSizeType attr_offset
Definition: coDistributedObject.h:124
shmSizeType offset
Definition: coDistributedObject.h:60
int decRefCount()
Definition: coDistributedObject.h:197
int attr_shm_seq_no
Definition: coDistributedObject.h:123
int refcount_type
Definition: coDistributedObject.h:117
void print()
Definition: coDistributedObject.h:70
int part_max_number_of_parts
Definition: coDistributedObject.h:129
coDistributedObject(const coObjInfo &info, const char *t)
Definition: coDistributedObject.h:420
GLdouble GLdouble t
Definition: khronos-glext.h:6449
int type_no
Definition: coDistributedObject.h:312
int get_refcount_offset()
Definition: coDistributedObject.h:219
int get_refcount()
Definition: coDistributedObject.h:181
char * ptr
Definition: coDistributedObject.h:64
void set(int i, const coDistributedObject *elem)
Definition: coShmPtrArray.cpp:107
char * getName() const
get the object's name
Definition: coDistributedObject.h:359
coStringShmArray * attributes
Definition: coDistributedObject.h:309
VirtualConstructor(int t_no, coDistributedObject *(*vc)(coShmArray *arr))
Definition: coDistributedObject.h:81
Definition: coDistributedObject.h:56
int objectid_type
Definition: coDistributedObject.h:110
int version
Definition: coDistributedObject.h:116
Definition: covise_appproc.h:19
void set_number_of_elements(int noe)
Definition: coDistributedObject.h:238
const char * description
Definition: coDistributedObject.h:271
int part_object_type
Definition: coDistributedObject.h:127
int loc_version
Definition: coDistributedObject.h:314
Definition: coDistributedObject.h:90
void print()
Definition: coDistributedObject.h:284
GLenum src
Definition: khronos-glext.h:7031
const int COVISE_NULLPTR
Definition: covise_shm.h:139
int refcount
Definition: coDistributedObject.h:118
void get_objectid(int *h, int *t)
Definition: coDistributedObject.h:223
int version_type
Definition: coDistributedObject.h:115
static int xfer_arrays
Definition: coDistributedObject.h:303
void set_version(int v)
Definition: coDistributedObject.h:243
void print_error(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:132
Definition: covise_shm.h:654
const int SHMPTR
Definition: covise_shm.h:133
Definition: covise_shm.h:481
int attr_type
Definition: coDistributedObject.h:122
int part_address_list_shm_seq_no
Definition: coDistributedObject.h:133
int object_type
Definition: coDistributedObject.h:108
int objectid_h
Definition: coDistributedObject.h:111
int number_of_elements
Definition: coDistributedObject.h:114
GLdouble n
Definition: khronos-glext.h:8447
void set_refcount(int rc)
Definition: coDistributedObject.h:248
void PackElement_print(PackElement *th)
Definition: coDistributedObject.cpp:1645
int objectid_t
Definition: coDistributedObject.h:112
int type
Definition: coDistributedObject.h:61
void print()
Definition: coDistributedObject.h:86
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
bool objectOk() const
check whether object was created or received ok
Definition: coDistributedObject.h:377
GLenum type
Definition: khronos-glext.h:6279
void print() const
Definition: coDistributedObject.h:521
int isType(const char *reqType) const
check whether this is a certain type
Definition: coDistributedObject.h:371
Definition: coDistributedObject.h:295
void set_objectid(int h, int t)
Definition: coDistributedObject.h:232
int get_version_offset()
Definition: coDistributedObject.h:215
PackElement()
Definition: coDistributedObject.h:65
static int getHeaderSize()
Definition: coDistributedObject.h:137
void addAttributes(int sn, shmSizeType o)
Definition: coDistributedObject.h:254
#define NULL
Definition: covise_list.h:22
const char * type_name
Definition: coDistributedObject.h:270
Definition: coDistributedObject.h:266
int type
Definition: coDistributedObject.h:269
int name_shm_seq_no
Definition: coDistributedObject.h:120
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
const char * getType() const
get the object's type
Definition: coDistributedObject.h:365
coIntShm refcount
Definition: coDistributedObject.h:307
const GLdouble * v
Definition: khronos-glext.h:6442
int increase_version()
Definition: coDistributedObject.h:176
GLuint GLint GLboolean GLint GLenum access
Definition: khronos-glext.h:8584
int part_address_list_type
Definition: coDistributedObject.h:132
int createFromShm(coShmArray *arr)
Definition: coDistributedObject.h:319
const void * ptr
Definition: coDistributedObject.h:93
Definition: coDistributedObject.h:76
int get_version()
Definition: coDistributedObject.h:164
int get_type_no() const
Definition: coDistributedObject.h:497