8#ifndef CO_DISTRIBUTED_OBJECT_H
9#define CO_DISTRIBUTED_OBJECT_H
52class 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;
314 int loc_version = -1;
322 return rebuildFromShm();
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)
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;
#define DOEXPORT
Definition: coExport.h:331
#define NULL
Definition: covise_list.h:22
GLdouble n
Definition: khronos-glext.h:8447
GLenum src
Definition: khronos-glext.h:7031
GLsizeiptr size
Definition: khronos-glext.h:6610
const GLdouble * v
Definition: khronos-glext.h:6442
GLuint GLuint GLsizei count
Definition: khronos-glext.h:6343
GLdouble GLdouble t
Definition: khronos-glext.h:6449
GLuint GLint GLboolean GLint GLenum access
Definition: khronos-glext.h:8584
GLuint const GLchar * name
Definition: khronos-glext.h:6722
GLintptr offset
Definition: khronos-glext.h:6611
GLenum GLuint GLenum GLsizei length
Definition: khronos-glext.h:6279
const GLint * attribs
Definition: khronos-glext.h:11807
GLenum type
Definition: khronos-glext.h:6279
GLfloat GLfloat GLfloat GLfloat h
Definition: khronos-glext.h:8441
list of all chemical elements
Definition: coConfig.h:27
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
void print_error(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:132
const int INTSHM
Definition: covise_shm.h:125
const int SHMPTR
Definition: covise_shm.h:133
const int NUMBER_OF_SHM_SIZE_HEADER_ELEMENTS
Definition: coDistributedObject.h:97
void PackElement_print(PackElement *th)
Definition: coDistributedObject.cpp:1596
long data_type
Definition: message.h:28
access_type
Definition: covise_shm.h:82
unsigned int shmSizeType
Definition: covise_shm.h:202
const int COVISE_NULLPTR
Definition: covise_shm.h:139
const int COVISE_OBJECTID
Definition: covise_shm.h:134
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
const int NUMBER_OF_INT_HEADER_ELEMENTS
Definition: coDistributedObject.h:96
std::enable_if< I==sizeof...(Tp), void >::type print(Stream &s, const std::tuple< Tp... > &t)
Definition: tokenbuffer_util.h:68
Definition: coObjID.h:231
const char * getName() const
Definition: coObjID.h:308
Definition: covise_list.h:78
Definition: dataHandle.h:18
Definition: covise_appproc.h:20
void * getPtr()
Definition: covise_shm.h:372
Definition: covise_shm.h:482
Definition: covise_shm.h:655
Definition: coDistributedObject.h:57
int length
Definition: coDistributedObject.h:63
int type
Definition: coDistributedObject.h:61
int shm_seq_no
Definition: coDistributedObject.h:59
shmSizeType offset
Definition: coDistributedObject.h:60
char * ptr
Definition: coDistributedObject.h:64
shmSizeType size
Definition: coDistributedObject.h:62
PackElement()
Definition: coDistributedObject.h:65
void print()
Definition: coDistributedObject.h:70
Definition: coDistributedObject.h:77
void print()
Definition: coDistributedObject.h:86
VirtualConstructor(int t_no, coDistributedObject *(*vc)(coShmArray *arr))
Definition: coDistributedObject.h:81
int type
Definition: coDistributedObject.h:79
Definition: coDistributedObject.h:91
data_type type
Definition: coDistributedObject.h:92
const void * ptr
Definition: coDistributedObject.h:93
Definition: coDistributedObject.h:100
int get_version_offset()
Definition: coDistributedObject.h:215
int part_address_list_shm_seq_no
Definition: coDistributedObject.h:133
void set_version(int v)
Definition: coDistributedObject.h:243
int get_number_of_elements()
Definition: coDistributedObject.h:152
int decRefCount()
Definition: coDistributedObject.h:197
static int getHeaderSize()
Definition: coDistributedObject.h:137
int objectid_t
Definition: coDistributedObject.h:112
int attr_type
Definition: coDistributedObject.h:122
int number_of_elements
Definition: coDistributedObject.h:114
shmSizeType attr_offset
Definition: coDistributedObject.h:124
int name_type
Definition: coDistributedObject.h:119
int get_refcount()
Definition: coDistributedObject.h:181
int get_version()
Definition: coDistributedObject.h:164
int attr_shm_seq_no
Definition: coDistributedObject.h:123
int objectid_h
Definition: coDistributedObject.h:111
int name_shm_seq_no
Definition: coDistributedObject.h:120
void set_number_of_elements(int noe)
Definition: coDistributedObject.h:238
int number_of_elements_type
Definition: coDistributedObject.h:113
int part_object_type_type
Definition: coDistributedObject.h:126
int getObjectType()
Definition: coDistributedObject.h:147
void addAttributes(int sn, shmSizeType o)
Definition: coDistributedObject.h:254
int refcount_type
Definition: coDistributedObject.h:117
shmSizeType part_address_list_offset
Definition: coDistributedObject.h:134
void set_refcount(int rc)
Definition: coDistributedObject.h:248
int part_address_list_type
Definition: coDistributedObject.h:132
int objectid_type
Definition: coDistributedObject.h:110
int get_refcount_offset()
Definition: coDistributedObject.h:219
int part_curr_number_of_parts_type
Definition: coDistributedObject.h:130
int incRefCount()
Definition: coDistributedObject.h:193
int part_curr_number_of_parts
Definition: coDistributedObject.h:131
shmSizeType number_of_bytes
Definition: coDistributedObject.h:109
int increase_version()
Definition: coDistributedObject.h:176
int version
Definition: coDistributedObject.h:116
int version_type
Definition: coDistributedObject.h:115
int part_max_number_of_parts
Definition: coDistributedObject.h:129
static int getIntHeaderSize()
Definition: coDistributedObject.h:142
void get_objectid(int *h, int *t)
Definition: coDistributedObject.h:223
int part_max_number_of_parts_type
Definition: coDistributedObject.h:128
int get_number_of_elements_offset()
Definition: coDistributedObject.h:211
int refcount
Definition: coDistributedObject.h:118
void set_object_type(int ot)
Definition: coDistributedObject.h:228
int object_type
Definition: coDistributedObject.h:108
int getObjectType_offset()
Definition: coDistributedObject.h:207
int part_object_type
Definition: coDistributedObject.h:127
void set_objectid(int h, int t)
Definition: coDistributedObject.h:232
shmSizeType name_offset
Definition: coDistributedObject.h:121
int get_attr_type()
Definition: coDistributedObject.h:203
Definition: coDistributedObject.h:267
~coDoInfo()
Definition: coDistributedObject.h:280
void * ptr
Definition: coDistributedObject.h:273
int type
Definition: coDistributedObject.h:269
void print()
Definition: coDistributedObject.h:284
coDoInfo()
Definition: coDistributedObject.h:274
const char * description
Definition: coDistributedObject.h:271
char * obj_name
Definition: coDistributedObject.h:272
const char * type_name
Definition: coDistributedObject.h:270
Definition: coDistributedObject.h:296
coIntShm version
Definition: coDistributedObject.h:306
coShmArray * shmarr
Definition: coDistributedObject.h:308
char * getName() const
get the object's name
Definition: coDistributedObject.h:359
static int xfer_arrays
Definition: coDistributedObject.h:303
int get_type_no() const
Definition: coDistributedObject.h:497
coDistributedObject()
Definition: coDistributedObject.h:382
static List< VirtualConstructor > * vconstr_list
Definition: coDistributedObject.h:301
coDistributedObject(const coObjInfo &info, int shmSeg, shmSizeType offs, char *t)
Definition: coDistributedObject.h:444
int getRefCount() const
Definition: coDistributedObject.h:517
void print() const
Definition: coDistributedObject.h:521
coDistributedObject(const coObjInfo &info)
Definition: coDistributedObject.h:398
virtual int getObjInfo(int, coDoInfo **) const
Definition: coDistributedObject.h:325
const char * getType() const
get the object's type
Definition: coDistributedObject.h:365
bool objectOk() const
check whether object was created or received ok
Definition: coDistributedObject.h:377
coDistributedObject(const coObjInfo &info, const char *t)
Definition: coDistributedObject.h:420
virtual int rebuildFromShm()=0
int isType(const char *reqType) const
check whether this is a certain type
Definition: coDistributedObject.h:371
int createFromShm(coShmArray *arr)
Definition: coDistributedObject.h:319
virtual coDistributedObject * cloneObject(const coObjInfo &newinfo) const =0
int incRefCount() const
Definition: coDistributedObject.h:508
coIntShm refcount
Definition: coDistributedObject.h:307
int decRefCount() const
Definition: coDistributedObject.h:513
bool new_ok
Definition: coDistributedObject.h:315
void set(int i, const coDistributedObject *elem)
Definition: coShmPtrArray.cpp:107