COVISE Core
covise_appproc.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 COVISE_APPPROC_H
9#define COVISE_APPPROC_H
10
11#include "covise_process.h"
12#include "covise.h"
13
14class ShmAccess;
15
16namespace covise
17{
18
20{
21//friend class DO_PartitionedObject;
22#ifdef CRAY
23 DataManagerProcess *datamgr;
24#endif
26 ShmAccess *shm; // pointer to the sharedmemory
27 //List<coDistributedObject> *part_obj_list;
28protected:
29 void process_msg_from_dmgr(Message *); // handle msg from datamgr
30 int id;
32
33public:
35 ApplicationProcess(const char *name, int id);
36 ApplicationProcess(const char *n, int arc, char *arv[],
37 sender_type send_type = APPLICATIONMODULE);
38 ~ApplicationProcess(); // destructor
39 void handle_shm_msg(Message *);
40 void contact_controller(int port, Host *host);
41 void contact_datamanager(int port); // build connection to datamanager
42 void send_data_msg(Message *); // send message to the datamanager
43 void recv_data_msg(Message *); // recv a message from the datamanager
44 void exch_data_msg(Message *, const std::vector<int> &messageTypes); //send msg and wait for a response with one of messageTypes
45 //void add_new_part_obj(coDistributedObject *po) { part_obj_list->add(po); };
46 // gets part obj out of list
47 //coDistributedObject *get_part_obj(char *pname);
48 Message *wait_for_ctl_msg(); // wait for a message from the controller
49 Message *wait_for_data_msg(); // wait for a message from the datamanager
50 Message *check_for_ctl_msg(float time = 0.0);
51 int check_msg_queue(); // returns true if message is available in queue
52 // wait for a message from the controller at most time seconds
53 void *get_shared_memory_address();
55 {
56 return (instance);
57 };
58 int get_id()
59 {
60 return (id);
61 };
62 // nur temporaer eingefuegt, zum testen !! ^
63};
64
65// process for the userinterface
67{
68public:
69 // UserInterface(char *name, int id) :
70 // ApplicationProcess(name, id, USERINTERFACE) {};
71 UserInterface(const char *n, int arc, char *arv[])
72 : ApplicationProcess(n, arc, arv, USERINTERFACE){};
73 ~UserInterface() // destructor
74 {};
75 void contact_controller(int, Host *);
76};
77}
78#endif
#define COVISEEXPORT
Definition: coExport.h:200
GLdouble n
Definition: khronos-glext.h:8447
GLuint const GLchar * name
Definition: khronos-glext.h:6722
list of all chemical elements
Definition: coConfig.h:27
sender_type
Definition: message_types.h:369
@ USERINTERFACE
Definition: message_types.h:373
@ APPLICATIONMODULE
Definition: message_types.h:375
Definition: covise_connect.h:294
Definition: covise_host.h:19
Definition: message.h:76
Definition: dmgr.h:216
Definition: covise_appproc.h:20
int get_instance()
Definition: covise_appproc.h:54
static ApplicationProcess * approc
Definition: covise_appproc.h:34
int get_id()
Definition: covise_appproc.h:58
int instance
Definition: covise_appproc.h:31
ShmAccess * shm
Definition: covise_appproc.h:26
const DataManagerConnection * datamanager
Definition: covise_appproc.h:25
int id
Definition: covise_appproc.h:30
Definition: covise_appproc.h:67
~UserInterface()
Definition: covise_appproc.h:73
UserInterface(const char *n, int arc, char *arv[])
Definition: covise_appproc.h:71
Definition: covise_process.h:171
Definition: covise_shm.h:312